plotly / plotly/plotly.R

plot_ly boxplot showing wrong x-axis

Offen
#1,922 3 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

Suppose I have a list with three slots, but data for slots 2 and 3 are not yet available. When plotting a boxplot with just the first two slots, everything works as expected:

library(plotly)
y <- list("Group 1" = c(105,74,20), 
          "Group 2" = NA_real_, 
          "Group 3" = NA_real_)

boxplot <- plot_ly(type="box")

boxplot %>% 
  add_boxplot(x=y[[1]]) %>%
  add_boxplot(x=y[[2]])

image

But when trying to plot data for all three slots (where slots 2 and 3 don't have data), then the x-axis label is messed up and the data seems to be messed up as well. (I expected the boxplot to look exactly the same as the one above.)

boxplot %>% 
add_boxplot(x=y[[1]]) %>%
add_boxplot(x=y[[2]]) %>%
add_boxplot(x=y[[3]])

image

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, die R-Reproduktion des Issues mit plot_ly(type="box") und aufeinanderfolgenden add_boxplot(x=y[[...]] )-Aufrufen auszuführen und dabei zwei Traces mit drei zu vergleichen. Verfolge, wie add_boxplot Eingaben von NA_real_ und die Zuweisung von Kategorien zur x-Achse behandelt. Erledigt ist die Aufgabe, wenn das Hinzufügen leerer Slots weder die angezeigten Daten noch die Beschriftung der x-Achse im Vergleich zum Beispiel mit zwei Slots verändert.

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
50/100

Neue Issues direkt in Ihr Postfach

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