python - 改变 matplotlib 中的轴权重

标签 python matplotlib

如何在 matplotlib 中更改轴权重(使轴更粗)?

from pylab import *    
x = [5,7,5,9,11,14]
y = [4,5,3,11,15,14]
scatter(x, y, s=50, color='green',marker='h')
show()

最佳答案

您可以在 Matplotlib 中设置所谓的脊柱(轴的一侧)的宽度:

fig, ax = plt.subplots()

ax.plot(np.random.randn(100).cumsum())

# The spines
plt.setp(ax.spines.values(), linewidth=3)

# The ticks
ax.xaxis.set_tick_params(width=3)
ax.yaxis.set_tick_params(width=3)

enter image description here

关于python - 改变 matplotlib 中的轴权重,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19949126/

相关文章:

python - 克利福德图书馆 : Blade indexing causing key error

python - 获取带有条件的数据框的下一行

python - setuptools 入口点。将可执行文件安装到/usr/sbin

python - Pandas:绘制从上到下的表现者

Python、Matplotlib : Normalising multiple plots to fit the same arbitrary axis limits

python 更改数字格式 ndarray 许多位

Python正则表达式从不同的组合中获取日期

python - 如何解决 matplotlib 中的溢出错误?

python - 使用 matplotlib 在 NFS 文件系统上保存图形

python - 如何使用 Python 显示值构建从正百分比到负百分比的水平堆积条形图