plotly / plotly/plotly.py

enable setting px.scatter error bars of same color as the marker

Offen
#3,803 1 Kommentar 1 Reaktion 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

I am making an error bar plot using px.scatter. I want to set each error bar to the same color as the marker. Below is the code showing how I am making the scatter plot. As can be seen from the code, I have a continuous scale and the markers are colored based on the column 'size' from my dataframe. I have looked quite a lot in the plotly documentation but I am unable to find a way to set the error bars of the same color as the marker. Is there a fix for this? Does plotly support different colored error bars for continuous data? Any help or suggestions would be appreciated.

I have also attached a link to the screenshot of the plot (the plot is zoomed in). As can be seen from the plot, the markers have colors based on the continuous scale whereas the all the lines have the same color.

df = pd.read_csv(options['file'], sep = ',')
size = df['size'].to_list()
fig = px.scatter(df, 
                x = "start", 
                y = "rank", 
                error_x = "duration",
                render_mode = 'auto', 
                facet_row = 'api',
                category_orders ={"api": ["MPIIO", "POSIX"]})

fig.update_traces(
    marker = dict(
        color= size,
        colorscale = "portland",
        colorbar=dict(
            title = "Request Size <br>(Bytes)",
            thickness=20
        ), 
        showscale=True
    ),                   
    error_x = dict(
        width = 0,
        symmetric=False,
    ),
)

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

Reproduzieren Sie das gemeldete px.scatter-Beispiel mit kontinuierlichen Markierungsfarben und aktiviertem error_x, ausgehend von den im Issue gezeigten Aufrufen von px.scatter und fig.update_traces. Ermitteln Sie, ob Plotly die Abbildung kontinuierlicher Markierungsfarben auf Fehlerbalken unterstützt, und betrachten Sie die Arbeit als abgeschlossen, wenn das Beispiel Fehlerbalken erzeugt, die der Farbe jedes Markers entsprechen, oder wenn die Einschränkung mit einer klaren Erklärung dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Feature
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.