ggplotly geom_line vertical orientation is not working
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:

however, this does not carry over when the plot is converted to plotly:
g = ggplotly(p)
g

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
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- 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