hhuangwx / cmaps Goto Github PK
View Code? Open in Web Editor NEWuser defined colormaps in matplotlib.
Home Page: https://github.com/hhuangwx/cmaps
License: GNU General Public License v3.0
user defined colormaps in matplotlib.
Home Page: https://github.com/hhuangwx/cmaps
License: GNU General Public License v3.0
I noticed only one of my custom .rgb files was read and that the colormap that appends '_r' isn't being added. I believe this issue occurs because the try..except is performed before changing cname, therefore cname is already registered and _parse_cmaps returns before the reverse colormap is returned. So, in file cmaps.template line 62 should be moved up above line 57.
Also, anytime there is a .rgb that happens to match an already registered colormap name it won't continue to register the rest of the .rgb files in CMAP_DIR. This may require even further modifications to the try..except.
I've installed the cmaps, which's version is 2.0.1, and my python's version is 3.10.14. However, I'm facing the problem that I could not import it, which shows: 'ImportError: attempted relative import with no known parent package'. Is this problem because the python and cmaps versions are not compatible? How could I resolve it?
Thanks, sincerely.
Trying to use your module. Installed cmaps from conda and tried within a single script and it worked without an issue. However, when I imported into my actual project which has PySide6 (installed from conda as well), it resulted in the following error.
import cmaps
File "shibokensupport/signature/loader.py", line 61, in feature_imported
File "shibokensupport/feature.py", line 135, in feature_imported
AttributeError: 'Cmaps' object has no attribute '__name__'. Did you mean: '__ne__'?
Any way to solve this issue? Or is it possible to use it without installing it?
Can I iterate on those color maps to print them, much like the following code works for matplotlib?
`from pylab import *
from numpy import outer
rc('text', usetex=False)
a=outer(arange(0,1,0.01),ones(10))
figure(figsize=(10,5))
subplots_adjust(top=0.8,bottom=0.05,left=0.01,right=0.99)
maps=[m for m in cm.datad if not m.endswith("_r")]
maps.sort()
l=len(maps)+1
for i, m in enumerate(maps):
subplot(1,l,i+1)
axis("off")
imshow(a,aspect='auto',cmap=get_cmap(m),origin="lower")
title(m,rotation=90,fontsize=10)
title(m,fontsize=10)
savefig("colormaps.png",dpi=300,facecolor='gray')
Would you be willing to package cmaps
into a pypi package? This would allow people to easily install the package (pip install cmaps
) and would help downstream users incorporate the package as a dependency. Ideally, this would also lead to a conda-forge package too.
Perhaps @bonnland or @andersy005 would be willing to help with this.
您好,我是一名即将入职的天气预报员,我看了您的cmaps库,很受启发,目前对于ncl的调色板,只有您的库能够很好的移植到python上,但是依然存在一些问题,比如我想用ncl色板特定的颜色填充等值线,cmaps并不能很好的根据ncl的调色板自定义colormap,此外您的show方法仅能查看颜色,但并不能查看ncl颜色的色号,因此在您的基础上进行了改进,地址在https://github.com/liyuan3970/ncmap;使用样例和数据在example目录中(https://github.com/liyuan3970/ncmap/blob/master/example/example/example.md),期待您的参观,共同进步!!
I try to plot using 'NEO_carb_emit_anom' and 'NEO_div_vegetation_', the results show that Cmaps has no attribute 'NEO_div_vegetation_'
It looks like matplotlib.cm.register_cmap
is now deprecated in version 3.7 of matplotlib: https://matplotlib.org/stable/api/cm_api.html#matplotlib.cm.register_cmap
This is used a few times in here.
The update should be fairly straightforward - just using matplotlib.colormaps.register
instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.