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