-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spatial bias plot error with mpl 3.6 #135
Comments
For anyone who needs a quick fix, |
@zmoon @rschwant I had the same issue after updating the pkg. Below is my quick fix: ...
newcmap = ListedColormap(newcolors, name='OrangeBlue')
mpl.colormaps.register(newcmap)
return newcmap In spatial bias plot: ...
newcmap = 'OrangeBlue'
try:
mpl.colormaps[newcmap]
except KeyError:
new_color_map()
... This will work for matplotlib >=3.6 |
@jianheACM the bug in pandas was fixed in v1.5.2. What is your pandas version? |
Registering and using the string name seems like a good workaround though, maybe we should add this to MM anyway. |
It's v1.5.1. But it's good to know it is fixed in v1.5.2. |
@jianheACM and @zmoon if you feel like registering the colormap like Jian did above will lead to less package versioning incompatibilities, I'm fine with updating this like Jian suggests. |
A better method for this has been merged to develop, to avoid future problems. Since this doesn't cause problems currently I am closing it. |
Got error message:
unhashable type: 'ListedColormap'
in spatial bias plotAbbreviated traceback:
monet.plots.sp_scatter_bias(..., cmap=new_color_map(), ...)
passes a customListedColormap
.In monet, this is passed through to pandas
df.plot.scatter
Based on the message below, it seems pandas is expecting a cmap name if mpl >= 3.6?
The text was updated successfully, but these errors were encountered: