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