move legend outside image

Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
This commit is contained in:
Gavin Ridley 2023-04-14 12:36:24 -04:00 committed by GitHub
parent 6b03287d52
commit 8bc434a67d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,7 +428,7 @@ class Universe(UniverseBase):
key_patch = mpatches.Patch(color=color, label=key.name)
patches.append(key_patch)
axes.legend(handles=patches)
axes.legend(handles=patches, bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.0)
# Plot image and return the axes
return axes.imshow(img, extent=(x_min, x_max, y_min, y_max), **kwargs)