I want to make the ticks on the right and upper axis invisible and am not sure what the third line should be:
import matplotlib.pyplot as plt
plt.plot(X,Y)
#
Have a look at http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html
import pylab as p
t = p.arange(0.0, 2.0, 0.01)
ax=p.subplot(111)
s = p.sin(2*p.pi*t)
ax.plot(t, s, color='r',linewidth=1.0)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
p.show()