在绘图图表标题中使用多种字体大小(Python) [英] Using multiple font sizes in Plotly chart title (Python)

查看:49
本文介绍了在绘图图表标题中使用多种字体大小(Python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图表标题,该标题使用换行符跨越多条线.

I have a chart title which spans multiple lines using line breaks.

我希望第一行之后的所有内容都使用较小的字体(实际上是字幕),但找不到解决方法.

I'd like to have everything after the first line in a smaller font (effectively a subtitle), but can't figure out a way to do this.

在这里看不到任何类似的问题.

Couldn't see any similar question on here.

import plotly.graph_objs as go
data=[]
layout = go.Layout(title='line1' + '<br>' +  'line2')
fig = go.FigureWidget(data=data, layout=layout)
fig

任何想法表示赞赏!

推荐答案

是的,您可以将< span> 标记与CSS一起使用,如下所示:

Yes, you can use <span> tags with CSS, like this:

import plotly.graph_objs as go
data=[]
layout = go.Layout(title='line1' + '<br>' +  '<span style="font-size: 12px;">line2</span>')
fig = go.FigureWidget(data=data, layout=layout)
fig

这篇关于在绘图图表标题中使用多种字体大小(Python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆