plotly / plotly/plotly.R

subplot - merging titles following ggplotly conversion

Offen
#1,990 2 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

data(faithful)

p1 <- plotly::ggplotly(
  ggplot(faithful, aes(x = eruptions)) + 
    geom_histogram(bins = 20) + 
    theme_minimal()  + 
    labs(title = "A.")
)

p2 <- plotly::ggplotly(
  ggplot(faithful, aes(x = waiting)) + 
    geom_histogram(bins = 20) + 
    theme_minimal()  + 
    labs(title = "B.")
)

pl <- subplot(p1, p2, nrows = 1, titleX = TRUE)

## note  that changing to labs(tag = "A.") results in loss of the 'tag' at the ggplotly function.  

I am creating a gglot (histogram, in this case) which includes a sub-panel label. I want to then convert to a plotly figure using the plotly::ggplotly function. The label is transmitted faithfully to each of p1 and p2. However, when combining these into a subplot, the label seems to be merged . I lose the 'A.' label on the first plot p1, generally. The titleX option does not prevent this from occurring.

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 mit dem reproduzierbaren Beispiel mit faithful-Daten unter Verwendung von ggplotly und subplot und verfolge dann, wie subplot die Titel aus p1 und p2 kombiniert, wenn titleX aktiviert ist. Bestätige das Verhalten für labs(title = "A.") und labs(title = "B."); fertig ist es, wenn beide Beschriftungen nach der Konvertierung und Kombination sichtbar bleiben.

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
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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