go.Histogram2dContour does not normalize when using shared coloraxis and coloring='fill'
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
Setup:
plotly==5.18.0
Bug:
When adding two go.Histogram2dContour to a subplot, the colorscale is not normalized, when using a shared coloraxis and setting coloring='fill'.
It works when setting coloring='heatmap'.
Dataframes used:
df_a = pd.DataFrame({
'a':[0,0,1,1],
'b':[0,1,0,1],
'c':[0,1,2,3],
})
df_b = pd.DataFrame({
'a':[0,0,1,1],
'b':[0,1,0,1],
'c':[10,20,30,40],
})
Example coloring='fill':
Example coloring='heatmap':
Code:
fig = make_subplots(rows=1,cols=2)
fig.add_trace(
go.Histogram2dContour(
x=df_a['a'].to_list(),
y=df_a['b'].to_list(),
z=df_a['c'].to_list(),
# contours=dict(coloring="heatmap"),
contours=dict(coloring="fill"),
coloraxis="coloraxis",
showscale=True,
showlegend=False,
histfunc='max',
),
row=1,
col=1
)
fig.add_trace(
go.Histogram2dContour(
x=df_b['a'].to_list(),
y=df_b['b'].to_list(),
z=df_b['c'].to_list(),
# contours=dict(coloring="heatmap"),
contours=dict(coloring="fill"),
coloraxis="coloraxis",
showscale=True,
showlegend=False,
histfunc='max',
),
row=1,
col=2
)
fig.show()
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, die bereitgestellte Reproduktion mit plotly==5.18.0 mit zwei go.Histogram2dContour-Traces auszuführen, und vergleiche coloring='fill' mit coloring='heatmap'. Verfolge, wie die gemeinsame Coloraxis-Normalisierung in jedem Modus angewendet wird; abgeschlossen ist die Untersuchung, wenn beide Fill-Konturen die gemeinsame Colorscale konsistent über die beiden Subplots hinweg verwenden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- 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