problem with colorbar LaTeX title rendering
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 18.8k
- Fork
- 2.8k
- Merge trung bình
- 16 giờ 26 phút
- Pull request đã merge (30 ngày)
- 21
Mô tả
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?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện được cung cấp với Python 2.7 và Plotly 4.5.2, sau đó theo dõi cách tiêu đề của colorbar xử lý văn bản LaTeX và side='top'. Được xem là hoàn tất khi tiêu đề được kết xuất với LaTeX được yêu cầu và hướng ở trên mà không làm hỏng các tiêu đề colorbar khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100