Menu

[r24]: / trunk / matplotlib / __init__.py  Maximize  Restore  History

Download this file

32 lines (24 with data), 768 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.