plotly / plotly/plotly.R

ggplotly geom_line vertical orientation is not working

Ouverte
#2,251 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
R
Étoiles
2.7k
Forks
641
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

ggplot2's geom_line allows setting the y-axis as the independent variable, by plotting in the order of how x is arranged:

library(tidyverse)
library(plotly)

c2 = c(1,2,3,4)
c1 = c(3,2,1,4)

dataset = data.frame(x=c1,y=c2)

p = ggplot(dataset %>%
         arrange(y), aes(x=x, y=y))+ 
  geom_point()+
  geom_line(orientation="y")+
  labs(
    y = "Depth", x = "Maximum concentration", 
  )+
  scale_y_reverse()
p

which results in:
229020097-603fbf58-394f-47cf-84cc-6a2865296070

however, this does not carry over when the plot is converted to plotly:

g = ggplotly(p)
g

229020153-cdecf359-74fc-4339-bc38-c1fc612f19d2

I noted that the plotly documentation does mention orientation as well.
https://plotly.com/ggplot2/line-charts/#vertical-plot-orientation

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 avec l’exemple R fourni en utilisant geom_line(orientation="y") de ggplot2 et la conversion via ggplotly(p). Comparez le résultat de ggplot2 avec le graphique converti et consultez la documentation de Plotly sur l’orientation verticale des graphiques. La tâche est terminée lorsque le graphique converti conserve l’orientation verticale demandée.

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

Évaluation

Stack technique
r
Domaine
data-visualization
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

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