Skip to content

Instantly share code, notes, and snippets.

@tkf
Created October 2, 2009 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkf/199455 to your computer and use it in GitHub Desktop.
Save tkf/199455 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import pylab
import numpy
t = numpy.arange(0.0, 2.0, 0.01)
s1 = numpy.sin(2*pi*t)
s2 = numpy.exp(-t)
s3 = s1*s2
f = pylab.figure()
pylab.clf()
pylab.subplots_adjust(hspace=0.001, wspace=0.001)
ax1 = pylab.subplot(3,2,1)
ax1.plot(t,s1)
pylab.yticks(arange(-0.9, 1.0, 0.4))
pylab.ylim(-1,1)
ax2 = pylab.subplot(3,2,3, sharex=ax1)
ax2.plot(t,s2)
pylab.yticks(arange(0.1, 1.0, 0.2))
pylab.ylim(0,1)
ax3 = pylab.subplot(3,2,5, sharex=ax1)
ax3.plot(t,s3)
pylab.yticks(arange(-0.9, 1.0, 0.4))
pylab.ylim(-1,1)
ax4 = pylab.subplot(3,2,2, sharey=ax1)
ax4.plot(t,s1)
pylab.yticks(arange(-0.9, 1.0, 0.4))
pylab.ylim(-1,1)
ax5 = pylab.subplot(3,2,4, sharex=ax4, sharey=ax2)
ax5.plot(t,s2)
pylab.yticks(arange(0.1, 1.0, 0.2))
pylab.ylim(0,1)
ax6 = pylab.subplot(3,2,6, sharex=ax4, sharey=ax2)
ax6.plot(t,s3)
pylab.yticks(arange(-0.9, 1.0, 0.4))
pylab.ylim(-1,1)
ticklabels = ( ax1.get_xticklabels() + ax2.get_xticklabels() +
ax4.get_xticklabels() + ax5.get_xticklabels() +
ax4.get_yticklabels() + ax5.get_yticklabels() +
ax6.get_yticklabels() )
pylab.setp(ticklabels, visible=False)
pylab.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment