dpi in matplotlib code example Example: matplotlib plot dpi plt.rcParams['figure.dpi'] = 300 plt.rcParams['savefig.dpi'] = 300