如何使用Plots.jl缩放字体大小 [英] How to scale the fontsizes using Plots.jl

查看:103
本文介绍了如何使用Plots.jl缩放字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以立即重新缩放所有字体大小(图例,记号标签,轴标签…)?

is there a way to rescale all the fontsizes (legend, tickslabels, axislabels…) at once?

推荐答案

个人字体大小可以通过titlefontsizetickfontsizelegendfontsizetickfontsizeguidefontsizelegendtitlefontsize属性进行控制,但我知道这可能很乏味. 还有thickness_scaling属性.

Individual font sizes can be controlled with the titlefontsize, tickfontsize, legendfontsize, tickfontsize, guidefontsize and legendtitlefontsize attributes, but I get that this can be quite tedious. There is also the thickness_scaling attribute.

plot(rand(10), thickness_scaling = 0.5)

但是,这也会影响线宽. 第三种选择是致电

However, this also affects the line widths. The third option is to call

Plots.scalefontsizes(α)

α比例缩放所有字体大小.这将更改所有后续绘图的全局字体大小默认值,并且可以使用

to scale all font sizes by a factor α. This changes the global fontsize defaults for all subsequent plots and can be undone with

Plots.scalefontsizes(1 / α)

丹尼尔·施瓦本德在Slack上回答.

Answer by Daniel Schwabeneder on Slack.

这篇关于如何使用Plots.jl缩放字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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