I would like to create a pdf file [by using plt.savefig("~~~.pdf")] containing lots of (about 20) subplots each of which is drawing timeseries data. I am using a matplotlib library with python language.
Each subplot may be long, and I want to put the subplots horizontally. Therefore, the figure should be very long (horizontally), so the horizontal scroll bar should be needed!
Is there any way to do this? some example code will be appreciated!
The following is my sample code. I just wanted to draw 10 sine graphs arranged horizontally and save it as pdf file. (but I'm not pretty good at this. so the code may looks to be weird to you.. :( )
from matplotlib import pyplot as plt
import numpy as np
x=np.linspace(0,100,1000)
y=np.sin(x)
numplots=10
nr=1
nc=numplots
size_x=nc*50
size_y=size_x*3/4
fig=plt.figure(1,figsize=(size_x,size_y))
for i in range(nc):
ctr=i+1
ax=fig.add_subplot(nr,nc,ctr)
ax.plot(x,y)
plt.savefig("longplot.pdf")
plt.clf()
Thank you!