plotly / plotly/plotly.py

enable default cascade for template.coloraxis.colorscale in plotly express

Offen
#3,747 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature P3
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

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, 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

Neue Issues direkt in Ihr Postfach

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