524 #hourlocator = mpl.dates.HourLocator() |
524 #hourlocator = mpl.dates.HourLocator() |
525 |
525 |
526 #dayFormatter = mpl.dates.DateFormatter('\n\n%d/%m') |
526 #dayFormatter = mpl.dates.DateFormatter('\n\n%d/%m') |
527 #daylocator = mpl.dates.DayLocator() |
527 #daylocator = mpl.dates.DayLocator() |
528 hourFormatter = mpl.dates.DateFormatter('%H:%M') |
528 hourFormatter = mpl.dates.DateFormatter('%H:%M') |
529 hourlocator = mpl.dates.AutoDateLocator(interval_multiples=True) |
529 hourlocator = mpl.dates.AutoDateLocator(minticks = 3, maxticks = 8, interval_multiples=True) |
530 |
530 |
531 |
531 |
532 #ax1.axes.xaxis.set_major_formatter(dayFormatter) |
532 #ax1.axes.xaxis.set_major_formatter(dayFormatter) |
533 #ax1.axes.xaxis.set_major_locator(daylocator) |
533 #ax1.axes.xaxis.set_major_locator(daylocator) |
534 ax1.axes.xaxis.set_major_formatter(hourFormatter) |
534 ax1.axes.xaxis.set_major_formatter(hourFormatter) |
550 extent = [ts1,ts2,self.z[zoom[0]]/1000.0 + z0/1000., self.z[hmax_idx]/1000.0 + z0/1000.], |
550 extent = [ts1,ts2,self.z[zoom[0]]/1000.0 + z0/1000., self.z[hmax_idx]/1000.0 + z0/1000.], |
551 ) |
551 ) |
552 |
552 |
553 cb1 = plt.colorbar(im1) |
553 cb1 = plt.colorbar(im1) |
554 cb1.ax.set_ylabel(cmap_label) |
554 cb1.ax.set_ylabel(cmap_label) |
|
555 |
|
556 # Make the ticks of the colorbar smaller, two points smaller than the default font size |
|
557 cb_font_size = mpl.rcParams['font.size'] - 2 |
|
558 for ticklabels in cb1.ax.get_yticklabels(): |
|
559 ticklabels.set_fontsize(cb_font_size) |
|
560 cb1.ax.yaxis.get_offset_text().set_fontsize(cb_font_size) |
555 |
561 |
556 def index_at_height(self, height): |
562 def index_at_height(self, height): |
557 idx = np.array(np.abs(self.z - height).argmin()) |
563 idx = np.array(np.abs(self.z - height).argmin()) |
558 if idx.size >1: |
564 if idx.size >1: |
559 idx =idx[0] |
565 idx =idx[0] |