title_font broken within template layouts
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- jupyter-notebook, python
- Domínio
- data-visualization
Direção de pesquisa
Execute o exemplo de Python fornecido no Jupyter e compare a figura baseada em template com o exemplo direto de update_layout. Rastreie pio.to_templated, pio.templates e os caminhos de layout de title_font/title.font para descobrir por que o template não retém a fonte. A tarefa estará concluída quando o exemplo do template renderizar o título em Times New Roman e o exemplo de documentação vinculado voltar a funcionar.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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!
- Linguagem predominante
- Python
- Estrelas
- 18.8k
- Forks
- 2.8k
- Merge médio
- 16h 26min
- PRs com merge (30d)
- 21
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/plotly.py
-
P3 size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
bug P1
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
-
feature P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
-
feature P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Todas as issues de plotly/plotly.py
Issues semelhantes
-
link-check link-check:sphinx-theme
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
OpenHands/extensions#626 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
CSCfi/sd-search-api#39 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100