title_font broken within template layouts
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 42/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- jupyter-notebook, python
研究方向
在 Jupyter 中執行提供的 Python 範例,並比較以範本為基礎的圖形與直接使用 update_layout 的範例。追蹤 pio.to_templated、pio.templates 以及 title_font/title.font 的 layout 路徑,以找出範本未保留字型的原因。當範本範例以 Times New Roman 呈現標題,且連結的文件範例恢復正常時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Setting title font of a figure via templates has stopped working - including the example The template layout property which simply makes the title Rockwell in Size 24.
The example below should show (in Jupyter) a blank plot with a title in Times New Roman
import plotly.express as px
import plotly.io as pio
import plotly.graph_objs as go
# we create a figure with a layout, where we only change the title_font
fig = go.Figure(layout=dict(title_font=dict(family="Times New Roman", size=24)))
# create a test template
pio.templates["test_template"] = pio.to_templated(fig).layout.template
# show a blank plot with just a title to show the template won't pull in title_font data
px.line(title="This Should Be Times New Roman", template="test_template").show()
It doesn't make a difference if we use full dictionary or magic underscore notation
title=dict(font=dict(family="Times New Roman"))
title_font=dict(family="Times New Roman")
** However **
Updating the layout of a figure, not using the template, does still work, for example
# build fig with template
# use the fig.update_layout() to update title font in layout
# This will have a title in Times New Roman
fig = px.line(title="This IS Times New Roman", template="test_template")
fig = fig.update_layout(title_font={'family':'Times New Roman'}).show()
Thank you for a great tool!
- 主要語言
- Python
- 星號
- 18.8k
- 分支
- 2.8k
- 平均合併
- 16 小時 26 分鐘
- 30 天內合併 PR
- 21
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/plotly.py 的其他 Issue
-
P3 size: 1 task
難度 2/5 1-3 小時 新手友好度 72/100
-
bug P1
難度 1/5 1 小時以內 新手友好度 68/100
-
feature P3
難度 2/5 1-3 小時 新手友好度 62/100
-
feature P3
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
bancolombia/sentinel#23 ·
-
test md 未關閉CI
難度 2/5 1-3 小時 新手友好度 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難度 2/5 1-3 小時 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難度 2/5 1-3 小時 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 74/100