plotly / plotly/plotly.py

ValueError when setting zmin, zmax for rgb image

Aperta
#1,973 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P3
Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

There seem to be a validation error bug for setting zmin, zmax for rgb images. It appears the validation code expects a tuple or list of size 4 ( as would be the case for rgba) and not size 3 as should be the case for rgb.

im= np.random.randint(256,size=(50,50,3),dtype=np.uint8)
fig = go.Figure(go.Image(z=im,colormodel='rgb',zmin=[10,10,10],zmax=[100,100,100]))
fig.show()

Results in the following error:

File "C:\Users\NA\Anaconda3\lib\site-packages_plotly_utils\basevalidators.py", line 283, in raise_invalid_val

valid_clr_desc=self.description(),

ValueError:
Invalid value of type 'builtins.tuple' received for the 'zmax' property of image
Received value: [100, 100, 100]

The 'zmax' property is an info array that may be specified as:

* a list or tuple of 4 elements where:

(0) The 'zmax[0]' property is a number and may be specified as:
- An int or float
(1) The 'zmax[1]' property is a number and may be specified as:
- An int or float
(2) The 'zmax[2]' property is a number and may be specified as:
- An int or float
(3) The 'zmax[3]' property is a number and may be specified as:
- An int or float

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo l'esempio fornito di NumPy e go.Image con un array RGB e valori di zmin/zmax di lunghezza tre. Segui la validazione della proprietà dell'immagine che genera il ValueError e confrontala con la gestione di RGBA. Il lavoro è completato quando i limiti RGB vengono accettati e la validazione RGBA esistente rimane corretta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
numpy, python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.