@@ -1,401 +1,408 | |||||
1 | import os |
|
1 | import os | |
2 | import numpy |
|
2 | import numpy | |
3 | import time, datetime |
|
3 | import time, datetime | |
4 | import mpldriver |
|
4 | import mpldriver | |
5 |
|
5 | |||
6 |
|
6 | |||
7 | class Figure: |
|
7 | class Figure: | |
8 |
|
8 | |||
9 | __driver = mpldriver |
|
9 | __driver = mpldriver | |
10 | fig = None |
|
10 | fig = None | |
11 |
|
11 | |||
12 | idfigure = None |
|
12 | idfigure = None | |
13 | wintitle = None |
|
13 | wintitle = None | |
14 | width = None |
|
14 | width = None | |
15 | height = None |
|
15 | height = None | |
16 | nplots = None |
|
16 | nplots = None | |
17 | timerange = None |
|
17 | timerange = None | |
18 |
|
18 | |||
19 | axesObjList = [] |
|
19 | axesObjList = [] | |
20 |
|
20 | |||
21 | WIDTH = None |
|
21 | WIDTH = None | |
22 | HEIGHT = None |
|
22 | HEIGHT = None | |
23 | PREFIX = 'fig' |
|
23 | PREFIX = 'fig' | |
24 |
|
24 | |||
25 | def __init__(self): |
|
25 | def __init__(self): | |
26 |
|
26 | |||
27 | raise ValueError, "This method is not implemented" |
|
27 | raise ValueError, "This method is not implemented" | |
28 |
|
28 | |||
29 | def __del__(self): |
|
29 | def __del__(self): | |
30 |
|
30 | |||
31 | self.__driver.closeFigure() |
|
31 | self.__driver.closeFigure() | |
32 |
|
32 | |||
33 | def getFilename(self, name, ext='.png'): |
|
33 | def getFilename(self, name, ext='.png'): | |
34 |
|
34 | |||
35 | filename = '%s-%s_%s%s' %(self.wintitle[0:10], self.PREFIX, name, ext) |
|
35 | path = '%s%03d' %(self.PREFIX, self.idfigure) | |
|
36 | filename = '%s_%s%s' %(self.PREFIX, name, ext) | |||
36 |
|
37 | |||
37 | return filename |
|
38 | return os.path.join(path, filename) | |
38 |
|
39 | |||
39 | def getAxesObjList(self): |
|
40 | def getAxesObjList(self): | |
40 |
|
41 | |||
41 | return self.axesObjList |
|
42 | return self.axesObjList | |
42 |
|
43 | |||
43 | def getSubplots(self): |
|
44 | def getSubplots(self): | |
44 |
|
45 | |||
45 | raise ValueError, "Abstract method: This method should be defined" |
|
46 | raise ValueError, "Abstract method: This method should be defined" | |
46 |
|
47 | |||
47 | def getScreenDim(self, widthplot, heightplot): |
|
48 | def getScreenDim(self, widthplot, heightplot): | |
48 |
|
49 | |||
49 | nrow, ncol = self.getSubplots() |
|
50 | nrow, ncol = self.getSubplots() | |
50 |
|
51 | |||
51 | widthscreen = widthplot*ncol |
|
52 | widthscreen = widthplot*ncol | |
52 | heightscreen = heightplot*nrow |
|
53 | heightscreen = heightplot*nrow | |
53 |
|
54 | |||
54 | return widthscreen, heightscreen |
|
55 | return widthscreen, heightscreen | |
55 |
|
56 | |||
56 | def getTimeLim(self, x, xmin, xmax): |
|
57 | def getTimeLim(self, x, xmin, xmax): | |
57 |
|
58 | |||
58 | thisdatetime = datetime.datetime.fromtimestamp(numpy.min(x)) |
|
59 | thisdatetime = datetime.datetime.utcfromtimestamp(numpy.min(x)) | |
59 | thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0)) |
|
60 | thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0)) | |
60 |
|
61 | |||
61 | #################################################### |
|
62 | #################################################### | |
62 | #If the x is out of xrange |
|
63 | #If the x is out of xrange | |
63 | if xmax < (thisdatetime - thisdate).seconds/(60*60.): |
|
64 | if xmax < (thisdatetime - thisdate).seconds/(60*60.): | |
64 | xmin = None |
|
65 | xmin = None | |
65 | xmax = None |
|
66 | xmax = None | |
66 |
|
67 | |||
67 | if xmin == None: |
|
68 | if xmin == None: | |
68 | td = thisdatetime - thisdate |
|
69 | td = thisdatetime - thisdate | |
69 | xmin = td.seconds/(60*60.) |
|
70 | xmin = td.seconds/(60*60.) | |
70 |
|
71 | |||
71 | if xmax == None: |
|
72 | if xmax == None: | |
72 | xmax = xmin + self.timerange/(60*60.) |
|
73 | xmax = xmin + self.timerange/(60*60.) | |
73 |
|
74 | |||
74 | mindt = thisdate + datetime.timedelta(0,0,0,0,0, xmin) |
|
75 | mindt = thisdate + datetime.timedelta(0,0,0,0,0, xmin) - datetime.timedelta(time.timezone) | |
75 | tmin = time.mktime(mindt.timetuple()) |
|
76 | tmin = time.mktime(mindt.timetuple()) | |
76 |
|
77 | |||
77 | maxdt = thisdate + datetime.timedelta(0,0,0,0,0, xmax) |
|
78 | maxdt = thisdate + datetime.timedelta(0,0,0,0,0, xmax) - datetime.timedelta(time.timezone) | |
78 | tmax = time.mktime(maxdt.timetuple()) |
|
79 | tmax = time.mktime(maxdt.timetuple()) | |
79 |
|
80 | |||
80 | self.timerange = tmax - tmin |
|
81 | self.timerange = tmax - tmin | |
81 |
|
82 | |||
82 | return tmin, tmax |
|
83 | return tmin, tmax | |
83 |
|
84 | |||
84 | def init(self, idfigure, nplots, wintitle): |
|
85 | def init(self, idfigure, nplots, wintitle): | |
85 |
|
86 | |||
86 | raise ValueError, "This method has been replaced with createFigure" |
|
87 | raise ValueError, "This method has been replaced with createFigure" | |
87 |
|
88 | |||
88 | def createFigure(self, idfigure, wintitle, widthplot=None, heightplot=None): |
|
89 | def createFigure(self, idfigure, wintitle, widthplot=None, heightplot=None): | |
89 |
|
90 | |||
90 | """ |
|
91 | """ | |
91 | Crea la figura de acuerdo al driver y parametros seleccionados seleccionados. |
|
92 | Crea la figura de acuerdo al driver y parametros seleccionados seleccionados. | |
92 | Las dimensiones de la pantalla es calculada a partir de los atributos self.WIDTH |
|
93 | Las dimensiones de la pantalla es calculada a partir de los atributos self.WIDTH | |
93 | y self.HEIGHT y el numero de subplots (nrow, ncol) |
|
94 | y self.HEIGHT y el numero de subplots (nrow, ncol) | |
94 |
|
95 | |||
95 | Input: |
|
96 | Input: | |
96 | idfigure : Los parametros necesarios son |
|
97 | idfigure : Los parametros necesarios son | |
97 | wintitle : |
|
98 | wintitle : | |
98 |
|
99 | |||
99 | """ |
|
100 | """ | |
100 |
|
101 | |||
101 | if widthplot == None: |
|
102 | if widthplot == None: | |
102 | widthplot = self.WIDTH |
|
103 | widthplot = self.WIDTH | |
103 |
|
104 | |||
104 | if heightplot == None: |
|
105 | if heightplot == None: | |
105 | heightplot = self.HEIGHT |
|
106 | heightplot = self.HEIGHT | |
106 |
|
107 | |||
107 | self.idfigure = idfigure |
|
108 | self.idfigure = idfigure | |
108 |
|
109 | |||
109 | self.wintitle = wintitle |
|
110 | self.wintitle = wintitle | |
110 |
|
111 | |||
111 | self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot) |
|
112 | self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot) | |
112 |
|
113 | |||
113 | self.fig = self.__driver.createFigure(self.idfigure, |
|
114 | self.fig = self.__driver.createFigure(self.idfigure, | |
114 | self.wintitle, |
|
115 | self.wintitle, | |
115 | self.widthscreen, |
|
116 | self.widthscreen, | |
116 | self.heightscreen) |
|
117 | self.heightscreen) | |
117 |
|
118 | |||
118 | self.axesObjList = [] |
|
119 | self.axesObjList = [] | |
119 |
|
120 | |||
120 | def setDriver(self, driver=mpldriver): |
|
121 | def setDriver(self, driver=mpldriver): | |
121 |
|
122 | |||
122 | self.__driver = driver |
|
123 | self.__driver = driver | |
123 |
|
124 | |||
124 | def setTitle(self, title): |
|
125 | def setTitle(self, title): | |
125 |
|
126 | |||
126 | self.__driver.setTitle(self.fig, title) |
|
127 | self.__driver.setTitle(self.fig, title) | |
127 |
|
128 | |||
128 | def setWinTitle(self, title): |
|
129 | def setWinTitle(self, title): | |
129 |
|
130 | |||
130 | self.__driver.setWinTitle(self.fig, title=title) |
|
131 | self.__driver.setWinTitle(self.fig, title=title) | |
131 |
|
132 | |||
132 | def setTextFromAxes(self, text): |
|
133 | def setTextFromAxes(self, text): | |
133 |
|
134 | |||
134 | raise ValueError, "Este metodo ha sido reemplazaado con el metodo setText de la clase Axes" |
|
135 | raise ValueError, "Este metodo ha sido reemplazaado con el metodo setText de la clase Axes" | |
135 |
|
136 | |||
136 | def makeAxes(self, nrow, ncol, xpos, ypos, colspan, rowspan): |
|
137 | def makeAxes(self, nrow, ncol, xpos, ypos, colspan, rowspan): | |
137 |
|
138 | |||
138 | raise ValueError, "Este metodo ha sido reemplazaado con el metodo addAxes" |
|
139 | raise ValueError, "Este metodo ha sido reemplazaado con el metodo addAxes" | |
139 |
|
140 | |||
140 | def addAxes(self, *args): |
|
141 | def addAxes(self, *args): | |
141 | """ |
|
142 | """ | |
142 |
|
143 | |||
143 | Input: |
|
144 | Input: | |
144 | *args : Los parametros necesarios son |
|
145 | *args : Los parametros necesarios son | |
145 | nrow, ncol, xpos, ypos, colspan, rowspan |
|
146 | nrow, ncol, xpos, ypos, colspan, rowspan | |
146 | """ |
|
147 | """ | |
147 |
|
148 | |||
148 | axesObj = Axes(self.fig, *args) |
|
149 | axesObj = Axes(self.fig, *args) | |
149 | self.axesObjList.append(axesObj) |
|
150 | self.axesObjList.append(axesObj) | |
150 |
|
151 | |||
151 | def saveFigure(self, figpath, figfile, *args): |
|
152 | def saveFigure(self, figpath, figfile, *args): | |
152 |
|
153 | |||
153 | filename = os.path.join(figpath, figfile) |
|
154 | filename = os.path.join(figpath, figfile) | |
|
155 | ||||
|
156 | fullpath = os.path.split(filename)[0] | |||
|
157 | ||||
|
158 | if not os.path.exists(fullpath): | |||
|
159 | os.mkdir(fullpath) | |||
|
160 | ||||
154 | self.__driver.saveFigure(self.fig, filename, *args) |
|
161 | self.__driver.saveFigure(self.fig, filename, *args) | |
155 |
|
162 | |||
156 | def draw(self): |
|
163 | def draw(self): | |
157 |
|
164 | |||
158 | self.__driver.draw(self.fig) |
|
165 | self.__driver.draw(self.fig) | |
159 |
|
166 | |||
160 | def run(self): |
|
167 | def run(self): | |
161 |
|
168 | |||
162 | raise ValueError, "This method is not implemented" |
|
169 | raise ValueError, "This method is not implemented" | |
163 |
|
170 | |||
164 | axesList = property(getAxesObjList) |
|
171 | axesList = property(getAxesObjList) | |
165 |
|
172 | |||
166 |
|
173 | |||
167 | class Axes: |
|
174 | class Axes: | |
168 |
|
175 | |||
169 | __driver = mpldriver |
|
176 | __driver = mpldriver | |
170 | fig = None |
|
177 | fig = None | |
171 | ax = None |
|
178 | ax = None | |
172 | plot = None |
|
179 | plot = None | |
173 |
|
180 | |||
174 | __firsttime = None |
|
181 | __firsttime = None | |
175 |
|
182 | |||
176 | __showprofile = False |
|
183 | __showprofile = False | |
177 |
|
184 | |||
178 | xmin = None |
|
185 | xmin = None | |
179 | xmax = None |
|
186 | xmax = None | |
180 | ymin = None |
|
187 | ymin = None | |
181 | ymax = None |
|
188 | ymax = None | |
182 | zmin = None |
|
189 | zmin = None | |
183 | zmax = None |
|
190 | zmax = None | |
184 |
|
191 | |||
185 | def __init__(self, *args): |
|
192 | def __init__(self, *args): | |
186 |
|
193 | |||
187 | """ |
|
194 | """ | |
188 |
|
195 | |||
189 | Input: |
|
196 | Input: | |
190 | *args : Los parametros necesarios son |
|
197 | *args : Los parametros necesarios son | |
191 | fig, nrow, ncol, xpos, ypos, colspan, rowspan |
|
198 | fig, nrow, ncol, xpos, ypos, colspan, rowspan | |
192 | """ |
|
199 | """ | |
193 |
|
200 | |||
194 | ax = self.__driver.createAxes(*args) |
|
201 | ax = self.__driver.createAxes(*args) | |
195 | self.fig = args[0] |
|
202 | self.fig = args[0] | |
196 | self.ax = ax |
|
203 | self.ax = ax | |
197 | self.plot = None |
|
204 | self.plot = None | |
198 |
|
205 | |||
199 | self.__firsttime = True |
|
206 | self.__firsttime = True | |
200 | self.idlineList = [] |
|
207 | self.idlineList = [] | |
201 |
|
208 | |||
202 | def setText(self, text): |
|
209 | def setText(self, text): | |
203 |
|
210 | |||
204 | self.__driver.setAxesText(self.ax, text) |
|
211 | self.__driver.setAxesText(self.ax, text) | |
205 |
|
212 | |||
206 | def setXAxisAsTime(self): |
|
213 | def setXAxisAsTime(self): | |
207 | pass |
|
214 | pass | |
208 |
|
215 | |||
209 | def pline(self, x, y, |
|
216 | def pline(self, x, y, | |
210 | xmin=None, xmax=None, |
|
217 | xmin=None, xmax=None, | |
211 | ymin=None, ymax=None, |
|
218 | ymin=None, ymax=None, | |
212 | xlabel='', ylabel='', |
|
219 | xlabel='', ylabel='', | |
213 | title='', |
|
220 | title='', | |
214 | **kwargs): |
|
221 | **kwargs): | |
215 |
|
222 | |||
216 | """ |
|
223 | """ | |
217 |
|
224 | |||
218 | Input: |
|
225 | Input: | |
219 | x : |
|
226 | x : | |
220 | y : |
|
227 | y : | |
221 | xmin : |
|
228 | xmin : | |
222 | xmax : |
|
229 | xmax : | |
223 | ymin : |
|
230 | ymin : | |
224 | ymax : |
|
231 | ymax : | |
225 | xlabel : |
|
232 | xlabel : | |
226 | ylabel : |
|
233 | ylabel : | |
227 | title : |
|
234 | title : | |
228 | **kwargs : Los parametros aceptados son |
|
235 | **kwargs : Los parametros aceptados son | |
229 |
|
236 | |||
230 | ticksize |
|
237 | ticksize | |
231 | ytick_visible |
|
238 | ytick_visible | |
232 | """ |
|
239 | """ | |
233 |
|
240 | |||
234 | if self.__firsttime: |
|
241 | if self.__firsttime: | |
235 |
|
242 | |||
236 | if xmin == None: xmin = numpy.nanmin(x) |
|
243 | if xmin == None: xmin = numpy.nanmin(x) | |
237 | if xmax == None: xmax = numpy.nanmax(x) |
|
244 | if xmax == None: xmax = numpy.nanmax(x) | |
238 | if ymin == None: ymin = numpy.nanmin(y) |
|
245 | if ymin == None: ymin = numpy.nanmin(y) | |
239 | if ymax == None: ymax = numpy.nanmax(y) |
|
246 | if ymax == None: ymax = numpy.nanmax(y) | |
240 |
|
247 | |||
241 | self.plot = self.__driver.createPline(self.ax, x, y, |
|
248 | self.plot = self.__driver.createPline(self.ax, x, y, | |
242 | xmin, xmax, |
|
249 | xmin, xmax, | |
243 | ymin, ymax, |
|
250 | ymin, ymax, | |
244 | xlabel=xlabel, |
|
251 | xlabel=xlabel, | |
245 | ylabel=ylabel, |
|
252 | ylabel=ylabel, | |
246 | title=title, |
|
253 | title=title, | |
247 | **kwargs) |
|
254 | **kwargs) | |
248 |
|
255 | |||
249 | self.idlineList.append(0) |
|
256 | self.idlineList.append(0) | |
250 | self.__firsttime = False |
|
257 | self.__firsttime = False | |
251 | return |
|
258 | return | |
252 |
|
259 | |||
253 | self.__driver.pline(self.plot, x, y, xlabel=xlabel, |
|
260 | self.__driver.pline(self.plot, x, y, xlabel=xlabel, | |
254 | ylabel=ylabel, |
|
261 | ylabel=ylabel, | |
255 | title=title) |
|
262 | title=title) | |
256 |
|
263 | |||
257 | def addpline(self, x, y, idline, **kwargs): |
|
264 | def addpline(self, x, y, idline, **kwargs): | |
258 | lines = self.ax.lines |
|
265 | lines = self.ax.lines | |
259 |
|
266 | |||
260 | if idline in self.idlineList: |
|
267 | if idline in self.idlineList: | |
261 | self.__driver.set_linedata(self.ax, x, y, idline) |
|
268 | self.__driver.set_linedata(self.ax, x, y, idline) | |
262 |
|
269 | |||
263 | if idline not in(self.idlineList): |
|
270 | if idline not in(self.idlineList): | |
264 | self.__driver.addpline(self.ax, x, y, **kwargs) |
|
271 | self.__driver.addpline(self.ax, x, y, **kwargs) | |
265 | self.idlineList.append(idline) |
|
272 | self.idlineList.append(idline) | |
266 |
|
273 | |||
267 | return |
|
274 | return | |
268 |
|
275 | |||
269 | def pmultiline(self, x, y, |
|
276 | def pmultiline(self, x, y, | |
270 | xmin=None, xmax=None, |
|
277 | xmin=None, xmax=None, | |
271 | ymin=None, ymax=None, |
|
278 | ymin=None, ymax=None, | |
272 | xlabel='', ylabel='', |
|
279 | xlabel='', ylabel='', | |
273 | title='', |
|
280 | title='', | |
274 | **kwargs): |
|
281 | **kwargs): | |
275 |
|
282 | |||
276 | if self.__firsttime: |
|
283 | if self.__firsttime: | |
277 |
|
284 | |||
278 | if xmin == None: xmin = numpy.nanmin(x) |
|
285 | if xmin == None: xmin = numpy.nanmin(x) | |
279 | if xmax == None: xmax = numpy.nanmax(x) |
|
286 | if xmax == None: xmax = numpy.nanmax(x) | |
280 | if ymin == None: ymin = numpy.nanmin(y) |
|
287 | if ymin == None: ymin = numpy.nanmin(y) | |
281 | if ymax == None: ymax = numpy.nanmax(y) |
|
288 | if ymax == None: ymax = numpy.nanmax(y) | |
282 |
|
289 | |||
283 | self.plot = self.__driver.createPmultiline(self.ax, x, y, |
|
290 | self.plot = self.__driver.createPmultiline(self.ax, x, y, | |
284 | xmin, xmax, |
|
291 | xmin, xmax, | |
285 | ymin, ymax, |
|
292 | ymin, ymax, | |
286 | xlabel=xlabel, |
|
293 | xlabel=xlabel, | |
287 | ylabel=ylabel, |
|
294 | ylabel=ylabel, | |
288 | title=title, |
|
295 | title=title, | |
289 | **kwargs) |
|
296 | **kwargs) | |
290 | self.__firsttime = False |
|
297 | self.__firsttime = False | |
291 | return |
|
298 | return | |
292 |
|
299 | |||
293 | self.__driver.pmultiline(self.plot, x, y, xlabel=xlabel, |
|
300 | self.__driver.pmultiline(self.plot, x, y, xlabel=xlabel, | |
294 | ylabel=ylabel, |
|
301 | ylabel=ylabel, | |
295 | title=title) |
|
302 | title=title) | |
296 |
|
303 | |||
297 | def pmultilineyaxis(self, x, y, |
|
304 | def pmultilineyaxis(self, x, y, | |
298 | xmin=None, xmax=None, |
|
305 | xmin=None, xmax=None, | |
299 | ymin=None, ymax=None, |
|
306 | ymin=None, ymax=None, | |
300 | xlabel='', ylabel='', |
|
307 | xlabel='', ylabel='', | |
301 | title='', |
|
308 | title='', | |
302 | **kwargs): |
|
309 | **kwargs): | |
303 |
|
310 | |||
304 | if self.__firsttime: |
|
311 | if self.__firsttime: | |
305 |
|
312 | |||
306 | if xmin == None: xmin = numpy.nanmin(x) |
|
313 | if xmin == None: xmin = numpy.nanmin(x) | |
307 | if xmax == None: xmax = numpy.nanmax(x) |
|
314 | if xmax == None: xmax = numpy.nanmax(x) | |
308 | if ymin == None: ymin = numpy.nanmin(y) |
|
315 | if ymin == None: ymin = numpy.nanmin(y) | |
309 | if ymax == None: ymax = numpy.nanmax(y) |
|
316 | if ymax == None: ymax = numpy.nanmax(y) | |
310 |
|
317 | |||
311 | self.plot = self.__driver.createPmultilineYAxis(self.ax, x, y, |
|
318 | self.plot = self.__driver.createPmultilineYAxis(self.ax, x, y, | |
312 | xmin, xmax, |
|
319 | xmin, xmax, | |
313 | ymin, ymax, |
|
320 | ymin, ymax, | |
314 | xlabel=xlabel, |
|
321 | xlabel=xlabel, | |
315 | ylabel=ylabel, |
|
322 | ylabel=ylabel, | |
316 | title=title, |
|
323 | title=title, | |
317 | **kwargs) |
|
324 | **kwargs) | |
318 | if self.xmin == None: self.xmin = xmin |
|
325 | if self.xmin == None: self.xmin = xmin | |
319 | if self.xmax == None: self.xmax = xmax |
|
326 | if self.xmax == None: self.xmax = xmax | |
320 | if self.ymin == None: self.ymin = ymin |
|
327 | if self.ymin == None: self.ymin = ymin | |
321 | if self.ymax == None: self.ymax = ymax |
|
328 | if self.ymax == None: self.ymax = ymax | |
322 |
|
329 | |||
323 | self.__firsttime = False |
|
330 | self.__firsttime = False | |
324 | return |
|
331 | return | |
325 |
|
332 | |||
326 | self.__driver.pmultilineyaxis(self.plot, x, y, xlabel=xlabel, |
|
333 | self.__driver.pmultilineyaxis(self.plot, x, y, xlabel=xlabel, | |
327 | ylabel=ylabel, |
|
334 | ylabel=ylabel, | |
328 | title=title) |
|
335 | title=title) | |
329 |
|
336 | |||
330 | def pcolor(self, x, y, z, |
|
337 | def pcolor(self, x, y, z, | |
331 | xmin=None, xmax=None, |
|
338 | xmin=None, xmax=None, | |
332 | ymin=None, ymax=None, |
|
339 | ymin=None, ymax=None, | |
333 | zmin=None, zmax=None, |
|
340 | zmin=None, zmax=None, | |
334 | xlabel='', ylabel='', |
|
341 | xlabel='', ylabel='', | |
335 | title='', rti = False, colormap='jet', |
|
342 | title='', rti = False, colormap='jet', | |
336 | **kwargs): |
|
343 | **kwargs): | |
337 |
|
344 | |||
338 | """ |
|
345 | """ | |
339 | Input: |
|
346 | Input: | |
340 | x : |
|
347 | x : | |
341 | y : |
|
348 | y : | |
342 | x : |
|
349 | x : | |
343 | xmin : |
|
350 | xmin : | |
344 | xmax : |
|
351 | xmax : | |
345 | ymin : |
|
352 | ymin : | |
346 | ymax : |
|
353 | ymax : | |
347 | zmin : |
|
354 | zmin : | |
348 | zmax : |
|
355 | zmax : | |
349 | xlabel : |
|
356 | xlabel : | |
350 | ylabel : |
|
357 | ylabel : | |
351 | title : |
|
358 | title : | |
352 | **kwargs : Los parametros aceptados son |
|
359 | **kwargs : Los parametros aceptados son | |
353 | ticksize=9, |
|
360 | ticksize=9, | |
354 | cblabel='' |
|
361 | cblabel='' | |
355 | rti = True or False |
|
362 | rti = True or False | |
356 | """ |
|
363 | """ | |
357 |
|
364 | |||
358 | if self.__firsttime: |
|
365 | if self.__firsttime: | |
359 |
|
366 | |||
360 | if xmin == None: xmin = numpy.nanmin(x) |
|
367 | if xmin == None: xmin = numpy.nanmin(x) | |
361 | if xmax == None: xmax = numpy.nanmax(x) |
|
368 | if xmax == None: xmax = numpy.nanmax(x) | |
362 | if ymin == None: ymin = numpy.nanmin(y) |
|
369 | if ymin == None: ymin = numpy.nanmin(y) | |
363 | if ymax == None: ymax = numpy.nanmax(y) |
|
370 | if ymax == None: ymax = numpy.nanmax(y) | |
364 | if zmin == None: zmin = numpy.nanmin(z) |
|
371 | if zmin == None: zmin = numpy.nanmin(z) | |
365 | if zmax == None: zmax = numpy.nanmax(z) |
|
372 | if zmax == None: zmax = numpy.nanmax(z) | |
366 |
|
373 | |||
367 |
|
374 | |||
368 | self.plot = self.__driver.createPcolor(self.ax, x, y, z, |
|
375 | self.plot = self.__driver.createPcolor(self.ax, x, y, z, | |
369 | xmin, xmax, |
|
376 | xmin, xmax, | |
370 | ymin, ymax, |
|
377 | ymin, ymax, | |
371 | zmin, zmax, |
|
378 | zmin, zmax, | |
372 | xlabel=xlabel, |
|
379 | xlabel=xlabel, | |
373 | ylabel=ylabel, |
|
380 | ylabel=ylabel, | |
374 | title=title, |
|
381 | title=title, | |
375 | colormap=colormap, |
|
382 | colormap=colormap, | |
376 | **kwargs) |
|
383 | **kwargs) | |
377 |
|
384 | |||
378 | if self.xmin == None: self.xmin = xmin |
|
385 | if self.xmin == None: self.xmin = xmin | |
379 | if self.xmax == None: self.xmax = xmax |
|
386 | if self.xmax == None: self.xmax = xmax | |
380 | if self.ymin == None: self.ymin = ymin |
|
387 | if self.ymin == None: self.ymin = ymin | |
381 | if self.ymax == None: self.ymax = ymax |
|
388 | if self.ymax == None: self.ymax = ymax | |
382 | if self.zmin == None: self.zmin = zmin |
|
389 | if self.zmin == None: self.zmin = zmin | |
383 | if self.zmax == None: self.zmax = zmax |
|
390 | if self.zmax == None: self.zmax = zmax | |
384 |
|
391 | |||
385 | self.__firsttime = False |
|
392 | self.__firsttime = False | |
386 | return |
|
393 | return | |
387 |
|
394 | |||
388 | if rti: |
|
395 | if rti: | |
389 | self.__driver.addpcolor(self.ax, x, y, z, self.zmin, self.zmax, |
|
396 | self.__driver.addpcolor(self.ax, x, y, z, self.zmin, self.zmax, | |
390 | xlabel=xlabel, |
|
397 | xlabel=xlabel, | |
391 | ylabel=ylabel, |
|
398 | ylabel=ylabel, | |
392 | title=title, |
|
399 | title=title, | |
393 | colormap=colormap) |
|
400 | colormap=colormap) | |
394 | return |
|
401 | return | |
395 |
|
402 | |||
396 | self.__driver.pcolor(self.plot, z, |
|
403 | self.__driver.pcolor(self.plot, z, | |
397 | xlabel=xlabel, |
|
404 | xlabel=xlabel, | |
398 | ylabel=ylabel, |
|
405 | ylabel=ylabel, | |
399 | title=title) |
|
406 | title=title) | |
400 |
|
407 | |||
401 | No newline at end of file |
|
408 |
General Comments 0
You need to be logged in to leave comments.
Login now