problem with colorbar LaTeX title rendering
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
I am trying to implement a LaTeX math title for my colorbar and plotly is having some trouble rendering it. I am using Python 2.7, Plotly 4.5.2. My code:
fig = go.Figure()
fig.add_trace(go.Scatter(x=x_data,
y=y_data,
mode='markers',text=obj_name,name='',
marker=dict(symbol='circle',size=12,line=dict(width=1,color='SlateGray'),
opacity=0.75,color=log_mbh,colorscale='Rainbow',showscale=True,
cmin=6.0,cmax=8.0,
colorbar=dict(title=dict(text=r'$\Large\alpha\beta\gamma\delta$',side='top'),
thickness=50,tickmode='array',tickvals=[6.0,6.5,7.0,7.5,8.0]),
),
)
)
fig.add_trace(go.Scatter(x=np.arange(0,300,10), y=np.arange(0,300,10),
line = dict(color='LightSlateGray', width=2, dash='dash')))
fig.update_layout(
template='plotly_white',
xaxis = dict(showgrid=False,ticks='inside',zeroline=True,zerolinecolor='black',rangemode='tozero'),
yaxis = dict(showgrid=False,ticks='inside',zeroline=True,zerolinecolor='black',rangemode='tozero'),
xaxis_title=dict(text=r'$x$'),
yaxis_title=dict(text=r'$y$'),
font=dict(size=16),
showlegend = False,
autosize = False,
width = 750,
height = 750,
margin = dict(l=50,r=50,b=50,t=50,pad=10),
)
fig.show()
Which produces the output:

As you can see, the LaTeX title seems to be rotated 90 deg, and ignoring side='top'. I have tried to increase the width of the colorbar and increase the plot's margins to no avail. Is there a workaround or solution for this problem?
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 Python 2.7 und Plotly 4.5.2 auszuführen, und verfolge anschließend, wie der Titel der colorbar LaTeX-Text und side='top' verarbeitet. Als erledigt gilt die Aufgabe, wenn der Titel mit dem angeforderten LaTeX und der Ausrichtung oben gerendert wird, ohne andere Titel von colorbars zu beeinträchtigen.
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