简体   繁体   English

在Matplotlib等高线图中选择颜色

[英]Choosing color in matplotlib contour maps

Hello all of matplotlib experts! 您好所有matplotlib专家! I have not found description in matplotlib examples of how can I set which colours I want each area to be. 我在matplotlib示例中未找到有关如何设置每个区域要设置的颜色的描述。 Is it possible to set the colours myself instead of matplotlib automatically assign them? 是否可以自己设置颜色,而不是由matplotlib自动分配颜色?

The contour map that I obtained so far looks like this: 到目前为止,我获得的轮廓图如下所示:

轮廓图要修改

Any other recommendations on how to produce readable contour maps will be very much appreciated! 任何其他有关如何生成可读轮廓图的建议将不胜感激!

Check out this example . 看看这个例子 You can set up your own colormap colors like this: 您可以像这样设置自己的颜色图颜色:

cmap = mpl.colors.ListedColormap(['r', 'g', 'b', 'c'])

You can also select from the existing colormap options 您也可以从现有的颜色图选项中进行选择

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM