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)
The line width simply helps to give a unique description or visual to a particular data set in a plot. The default value for the line width of a plot in Matplotlib is 1 . However, you can change this size to any size of your choice.
Set the Height and Width of a Figure in Matplotlib Instead of the figsize argument, we can also set the height and width of a figure. These can be done either via the set() function with the figheight and figwidth argument, or via the set_figheight() and set_figwidth() functions.
Syntax of matplotlib. It is an optional attribute, by default the figure has the dimensions as (6.4, 4.8). This is a standard plot where the attribute is not mentioned in the function. Normally each unit inch is of 80 x 80 pixels.
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()]
Maybe this is what you are looking for?
import matplotlib as mpl
mpl.rcParams['axes.linewidth'] = 0.1 #set the value globally
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With