Skip to content

Commit

Permalink
fix matplotlib 3.6 'Unable to determine Axes to steal space for Color…
Browse files Browse the repository at this point in the history
…bar.'
  • Loading branch information
sroet committed Sep 16, 2022
1 parent b6d2461 commit 3793f16
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 3793f16

Please sign in to comment.