Skip to content

Commit

Permalink
Merge pull request #178 from pycroscopy/raj_dev
Browse files Browse the repository at this point in the history
Edits for matplotlib mpl deprecation (legacy_colorbar)
  • Loading branch information
ramav87 authored Jun 30, 2023
2 parents cbb9434 + 1d0061d commit 687a5b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sidpy/viz/plot_utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]')
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 687a5b2

Please sign in to comment.