I'm trying to plot several hundred subplots into one figure (i can split it into a grid and make it span several PDF pages) but the process is slow if I use the standard matplotlib subplots and add one subplot at a time. A solution that may apply to my problem here. The issue is that my data has different x range for each subplot. How can I make all the x values have the same width, say 1 inch? Here is an example that itustrates the problem.
import numpy as np
import matplotlib.pyplot as plt
ax = plt.subplot(111)
plt.setp(ax, 'frame_on', False)
ax.set_ylim([0, 5])
ax.set_xlim([0, 30])
ax.set_xticks([])
ax.set_yticks([])
ax.grid('off')
x1 = np.arange(2,8)
y1 = np.sin(x1)*np.sin(x1)
xoffset1 = max(x1) + 1
print x1
x2 = np.arange(5,10)
y2 = np.sin(x2)*np.sin(x2)
print x2
print x2+ xoffset1
xoffset2 = max(x2) + xoffset1
x3 = np.arange(3,15)
y3 = np.sin(x3)*np.sin(x3)
print x3
print x3+ xoffset2
ax.plot(x1,y1)
ax.plot(x2+xoffset1, y2)
ax.plot(x3+xoffset2, y3)
plt.show()
Thank you