How to specify size (dimension) of .eps when exported from matplotlib using savefig()

An .eps is too large to fit in a two-column article. If I scale it down, the fonts in the graph would be too small to see.

I think make the .eps smaller is better than make the fonts larger then scale it down.

There is %%Boundingbox: in .eps file which controls the size of .eps file. I am wondering how matplotlib control this parameter when exporting figure to .eps

Answers


You can either set the size of the figure when you create it:

fig, ax = plt.subplots(figsize=[3.375, 3.375])

or later

fig.set_size_inches([3.375, 3.375])

The units are in inches (and the values shown make a square figure that will fit in PRE columns). To make sure that all of the labels fit, I normally use tight_layout

fig.tight_layout(pad=0, h_pad=0, w_pad=0)

before saving


Need Your Help

How to compare a UILable text (that is linked to a UIPickerView) to an NSString?

ios uilabel uipickerview

So I have a UILabel that is linked to the current selected value of a UIPickerView.

Interpreting MethodBody.ExceptionHandlingClauses collection

c# .net reflection methodinfo

I am using reflection to analyse a method's exception handling blocks with the [ExceptionHandlingClauses] property of the [MethodBody] class. I could not figure out from MSDN Documentation how this

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.