From 11fb8c6a111292a23165d211f074c76e13413ba9 Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Sun, 30 May 2021 14:45:16 +0200 Subject: [PATCH] Remove typo in querying attributes in postprocess_plotting.py. --- .../postprocess/postprocess_plotting.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/video_prediction_tools/postprocess/postprocess_plotting.py b/video_prediction_tools/postprocess/postprocess_plotting.py index 84b880f7..cde8f97e 100644 --- a/video_prediction_tools/postprocess/postprocess_plotting.py +++ b/video_prediction_tools/postprocess/postprocess_plotting.py @@ -42,9 +42,11 @@ def plot_cond_quantile(quantile_panel: xr.DataArray, data_marginal: xr.DataArray if opt is None: opt = {} + print("%{0}: Start creating conditional quantile plot in file '{1}'".format(method, plt_fname)) + bins_c = quantile_panel["bin_center"] bin_width = bins_c[1] - bins_c[0] - bins = np.arange(bins_c[0]-bin_width/2., bins_c+1.5*bin_width/2, bin_width) + bins = np.arange(bins_c[0]-bin_width/2., bins_c[-1]+1.5*bin_width/2, bin_width) quantiles = quantile_panel["quantile"] nquantiles = len(quantiles) if nquantiles%2 != 1: @@ -71,10 +73,10 @@ def plot_cond_quantile(quantile_panel: xr.DataArray, data_marginal: xr.DataArray xr.plot.hist(data_marginal, ax=ax2, bins=bins, color="k", alpha=0.3) ax2.set_yscale("log") - ylabel = "{0} [{1}]".format(provide_default(quantile_panel.attr, "data_cond_longname", "conditiong variable"), - provide_default(quantile_panel.attr, "data_cond_unit", "unknown")) - xlabel = "{0} [{1}]".format(provide_default(quantile_panel.attr, "data_cond_longname", "target variable"), - provide_default(quantile_panel.attr, "data_cond_unit", "unknown")) + ylabel = "{0} [{1}]".format(provide_default(quantile_panel.attrs, "data_cond_longname", "conditiong variable"), + provide_default(quantile_panel.attrs, "data_cond_unit", "unknown")) + xlabel = "{0} [{1}]".format(provide_default(quantile_panel.attrs, "data_cond_longname", "target variable"), + provide_default(quantile_panel.attrs, "data_cond_unit", "unknown")) ax.set_ylabel(ylabel, fontsize=fs_title) ax2.set_ylabel("counts", fontsize=fs_title) @@ -245,4 +247,4 @@ def get_ls_mirrored(n, ls_base=("--", ":")): lss = lss + ["-"] + lss[::-1] - return lss \ No newline at end of file + return lss -- GitLab