HOME/Articles/

matplotlib example matplotlib setup (snippet)

Article Outline

Python matplotlib example 'matplotlib setup'

Modules used in program:

  • import matplotlib.pyplot as plt
  • import matplotlib

python matplotlib setup

Python matplotlib example: matplotlib setup

import matplotlib
import matplotlib.pyplot as plt

# Avoid Type2 fonts
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42

# Plots looking nice
plt.style.use('ggplot')  # R-like plots

#Save nice plots
FIGSAVE_KWARGS = dict(bbox_inches='tight')