Skip to content

Commit

Permalink
fixes to mappable examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gillenbrown committed Mar 6, 2024
1 parent a681dd1 commit 16408fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions betterplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def create_mappable(vmin, vmax, cmap, log=False):
for i in np.arange(0, 1.01, 0.1):
ax.plot([0, 1], [i, i], c=mappable.to_rgba(i))
ax.set_limits(0, 1, -0.05, 1.05)
fig.colorbar(mappable)
fig.colorbar(mappable, ax=ax)
.. plot::
:include-source:
Expand All @@ -164,7 +164,7 @@ def create_mappable(vmin, vmax, cmap, log=False):
ax.plot([0, 1], [i, i], c=mappable.to_rgba(i))
ax.log("y")
ax.set_limits(0, 1, 0.9, 110)
fig.colorbar(mappable)
fig.colorbar(mappable, ax=ax)
"""
if log:
norm = mpl_colors.LogNorm(vmin=vmin, vmax=vmax)
Expand Down

0 comments on commit 16408fc

Please sign in to comment.