I'm new to Python and the other programs and I'm attempting to plot 21 members of an ensemble forecast using for loops over the ensemble members, each one having a dedicated number 1-21. When I plot the map, the members all come up blue. I've done some research on colormaps and found that the default maps are not indexed, i.e. I can't call colormap[1] as if it were a list or array. Are there any indexed colormaps out there, or is there any way around this? Simply put, I want to cycle through colors, a different one for each forecast member, using simple numerics.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You could use ax.set_prop_cycle to specify a list of colors to cycle through.
Colormaps are callable, so an easy way to generate colors is to pass an sequence of floats between 0 and 1 to a colormap, which will then return an array of RGBA colors.
For example,