matplotlib border width


Question

I use matplotlib 0.99.

I am not able to change width of border of subplot, how can I do it?

Code is as follows:

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) 

The last two lines do not work, but the following works fine:

legend.get_frame().set_ linewidth(0.1)
1
19
12/3/2015 4:05:55 PM

You want to adjust the border line size? You need to use ax.spines[side].set_linewidth(size).

So something like:

[i.set_linewidth(0.1) for i in ax.spines.itervalues()]
30
10/29/2009 8:01:47 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon