python - 如何在散景图中设置文本字体?
问题描述
我需要为我的硕士论文的图形设置一个 20pt 的通用文本字体。目前我正在使用 Bokeh 来绘制我的数字,但我不知道如何设置文本字体。
这是一个示例图:
图1
f1 = figure(plot_height = 500,
plot_width = 1500,
title = "TOP 1",
x_axis_label = "Date and Time",
y_axis_label = "Temperatur [°C]",
x_axis_type = "datetime") #x-Achse als Datum
f1.line(df2["Datum"],df2["Modell A"],
legend = "Modelltemp. TOP 1",
color = "blue")
f1.line(df["Date and Time"],df["Room Temperature TOP1 [C]"],
color = "green",
legend = "T_TOP1")
f1.line(df["Date and Time"],df["Setpoint TOP1 [C]"],
color = "red",
legend = "T_SP1")
f1.legend.location = "top_right"
f1.legend.orientation = "horizontal"
f1.legend.click_policy = "hide"
解决方案
Bokeh 中没有“通用文本字体”之类的东西。每个处理文本的模型都有自己的属性来控制字体大小。例如,Title
has text_font_size
,Axis
hasaxis_label_text_font_size
用于其标签,类似属性用于其刻度标签。
推荐阅读
- sql - 从对偶中选择多行和一个值
- javascript - 在每个 ajax 调用上使用循环索引
- codeskulptor - 如何让我的乒乓球拍在 CodeSkulptor 中移动
- python-3.x - pytest升级到4.0.2后如何正确替换@pytest.mark.gen_test?
- android - ScrollView XML 视图在底部
- flutter - Flutter 是否会在 iOS 中自动显示 Cupertino UI,在 Android 中使用单一代码库显示 Material?
- html - 希望文本溢出到另一个 div
- swift - Swift 核心数据查询生成 Sqlite 错误代码 769 ( sqlite3_snapshot_open failed )
- javascript - reactjs - 从api获取数据后应用程序不会改变状态
- elasticsearch - 排序和过滤弹性搜索热门文档