Is there an efficient way to store 2D plots as a vector graphic in python?
问题 I'm currently trying to store python plots as vector graphics to improve their appearance in a latex document. For 1D plots this works quite fine: import numpy as np import matplotlib as mpl mpl.use('svg') new_rc_params = { "font.family": 'Times', "font.size": 12, "font.serif": [], "svg.fonttype": 'none'} #to store text as text, not as path mpl.rcParams.update(new_rc_params) import matplotlib.pyplot as plt x = np.linspace(-.5, .5, 1024) plt.figure() plt.plot(x, x) plt.title('\$x = y\$') plt