Skip to content

Commit

Permalink
Fix date tick label formats for newer matplotlib versions
Browse files Browse the repository at this point in the history
Refs: #84
  • Loading branch information
malloryprow committed Oct 29, 2021
1 parent a0a33f7 commit 35d1f4b
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_date_by_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
nticks = 2
title_loc = 'center'
cmap_bias_original = plt.cm.PiYG_r
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_lead_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
plt.rcParams['legend.borderaxespad'] = 0
plt.rcParams['legend.columnspacing'] = 1.0
plt.rcParams['legend.frameon'] = False
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
x_figsize, y_figsize = 14, 14
legend_bbox_x, legend_bbox_y = 0.5, 0.05
legend_fontsize = 15
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_lead_by_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
nticks = 4
title_loc = 'center'
cmap_bias_original = plt.cm.PiYG_r
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_lead_by_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_bias_original = plt.cm.PiYG_r
colors_bias = cmap_bias_original(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_maps2d_lat_lon_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_diff_original = plt.cm.bwr
colors_diff = cmap_diff_original(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_diff_original = plt.cm.bwr
colors_diff = cmap_diff_original(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_maps2d_zonal_mean_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_diff_original = plt.cm.bwr
colors_diff = cmap_diff_original(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_mapsda_lat_lon_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_diff_original = plt.cm.bwr
colors_diff = cmap_diff_original(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_mapsda_zonal_mean_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_diff = plt.cm.bwr
noaa_logo_img_array = matplotlib.image.imread(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_stat_by_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
plt.rcParams['legend.borderaxespad'] = 0
plt.rcParams['legend.columnspacing'] = 1.0
plt.rcParams['legend.frameon'] = False
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
x_figsize, y_figsize = 14, 14
legend_bbox_x, legend_bbox_y = 0, 1
legend_fontsize = 17
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_threshold_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
plt.rcParams['legend.borderaxespad'] = 0
plt.rcParams['legend.columnspacing'] = 1.0
plt.rcParams['legend.frameon'] = False
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
x_figsize, y_figsize = 14, 14
legend_bbox_x, legend_bbox_y = 0.5, 0.05
legend_fontsize = 15
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_threshold_by_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
plt.rcParams['figure.subplot.right'] = 0.95
plt.rcParams['figure.titleweight'] = 'bold'
plt.rcParams['figure.titlesize'] = 16
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
title_loc = 'center'
cmap_bias_original = plt.cm.PiYG_r
colors_bias = cmap_bias_original(
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
plt.rcParams['legend.borderaxespad'] = 0
plt.rcParams['legend.columnspacing'] = 1.0
plt.rcParams['legend.frameon'] = False
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
x_figsize, y_figsize = 14, 7
nticks = 4
legend_bbox_x, legend_bbox_y = 0.5, 0.05
Expand Down
2 changes: 2 additions & 0 deletions ush/plotting_scripts/plot_tropcyc_lead_average.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
plt.rcParams['legend.borderaxespad'] = 0
plt.rcParams['legend.columnspacing'] = 1.0
plt.rcParams['legend.frameon'] = False
if float(matplotlib.__version__[0:3]) >= 3.3:
plt.rcParams['date.epoch'] = '0000-12-31T00:00:00'
x_figsize, y_figsize = 14, 7
legend_bbox_x, legend_bbox_y = 0, 1
legend_fontsize = 13
Expand Down

0 comments on commit 35d1f4b

Please sign in to comment.