python - 在 python 中更改绘图标签的大小

标签 python matplotlib plot jupyter-notebook jupyter

我正在使用 GetDist用于在 jupyter 中绘制等高线。我想知道如何更改轴中数字的大小和参数标签。 代码中有几行包含标签如下:

a,b,c = np.genfromtxt('data/data.txt',unpack=True)
names = ['H','M','z']
labels =  ['H','M','z']
samples0 = MCSamples(samples=[a,b,c],names = names, labels = labels)
g.triangle_plot([samples0],['H','M','z'],legend_labels=['Summation of data'], legend_loc='upper right',filled=True)

问题是当参数的数量增加时,打印纸上的图应该变小,然后我们就看不到数字和参数的标签。

谢谢

最佳答案

我找到了一个棘手的答案

g.settings.axes_fontsize = 20
g.settings.lab_fontsize = 30
g.settings.x_label_rotation=47
g.settings.legend_fontsize = 40

通过在 GetDist 中使用 g.setting,我们可以自定义绘图。

关于python - 在 python 中更改绘图标签的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55188585/

相关文章:

Python 全局异常处理

python - Windows 命令行中的 Django 安装

python - 梯度图和箭袋图

python-3.x - 如何绘制 scikit 的 t-sne 输出数组?

条件分布的 R 图。 cdplot() 似乎没有这样做

python - QtableView单元格在窗体关闭时失去焦点时如何保存正在编辑的数据

python - 无法在for循环中创建pandas数据框

python - 使用 matplotlib.collection.LineCollection 时发生内存泄漏

svg - 将参数传递给 HandlerFunc

r - 在ggplot中绘制经验和拟合半变异函数