Skip to content

Commit

Permalink
Merge pull request #126 from sroet/fix_mpl_36
Browse files Browse the repository at this point in the history
fix matplotlib 3.6 'Unable to determine Axes to steal space for Colorbar
  • Loading branch information
dwhswenson committed Sep 16, 2022
2 parents b6d2461 + 3793f16 commit 3ae38ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contact_map/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'afmhot', 'gist_heat', 'copper'
]


def is_cmap_diverging(cmap):
if cmap in _DIVERGING:
return True
Expand All @@ -31,6 +32,7 @@ def is_cmap_diverging(cmap):
warnings.warn("Unknown colormap: Treating as sequential.")
return False


def ranged_colorbar(cmap, norm, cbmin, cbmax, ax=None):
"""Create a colorbar with given endpoints.
Expand Down Expand Up @@ -60,6 +62,7 @@ def ranged_colorbar(cmap, norm, cbmin, cbmax, ax=None):

if ax is None:
fig = plt
ax = plt.gca()
else:
fig = ax.figure

Expand Down

0 comments on commit 3ae38ea

Please sign in to comment.