plotly / plotly/plotly.py

aspect="auto" for px.imshow does nothing when plotting RGB data

Ouverte
#5,172 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug documentation P3
Langage dominant
Python
Étoiles
18.8k
Forks
2.8k
Merge moyen
16 h 26 min
PR mergées (30 j)
21

Description

I am trying to plot an RGB image that strecthes to fill the figure, and I cannot get it to work.

Using a standard 2D array works as expected, and the image is able to dynamically stretch to the figure.

arr = np.random.random((100, 100))
px.imshow(arr, aspect="auto")

But if I instead try to plot an RGB image with the same settings, then the image stays with its original aspect ratio.

img = np.random.random((100, 100, 3))
px.imshow(img, aspect="auto")

In this case, setting the aspect key does nothing and the image keeps a fixed aspect ratio. Explicitly adding with and height also does nothing to change the aspect ratio.

Is this an expected limitation of the aspect setting? If yes, then it should probably be documented.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par les exemples de px.imshow dans l’issue et comparez les chemins 2D-array et RGB-array, en vous concentrant sur la façon dont aspect="auto" est géré. La tâche est terminée lorsque les images RGB s’étirent comme prévu, ou lorsque la limitation et son effet sur la largeur et la hauteur sont documentés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
numpy, python
Domaine
data-visualization
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.