From 1d0061d8e39735d294a486779c0b2d9e40b3a80b Mon Sep 17 00:00:00 2001 From: Raj Date: Tue, 27 Jun 2023 18:05:21 -0700 Subject: [PATCH] Edits for matplotlib mpl deprecation (legacy_colorbar) --- sidpy/viz/plot_utils/image.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sidpy/viz/plot_utils/image.py b/sidpy/viz/plot_utils/image.py index 40efd4a5..fe855d76 100644 --- a/sidpy/viz/plot_utils/image.py +++ b/sidpy/viz/plot_utils/image.py @@ -275,7 +275,7 @@ def plot_map_stack(map_stack, num_comps=9, stdevs=2, color_bar_mode=None, evenly --------- fig, axes """ - plt.rcParams["mpl_toolkits.legacy_colorbar"] = False +# plt.rcParams["mpl_toolkits.legacy_colorbar"] = False if not isinstance(map_stack, (np.ndarray, da.core.Array)) or not map_stack.ndim == 3: raise TypeError('map_stack should be a 3 dimensional array arranged as [component, row, col]') @@ -385,14 +385,17 @@ def plot_map_stack(map_stack, num_comps=9, stdevs=2, color_bar_mode=None, evenly axes_pad=(pad_w * fig_w, pad_h * fig_h), **igkwargs) - fig.canvas.set_window_title(title) + try: + fig.canvas.set_window_title(title) + except: + fig.canvas.manager.set_window_title(title) # These parameters have not been easy to fix: if title_yoffset is None: title_yoffset = 0.9 if title_size is None: title_size = 16 + (p_rows + p_cols) fig.suptitle(title, fontsize=title_size, y=title_yoffset) - plt.rcParams["mpl_toolkits.legacy_colorbar"] = False +# plt.rcParams["mpl_toolkits.legacy_colorbar"] = False for count, index, curr_subtitle in zip(range(chosen_pos.size), chosen_pos, subtitle): im, im_cbar = plot_map(axes[count],