Figures are very important for data presentation. They are used in your papers and slides. Please spend time make good figures because when people read your paper, they focus on your figures. My workflow is usually plotting or generating the first draft using matplotlib and then further editing it using Illustrator.
Formatting
Your figure should be clear and easy to read. Please make sure to use large fonts and labels. For publication, pay attention to the width which should be either single (4 inches) or double columns (7 inches). For plotting, it is recommended to use vector image as much as possible. If raster image is used, the resolution should be at least 300 ppi. png
format is recommended for figures with simple structure such as plots and support transparency, whereas jpeg
is recommended for photos.
Font
I prefer Halvetica or Myriad Pro (with Illustrator) fonts. Light typefaces can give your text beauty and clarity when you use it right. No matter what typeface you use, you should always make your text easy to read.
Tip
Please refer to this useful webpage if you doubt of choosing light/normal typefaces: https://uxmovement.com/content/dos-and-donts-of-using-light-typefaces/
Colors
You can refer to the figure style used in famous journals such as Nature and Economics. You should avoid over saturated colors such as pure red and blue. You can refer to following websites:
Settings for plotting
You can use below script to setup a nice plot using matplotlib
. You can further polish/edit your figure in Illustrator after you save it into vector format.
def setup_plot():
# Infinite plotting stuff from down. Might not require cleaning.
plt.rcParams['text.latex.preamble'] = [
# i need upright \micro symbols, but you need...
r'\usepackage{siunitx}',
# ...this to force siunitx to actually use your fonts
r'\usepackage[T1]{fontenc}',
r'\sisetup{detect-all}',
r'\usepackage{helvet}', # set the normal font here
# load up the sansmath so that math -> helvet##
r'\usepackage[eulergreek,EULERGREEK]{sansmath}',
r'\sansmath', # <- tricky! -- gotta actually tell tex to use!
]
plt.rcParams['mathtext.fallback_to_cm'] = 'True'
#plt.rc('font', family='sans-serif')
# plt.rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica-light']})
plt.rc('text', usetex=True)
plt.rcParams['lines.antialiased'] = True
plt.rcParams['legend.fancybox'] = False
plt.rcParams['legend.loc'] = 'best'
plt.rcParams['legend.numpoints'] = 1
plt.rcParams['legend.fontsize'] = '10'
plt.rcParams['legend.framealpha'] = None
plt.rcParams['legend.scatterpoints'] = 1
plt.rcParams['legend.edgecolor'] = 'inherit'
plt.rcParams['xtick.major.size'] = 7
plt.rcParams['xtick.major.width'] = 0.5
plt.rcParams['xtick.minor.size'] = 4
plt.rcParams['xtick.minor.width'] = 0.5
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.major.size'] = 7
plt.rcParams['ytick.major.width'] = 0.5
plt.rcParams['ytick.minor.size'] = 4
plt.rcParams['ytick.minor.width'] = 0.5
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['axes.linewidth'] = 0.5