diff --git a/schainpy/model/graphics/mpldriver.py b/schainpy/model/graphics/mpldriver.py index d6cbfd1..249dd12 100644 --- a/schainpy/model/graphics/mpldriver.py +++ b/schainpy/model/graphics/mpldriver.py @@ -18,6 +18,8 @@ from matplotlib.ticker import FuncFormatter, LinearLocator #Actualizacion de las funciones del driver ########################################### +# create jro colormap + jet_values = matplotlib.pyplot.get_cmap("jet", 100)(numpy.arange(100))[10:90] blu_values = matplotlib.pyplot.get_cmap("seismic_r", 20)(numpy.arange(20))[10:15] ncmap = matplotlib.colors.LinearSegmentedColormap.from_list("jro", numpy.vstack((blu_values, jet_values))) @@ -31,7 +33,6 @@ def createFigure(id, wintitle, width, height, facecolor="w", show=True, dpi = 80 fig.canvas.manager.set_window_title(wintitle) # fig.canvas.manager.resize(width, height) matplotlib.pyplot.ion() - if show: matplotlib.pyplot.show() @@ -87,7 +88,6 @@ def createAxes(fig, nrow, ncol, xpos, ypos, colspan, rowspan, polar=False): rowspan=rowspan, polar=polar) - axes.grid(True) matplotlib.pyplot.ion() return axes @@ -204,7 +204,7 @@ def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, z = numpy.ma.masked_invalid(z) cmap=matplotlib.pyplot.get_cmap(colormap) - cmap.set_bad('white',1.) + cmap.set_bad('white', 1.) imesh = ax.pcolormesh(x,y,z.T, vmin=zmin, vmax=zmax, cmap=cmap) cb = matplotlib.pyplot.colorbar(imesh, cax=ax_cb) cb.set_label(cblabel) @@ -238,7 +238,7 @@ def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, func = lambda x, pos: ('%s') %(datetime.datetime.utcfromtimestamp(x).strftime("%H:%M:%S")) ax.xaxis.set_major_formatter(FuncFormatter(func)) ax.xaxis.set_major_locator(LinearLocator(7)) - ax.grid(True) + matplotlib.pyplot.ion() return imesh @@ -248,13 +248,12 @@ def pcolor(imesh, z, xlabel='', ylabel='', title=''): ax = imesh.get_axes() printLabels(ax, xlabel, ylabel, title) imesh.set_array(z.ravel()) - ax.grid(True) def addpcolor(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'): printLabels(ax, xlabel, ylabel, title) + ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=matplotlib.pyplot.get_cmap(colormap)) - ax.grid(True) def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'): @@ -265,10 +264,10 @@ def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', col z = numpy.ma.masked_invalid(z) cmap=matplotlib.pyplot.get_cmap(colormap) - cmap.set_bad('white',1.) + cmap.set_bad('white', 1.) + ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=cmap) - ax.grid(True) def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, ticksize=9, xtick_visible=True, ytick_visible=True, @@ -426,7 +425,7 @@ def createPolar(ax, x, y, # ax.text(0, -110, ylabel, rotation='vertical', va ='center', ha = 'center' ,size='11') # ax.text(0, 50, ylabel, rotation='vertical', va ='center', ha = 'left' ,size='11') # ax.text(100, 100, 'example', ha='left', va='center', rotation='vertical') - ax.yaxis.labelpad = 230 + ax.yaxis.labelpad = 250 printLabels(ax, xlabel, ylabel, title) iplot = ax.lines[-1]