##// END OF EJS Templates
change ylabel pad in polar plot
Juan C. Valdez -
r873:77efa7e0b236
parent child
Show More
@@ -18,6 +18,8 from matplotlib.ticker import FuncFormatter, LinearLocator
18 18 #Actualizacion de las funciones del driver
19 19 ###########################################
20 20
21 # create jro colormap
22
21 23 jet_values = matplotlib.pyplot.get_cmap("jet", 100)(numpy.arange(100))[10:90]
22 24 blu_values = matplotlib.pyplot.get_cmap("seismic_r", 20)(numpy.arange(20))[10:15]
23 25 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
31 33 fig.canvas.manager.set_window_title(wintitle)
32 34 # fig.canvas.manager.resize(width, height)
33 35 matplotlib.pyplot.ion()
34
35 36
36 37 if show:
37 38 matplotlib.pyplot.show()
@@ -87,7 +88,6 def createAxes(fig, nrow, ncol, xpos, ypos, colspan, rowspan, polar=False):
87 88 rowspan=rowspan,
88 89 polar=polar)
89 90
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 ax.grid(True)
241
242 242 matplotlib.pyplot.ion()
243 243 return imesh
244 244
@@ -248,13 +248,12 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)
252 251
253 252 def addpcolor(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'):
254 253
255 254 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)
258 257
259 258 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'):
260 259
@@ -265,10 +264,10 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', col
265 264 z = numpy.ma.masked_invalid(z)
266 265
267 266 cmap=matplotlib.pyplot.get_cmap(colormap)
268 cmap.set_bad('white',1.)
267 cmap.set_bad('white', 1.)
269 268
269
270 270 ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=cmap)
271 ax.grid(True)
272 271
273 272 def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None,
274 273 ticksize=9, xtick_visible=True, ytick_visible=True,
@@ -426,7 +425,7 def createPolar(ax, x, y,
426 425 # ax.text(0, -110, ylabel, rotation='vertical', va ='center', ha = 'center' ,size='11')
427 426 # ax.text(0, 50, ylabel, rotation='vertical', va ='center', ha = 'left' ,size='11')
428 427 # ax.text(100, 100, 'example', ha='left', va='center', rotation='vertical')
429 ax.yaxis.labelpad = 230
428 ax.yaxis.labelpad = 250
430 429 printLabels(ax, xlabel, ylabel, title)
431 430 iplot = ax.lines[-1]
432 431
General Comments 0
You need to be logged in to leave comments. Login now