From 9bfed733ec9fb0416ce4b76acd5741966c3628dd Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Tue, 11 Jul 2023 21:22:11 -0500 Subject: [PATCH] snapshot... --- modules/util/plot.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/util/plot.py b/modules/util/plot.py index 319980a7..2d639102 100644 --- a/modules/util/plot.py +++ b/modules/util/plot.py @@ -1,10 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -""" -Created on Wed May 22 13:58:09 2019 -@author: Wimmers -""" from sklearn.metrics import roc_auc_score, roc_curve import tensorflow as tf @@ -18,6 +14,7 @@ import h5py from util.util import get_grid_values_all, get_cartopy_crs, homedir from util.setup import home_dir +import mpl_scatter_density logdir = home_dir+'/tf_logs' root_imgdir = home_dir @@ -289,7 +286,19 @@ def make_time_domain_hist(values, edges): 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() + # ax.xaxis.set_major_locator(mdates.MonthLocator()) + # ax.xaxis.set_major_formatter(mdates.DateFormatter('%y-%m-%d_%h')) + # fig.autofmt_xdate() plt.show() + + +def scatter_density(x, y, color, fname=None, fig=None): + if fig is None: + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1, projection='scatter_density') + ax.scatter_density(x, y, color=color) + + if fname is not None: + fig.savefig(fname) + + return fig \ No newline at end of file -- GitLab