problem with colorbar LaTeX title rendering
オープン
まだ誰も着手していません。
bug
P3
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
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?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供されている Python 2.7 と Plotly 4.5.2 の再現コードを実行し、次に colorbar のタイトルが LaTeX テキストと side='top' をどのように処理するかを追跡します。完了条件は、他の colorbar のタイトルを壊すことなく、要求された LaTeX と上向きの向きでタイトルがレンダリングされることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100