md-arif-shaikh / publication-plot-settings

matplotlib plot settings for publication quality plots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Publication quality plot settings for matplotlib

About

Settings for publication quality plots using matplotlib. The goal here is to get plots consistent with high quality journals.

To make sure that we do the following

  • Save the fig at the actual figure size that would be put in the paper. This would make sure that the fonts and labels are visible and has correct sizes. This would imply that we do not scale the figure in the TeX document. The figure size could in principle vary with journals and the scope of use.
  • Use a linestyle cycler which would plot different lines with different styles to make sure that they are dintinguished easily.
  • Use a color cycle with nice colors.
  • Use appropriate spaces around the plot inside the figure such that no spaces are wasted.

Examples

APS

  • one column
   import numpy as np
   import plotsettings as plts

   x = np.arange(-np.pi, np.pi, 0.01)
   fig, ax = plts.set("APS", left=0.17)
   for idx in range(5):
	ax.plot(x, np.sin(x + idx), label=r"$i = %.f$" % idx)
   ax.set_xlabel(r"$\theta$")
   ax.set_ylabel(r"$\sin(\theta + i)$")
   ax.legend(loc="upper left")
   ax.grid()
   fig.savefig("../figs/APS.pdf")
  • two column
   fig, ax = plts.set("APS", fig_type="twocol", left=0.1)
   for idx in range(5):
	ax.plot(x, np.sin(x + idx), label=r"$i = %.f$" % idx)
   ax.set_xlabel(r"$\theta$")
   ax.set_ylabel(r"$\sin(\theta + i)$")
   ax.legend(loc="upper left")
   ax.grid()
   fig.savefig("../figs/APS_twocol.pdf")

References

About

matplotlib plot settings for publication quality plots

License:MIT License


Languages

Language:Python 100.0%