`add_annotations` incompatible with multicategory axis
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
I've been attempting to plot horizontal arrows using add_annotations in a plotly object with a multicategory y-axis. Instead of positioning annotations along the y-axis, they are all positioned at the origin.
(Because the same behavior occurs with other types of annotation, I have included some text in the reprex as well.)
library(tibble)
library(plotly)
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
tribble(
~cat1, ~cat2, ~start, ~end,
"a", "f", 1, 2,
"a", "g", 2, 3,
"a", "h", 3, 0,
"b", "f", 0, 3
) %>%
plot_ly(y = ~list(cat1, cat2)) %>%
add_markers(x = ~start) %>%
add_markers(x = ~end) %>%
add_annotations(text = ":(",
showarrow = TRUE,
xref = "x", axref = "x",
yref = "y", ayref = "y",
x = ~start,
ax = ~end,
y = ~list(cat1, cat2),
ay = ~list(cat1, cat2))

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 par le R reprex fourni et le point d’entrée add_annotations, puis suivez la manière dont les valeurs de multicategory y-axis sont traitées pour les annotations par rapport aux markers. Reproduisez le positionnement de l’origine avec l’exemple et vérifiez que les annotations utilisant list(cat1, cat2) sont positionnées le long de la multicategory axis sans provoquer de régression pour les autres annotation types.
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