Guardando gráficos en archivos pdf usando matplotlib
Quiero guardar más de 1 parcela en un archivo pdf. Aquí está mi código:
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def function_plot(X,Y):
plt.figure()
plt.clf()
pp = PdfPages('test.pdf')
graph = plt.title('y vs x')
plt.xlabel('x axis', fontsize = 13)
plt.ylabel('y axis', fontsize = 13)
pp.savefig(graph)
function_plot(x1,y1)
function_plot(x2,y2)
Sé que mis ideas están revueltas, pero no puedo encontrar la manera de escribir mi código. La cosa es que necesito que mis gráficas tengan etiquetas de eje x e y.