##// END OF EJS Templates
dsd
Erick Valdez -
r871:27779f749441
parent child
Show More
@@ -18,8 +18,6 from matplotlib.ticker import FuncFormatter, LinearLocator
18 18 #Actualizacion de las funciones del driver
19 19 ###########################################
20 20
21 # create jro colormap
22
23 21 jet_values = matplotlib.pyplot.get_cmap("jet", 100)(numpy.arange(100))[10:90]
24 22 blu_values = matplotlib.pyplot.get_cmap("seismic_r", 20)(numpy.arange(20))[10:15]
25 23 ncmap = matplotlib.colors.LinearSegmentedColormap.from_list("jro", numpy.vstack((blu_values, jet_values)))
@@ -33,6 +31,7 def createFigure(id, wintitle, width, height, facecolor="w", show=True, dpi = 80
33 31 fig.canvas.manager.set_window_title(wintitle)
34 32 # fig.canvas.manager.resize(width, height)
35 33 matplotlib.pyplot.ion()
34
36 35
37 36 if show:
38 37 matplotlib.pyplot.show()
@@ -88,6 +87,7 def createAxes(fig, nrow, ncol, xpos, ypos, colspan, rowspan, polar=False):
88 87 rowspan=rowspan,
89 88 polar=polar)
90 89
90 axes.grid(True)
91 91 matplotlib.pyplot.ion()
92 92 return axes
93 93
@@ -204,7 +204,7 def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax,
204 204
205 205 z = numpy.ma.masked_invalid(z)
206 206 cmap=matplotlib.pyplot.get_cmap(colormap)
207 cmap.set_bad('white', 1.)
207 cmap.set_bad('white',1.)
208 208 imesh = ax.pcolormesh(x,y,z.T, vmin=zmin, vmax=zmax, cmap=cmap)
209 209 cb = matplotlib.pyplot.colorbar(imesh, cax=ax_cb)
210 210 cb.set_label(cblabel)
@@ -238,7 +238,7 def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax,
238 238 func = lambda x, pos: ('%s') %(datetime.datetime.utcfromtimestamp(x).strftime("%H:%M:%S"))
239 239 ax.xaxis.set_major_formatter(FuncFormatter(func))
240 240 ax.xaxis.set_major_locator(LinearLocator(7))
241
241 ax.grid(True)
242 242 matplotlib.pyplot.ion()
243 243 return imesh
244 244
@@ -248,12 +248,13 def pcolor(imesh, z, xlabel='', ylabel='', title=''):
248 248 ax = imesh.get_axes()
249 249 printLabels(ax, xlabel, ylabel, title)
250 250 imesh.set_array(z.ravel())
251 ax.grid(True)
251 252
252 253 def addpcolor(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'):
253 254
254 255 printLabels(ax, xlabel, ylabel, title)
255
256 256 ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=matplotlib.pyplot.get_cmap(colormap))
257 ax.grid(True)
257 258
258 259 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'):
259 260
@@ -264,10 +265,10 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', col
264 265 z = numpy.ma.masked_invalid(z)
265 266
266 267 cmap=matplotlib.pyplot.get_cmap(colormap)
267 cmap.set_bad('white', 1.)
268 cmap.set_bad('white',1.)
268 269
269
270 270 ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=cmap)
271 ax.grid(True)
271 272
272 273 def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None,
273 274 ticksize=9, xtick_visible=True, ytick_visible=True,
General Comments 0
You need to be logged in to leave comments. Login now