I currently use Spyder to generate some plots that are shown in Spyder's IPython console. This allows me to save the output as an HTML file by right-clicking on the IPython console and selecting 'Save as HTML/XML'.
Say I have the following code:
import matplotlib.pylab as plt
print "Some text."
plt.plot([1,6,3,9,5])
plt.title('Some values')
Now I want to run this script remotely via SSH. How can I generate an equivalent html file with the output that would normaly be generated in the IPython console without opening Spyder? The -X parameter of ssh can be used. I am looking for an answer that is not specific to the code above but works for any kind of plot/output.