python Programming Glossary: bbox_inches
Moving matplotlib legend outside of the axis makes it cutoff by the figure box http://stackoverflow.com/questions/10101700/moving-matplotlib-legend-outside-of-the-axis-makes-it-cutoff-by-the-figure-box call to fig.savefig 'samplefigure' bbox_extra_artists lgd bbox_inches 'tight' #Note that the bbox_extra_artists must be an iterable..
How to set the margins for a matplotlib figure? http://stackoverflow.com/questions/10898919/how-to-set-the-margins-for-a-matplotlib-figure at plt.tight_layout or plt.subplots_adjust or fig.savefig bbox_inches 'tight' . With subplots_adjust you can adjust most parameters.. you can adjust most parameters while tight_layout and bbox_inches 'tight' are more or less semi automatic. share improve this..
Is there a way to convert pyplot.imshow() object to numpy array? http://stackoverflow.com/questions/14869321/is-there-a-way-to-convert-pyplot-imshow-object-to-numpy-array 10 10 buffer_ StringIO plt.savefig buffer_ format png bbox_inches 'tight' pad_inches 0 buffer_.seek 0 image PIL.Image.open buffer_..
Matplotlib: Aligning y-ticks to the left http://stackoverflow.com/questions/15882249/matplotlib-aligning-y-ticks-to-the-left 12 8 fig.savefig r'C try.png' bbox_extra_artists r bbox_inches 'tight' python matplotlib share improve this question You..
What is the difference between 'log' and 'symlog'? http://stackoverflow.com/questions/3305865/what-is-the-difference-between-log-and-symlog is 80 pyplot.savefig 'matplotlib_xscale_linear.png' dpi 50 bbox_inches 'tight' Remember you can change the figure size using fig pyplot.gcf..
Reduce left and right margins in matplotlib plot http://stackoverflow.com/questions/4042192/reduce-left-and-right-margins-in-matplotlib-plot share improve this question I think all you need is the bbox_inches 'tight' kwarg to plt.savefig... E.g. import matplotlib.pyplot..
Save a subplot in matplotlib http://stackoverflow.com/questions/4325733/save-a-subplot-in-matplotlib much of a need to do it it is possible. savefig takes a bbox_inches argument that can be used to selectively save only a portion.. fig.dpi_scale_trans.inverted fig.savefig 'ax2_figure.png' bbox_inches extent # Pad the saved area by 10 in the x direction and 20.. in the y direction fig.savefig 'ax2_figure_expanded.png' bbox_inches extent.expanded 1.1 1.2 The full figure Area inside the second..
Matplotlib savefig with a legend outside the plot http://stackoverflow.com/questions/8971834/matplotlib-savefig-with-a-legend-outside-the-plot bbox_to_anchor 1.0 0.5 #pyplot.show fig.savefig 'aaa.png' bbox_inches 'tight' pyplot.show displays the correct plot with a legend..
Get coordinates of local maxima in 2D array above certain value http://stackoverflow.com/questions/9111711/get-coordinates-of-local-maxima-in-2d-array-above-certain-value y_center plt.imshow data plt.savefig ' tmp data.png' bbox_inches 'tight' plt.autoscale False plt.plot x y 'ro' plt.savefig '.. False plt.plot x y 'ro' plt.savefig ' tmp result.png' bbox_inches 'tight' Given data.png the above program yields result.png with..
Matplotlib plots: removing axis, legends and white spaces http://stackoverflow.com/questions/9295026/matplotlib-plots-removing-axis-legends-and-white-spaces leaves the white space around the border however. Adding bbox_inches 'tight' to the savefig command almost gets you there you can..
matplotlib save plot to image file instead of displaying it (so can be used in batch scripts for example) http://stackoverflow.com/questions/9622163/matplotlib-save-plot-to-image-file-instead-of-displaying-it-so-can-be-used-in-b
|