From 937c8722a1eeaa86a85deee90c43bf61be68a343 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 23 Aug 2021 16:26:56 -0500 Subject: [PATCH] snapshot... --- modules/util/plot.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/util/plot.py b/modules/util/plot.py index 373ed990..571a4d5d 100644 --- a/modules/util/plot.py +++ b/modules/util/plot.py @@ -10,6 +10,7 @@ from sklearn.metrics import roc_auc_score, roc_curve import tensorflow as tf import matplotlib import matplotlib.pyplot as plt +import matplotlib.dates as mdates import cartopy.crs as ccrs import xarray as xr import os @@ -241,4 +242,17 @@ def make_icing_image(clvrx_file, ice_lons, ice_lats, ice_lons_vld=None, ice_lats ax.scatter(ice_lons_vld, ice_lats_vld, s=20.0, marker='o', color='blue', transform=ccrs.PlateCarree()) plt.title('GOES-16, 2019-04-30_18:26Z >60% Probability Icing', loc='left', fontweight='bold', fontsize=15) ImageDirAndName = os.path.join('/Users/tomrink', filename) - fig.savefig(ImageDirAndName) \ No newline at end of file + fig.savefig(ImageDirAndName) + + +# values, edges in Epoch time +def make_time_domain_hist(values, edges): + # convert the epoch format to matplotlib date format + #mpl_data = mdates.epoch2num(values) + + fig, ax = plt.subplots(1, 1) + ax.hist(values, bins=edges, ec='black') + #ax.xaxis.set_major_locator(mdates.MonthLocator()) + #ax.xaxis.set_major_formatter(mdates.DateFormatter('%y-%m-%d_%h')) + #fig.autofmt_xdate() + plt.show() -- GitLab