import dataplot
from pylab import *
class Plot(dataplot.GenericPlot):
"""Matplotlib plot.
The idea here is that each plot type is a subclass of Plot that
defines a plot() method, which will be called with the kwargs
given by the supplied callable data_fun.
"""
convert_to={
'png':{'suffix':'.png'},
'thumb':{'suffix':'-thumb.png','convert_args':'-resize 65x90'},
'ps':{'suffix':'.ps'},
}
convert_from='ps'
def makefile(self):
kwargs=self.get_plot_args()
self.plot(**kwargs)
savefig(self.get_filenames()[self.convert_from])
class Scatter(Plot):
"""Simple matplotlib scatterplot.
"""
def plot(self,x,y,main=''):
plot(x,y,'bo')
title(main)