plotly / plotly/plotly.R

Empty facets when using subplot on multiple facet plots with shareX = TRUE

Offen
#1,962 1 Kommentar 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 running the code below, the first subplot produces 4 empty facets in the two plotlys while the latter produces no empty facets (expected). I notice that the third and fourth xaxis x3 and x4 do not exist in the plotly object xaxis property in $x$data. It seems to be hard capped at two such that the traces intended for the >2 facets are accumulated into the second facet (x2)

library(tidyverse)
library(plotly)
facet_plot <- ggplotly(
  tibble(x = rnorm(75), y = rnorm(75), type = rep(LETTERS[1:3], 25)) %>%
    ggplot(aes(x, y)) + geom_point() + facet_wrap(~ type))
subplot(facet_plot, facet_plot, nrows = 2, shareX = TRUE)
subplot(facet_plot, facet_plot, nrows = 2)

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 reproduzierbare R-Beispiel mit zwei Facet-Plots auszuführen, und vergleiche die Ergebnisse der Subplots mit gemeinsamem und nicht gemeinsamem X. Untersuche die xaxis-Einträge des x$data-Objekts des Plots, insbesondere x3 und x4; als abgeschlossen gilt die Aufgabe, wenn gemeinsam genutzte Subplots alle Facet-Achsen beibehalten und keine leeren Facets erscheinen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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