我使用 matplotlib 0.99。
我无法更改边框的宽度,subplot
我该怎么做?
代码如下:
fig = plt.figure(figsize = (4.1, 2.2))
ax = fig.add_subplot(111)
ax.patch.set_ linewidth(0.1)
ax.get_frame().set_linewidth(0.1)
最后两行不起作用,但以下工作正常:
legend.get_frame().set_ linewidth(0.1)
我使用 matplotlib 0.99。
我无法更改边框的宽度,subplot
我该怎么做?
代码如下:
fig = plt.figure(figsize = (4.1, 2.2))
ax = fig.add_subplot(111)
ax.patch.set_ linewidth(0.1)
ax.get_frame().set_linewidth(0.1)
最后两行不起作用,但以下工作正常:
legend.get_frame().set_ linewidth(0.1)
您想调整边框线的大小吗?您需要使用 ax.spines[side].set_linewidth(size)。
所以像:
[i.set_linewidth(0.1) for i in ax.spines.itervalues()]
也许这就是你要找的?
import matplotlib as mpl
mpl.rcParams['axes.linewidth'] = 0.1 #set the value globally
这对我有用[x.set_linewidth(1.5) for x in ax.spines.values()]