garrettj403 / SciencePlots

Matplotlib styles for scientific plotting
MIT License
6.98k stars 701 forks source link

Figure size for IEEE not setting correctly #55

Closed HalonMallic closed 2 years ago

HalonMallic commented 2 years ago

I have been using this library to make some plots for use in IEEE papers.

When using plt.style.use(['science','ieee']) and fig.savefig('Figures/tradeproportion_orders.pdf') I find that the output is larger than a single IEEE column width.

Do you know why this is/ how to fix it?

garrettj403 commented 2 years ago

Hi Billy

It's hard to say without seeing your Python script / latex document.

Do you import any other packages that might change the default figure size (e.g., seaborn)? I assume that you aren't changing the figure size manually in either the Python script (e.g., something like plt.figure(figsize=(5,5))) or the Latex document (e.g., something like \includegraphics[width=\textwidth]{figure.pdf}).

The column width in IEEE journals is 3.5 inches. The ieee.mplstyle style sets the width to 3.3 inches.

HalonMallic commented 2 years ago

Thanks very much - I've found that when the figure is saved, it gets saved as the correct figure size. It's only when using plt.show() that the size is incorrect!