Menu

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

Download this file

46 lines (37 with data), 1.2 kB

 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import dataplot,pdb
try:
import matplotlib
matplotlib.use('agg')
from pylab import *
ERROR_MESSAGE=''
except ImportError:
ERROR_MESSAGE='pylab module unavailable. To view this plot, please install matplotlib'
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={
'web':{'suffix':'.png'},
'thumb':{'suffix':'-thumb.png','size':(65,90)},
}
convert_from='web'
ERROR_MESSAGE=ERROR_MESSAGE
def makefile(self):
print self
pdb.set_trace()
kwargs=self.get_plot_args()
self.plot(**kwargs)
savefig(self.from_filename())
class Scatter(Plot):
"""Simple matplotlib scatterplot.
"""
def plot(self,x,y,main='',
xlab='Label this with the "xlab" argument',
ylab='Label this with the "ylab" argument',
):
plot(x,y,'bo')
title(main)
xlabel(xlab)
ylabel(ylab)
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.