plotly / plotly/plotly.R

Bug with legend position and the title of the second y axis

Offen
#1,808 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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 plotly, I'm trying to have multiple axes on my graph, but when I switch the legend side to horizontal, the second y axis label overlays the ticks and is impossible to read. to show the problem, I'll use the exemple in the R plotly documentation, except that I add one line : legend = list(orientation = 'h'). The output it produces is attached. I can fix the problem by manually adding a marging, but I don't think that is the desired output of your function.
bug_yaxis
sorry for the broken reprex, I don't know how to add plotly as a library into the reprex.

Best
Xav


ay <- list(
  tickfont = list(color = "red"),
  overlaying = "y",
  side = "right",
  title = "second y axis"
)
fig <- plot_ly()
#> Error in plot_ly(): impossible de trouver la fonction "plot_ly"
fig <- fig %>% add_lines(x = ~1:3, y = ~10*(1:3), name = "slope of 10")
#> Error in fig %>% add_lines(x = ~1:3, y = ~10 * (1:3), name = "slope of 10"): impossible de trouver la fonction "%>%"
fig <- fig %>% add_lines(x = ~2:4, y = ~1:3, name = "slope of 1", yaxis = "y2")
#> Error in fig %>% add_lines(x = ~2:4, y = ~1:3, name = "slope of 1", yaxis = "y2"): impossible de trouver la fonction "%>%"
fig <- fig %>% layout(
  title = "Double Y Axis", yaxis2 = ay,
  xaxis = list(title="x"),
  legend = list(orientation = 'h')
)
#> Error in fig %>% layout(title = "Double Y Axis", yaxis2 = ay, xaxis = list(title = "x"), : impossible de trouver la fonction "%>%"

fig
#> Error in eval(expr, envir, enclos): objet 'fig' introuvable

Created on 2020-07-01 by the reprex package (v0.3.0)


Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das R plotly-Dokumentationsbeispiel mit einer zweiten y-Achse und legend = list(orientation = 'h') zu reproduzieren; das Issue nennt keine Quelldatei und keinen Test. Vergleiche das resultierende Layout mit der angehängten Ausgabe und betrachte das Issue als erledigt, wenn der Titel der zweiten y-Achse lesbar ist, ohne manuell einen Rand hinzuzufügen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
plotly, r
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.