add_annotations doesn't respect log scale
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
When using add_annotations with a log scale, the coordinates of the annotations are not automatically log-transformed.
exp_dat <- data.frame(x = 0:100,
y = exp(0:100))
ann_dat <- data.frame(x = c(1, 10, 100),
y = exp(c(1, 10, 100)),
label = c(1, 10, 100))
plot_ly(type = "scatter", mode = "lines+markers") %>%
add_lines(., data = exp_dat, x = ~x, y = ~y) %>%
add_annotations(., data = ann_dat, x = ~x, y = ~y, text = ~label) %>%
layout(., yaxis = list(type = "log"))
The desired result can be obtained by manually log-transforming the coordinates, but it would be more intuitive if this wasn't necessary.
plot_ly(type = "scatter", mode = "lines+markers") %>%
add_lines(., data = exp_dat, x = ~x, y = ~y) %>%
add_annotations(., data = ann_dat, x = ~x, y = ~log10(y), text = ~label) %>%
layout(., yaxis = list(type = "log"))
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das bereitgestellte R-Beispiel mit add_annotations und einer logarithmischen y-Achse und untersuche dann den Einstiegspunkt von add_annotations und dessen Verarbeitung von Annotierungskoordinaten. Erledigt ist dies, wenn die Annotationen auf der logarithmischen Skala korrekt ausgerichtet sind, ohne die y-Werte manuell zu transformieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- r
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100