plotly / plotly/plotly.R

Zoom all facets at the same time

Offen
#2,142 1 Kommentar 6 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

There seems to be a discrepancy between plotly for R and for python in how it handles zooming across facets.

To take my examples directly from the documentation: https://plotly.com/ggplot2/facet-plots/ vs https://plotly.com/python/facet-plots/

In the python version, if I select a region to zoom in on, the same zoom is applied to all facets, regardless of position.

In the r version, if I zoom on one facet, the 'x' zoom is applied to facets in the same column, and the 'y' zoom is applied to facets in the same row - but other facets are unaffected.

I would like to replicate the python behaviour in r. Any clues for how to do this?

Reprex: Compare zoom behaviour between R and python

library(reshape2)
library(plotly)

p <- ggplot(tips, aes(x=total_bill)) + geom_histogram(binwidth=2,colour="white")

# Histogram of total_bill, divided by sex and smoker
p <- p + facet_grid(sex ~ smoker)

ggplotly(p)
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df, x='gdpPercap', y='lifeExp', color='continent', size='pop',
                facet_col='year', facet_col_wrap=4)
fig.show()

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 reprex aus dem Issue auszuführen und sein Facet-Zoom-Verhalten mit dem verlinkten Python-Facet-Beispiel zu vergleichen. Das Issue nennt keine Repository-Dateien oder Tests; fertig bedeutet, dass die Auswahl einer Region in einem Facet denselben x- und y-Zoom auf jedes Facet anwendet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, 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.