enable default cascade for template.coloraxis.colorscale in plotly express
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 16 Std. 26 Min.
- Gemergte PRs (30 T.)
- 21
Beschreibung
The official way of controlling the PX colorscale via templates is like this:
import plotly.express as px
import plotly.graph_objects as go
template = go.layout.Template()
template.layout.colorscale.sequential = px.colors.sequential.Blues
px.imshow([[1, 20, 30], [20, 1, 60], [30, 60, 1]], template=template)
But using the following will cause PX to use Viridis because we're providing a template without a default colorscale in the above location... This is pretty counter-intuitive and a relatively reasonable defaults cascade seems possible.
import plotly.express as px
import plotly.graph_objects as go
template = go.layout.Template()
template.layout.coloraxis.colorscale= px.colors.sequential.Blues
px.imshow([[1, 20, 30], [20, 1, 60], [30, 60, 1]], template=template)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, beide Plotly Express-Beispiele aus dem Issue zu reproduzieren, und vergleiche die resultierenden Farbskalen. Verfolge, wie PX template.layout.colorscale.sequential im Vergleich zu template.layout.coloraxis.colorscale anwendet, und füge anschließend Tests für das erwartete Kaskadenverhalten hinzu. Fertig ist die Aufgabe, wenn das zweite Beispiel die bereitgestellte Blues-Farbskala anstelle von Viridis verwendet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100