爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 22996|回复: 10

[求助] matplotlib绘图的配色问题

[复制链接]
发表于 2013-10-11 20:45:51 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
现在绘图用的是matplotlib.pyplot.cm.gray配色,得到的是灰度图, 试了试其它的配色方案, 都不太好看,在一篇文献里面看到了下面的配色图, 好像就红黄蓝白四种颜色, 但是自己却配不出人家的那种效果, 请教大侠! QQ浏览器截屏未命名.png

密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-10-11 21:02:57 | 显示全部楼层
本帖最后由 lon91ong 于 2013-11-1 10:14 编辑

顺便分享一个Matplotlib colormaps教程: http://wiki.scipy.org/Cookbook/Matplotlib/Show_colormaps
文中的这一段看不太懂,希望英语好的大侠帮忙翻译一下:

  1. First, create a script that will map the range (0,1) to values in the RGB spectrum. In this dictionary, you will have a series of tuples for each color 'red', 'green', and 'blue'. The first elements in each of these color series needs to be ordered from 0 to 1, with arbitrary spacing inbetween. Now, consider (0.5, 1.0, 0.7) in the 'red' series below. This tuple says that at 0.5 in the range from (0,1) , interpolate from below to 1.0, and above from 0.7. Often, the second two values in each tuple will be the same, but using diferent values is helpful for putting breaks in your colormap.
复制代码
另外一个参考似乎更明白一些:http://matplotlib.org/api/colors_api.html#matplotlib.colors.LinearSegmentedColormap
密码修改失败请联系微信:mofangbao
发表于 2013-10-12 10:36:58 | 显示全部楼层
感谢分享
密码修改失败请联系微信:mofangbao
发表于 2013-10-14 12:40:09 | 显示全部楼层
感谢分享,。、,。、,。
密码修改失败请联系微信:mofangbao
发表于 2013-10-28 23:00:24 | 显示全部楼层
这图很棒呀!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-11-1 10:04:08 | 显示全部楼层
自定,求二楼翻译
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-11-1 22:15:07 | 显示全部楼层
终于整明白了,看我配的图,跟顶楼的配色像不像?!
figure_1.png
密码修改失败请联系微信:mofangbao
发表于 2013-11-2 13:23:02 | 显示全部楼层
感谢分享啊
密码修改失败请联系微信:mofangbao
发表于 2014-1-14 09:46:16 | 显示全部楼层
楼主画的就是抽象画啊
密码修改失败请联系微信:mofangbao
发表于 2015-5-22 15:46:56 | 显示全部楼层
Python的梵高
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表