MBravoS / splotch

Simple PLOTs, Contours and Histograms is a small package with wrapper functions designed to simplify plotting calls from matplotlib.
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Colorbar doesn't work if its not connected to an existing axes #54

Closed MBravoS closed 1 year ago

MBravoS commented 4 years ago

Matplotlib's version allows to generate a color bar without being linked to an existing axes by passing a ScalarMappable, but that functionality is not present on our function to make color bars. Perhaps it would be good to work this out together with issue #41.

AstroRobin commented 1 year ago

The following works in the splotch colorbar function:

fig = plt.figure()

splt.colorbar(mpl.cm.ScalarMappable(norm=None, cmap='plasma'))

plt.show()

Does this solve the issue above?

MBravoS commented 1 year ago

I assume that the issue got fixed with one of the changes in our colour bar since I raised this issue, as it does seem to work, so I'll close this.