博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
colormap参考图
阅读量:3960 次
发布时间:2019-05-24

本文共 2176 字,大约阅读时间需要 7 分钟。

import numpy as npimport matplotlib.pyplot as pltcmaps = [('Perceptually Uniform Sequential', [            'viridis', 'plasma', 'inferno', 'magma', 'cividis']),         ('Sequential', [            'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds',            'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu',            'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']),         ('Sequential (2)', [            'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink',            'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia',            'hot', 'afmhot', 'gist_heat', 'copper']),         ('Diverging', [            'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu',            'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic']),         ('Cyclic', ['twilight', 'twilight_shifted', 'hsv']),         ('Qualitative', [            'Pastel1', 'Pastel2', 'Paired', 'Accent',            'Dark2', 'Set1', 'Set2', 'Set3',            'tab10', 'tab20', 'tab20b', 'tab20c']),         ('Miscellaneous', [            'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern',            'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg',            'gist_rainbow', 'rainbow', 'jet', 'turbo', 'nipy_spectral',            'gist_ncar'])]gradient = np.linspace(0, 1, 256)gradient = np.vstack((gradient, gradient))def plot_color_gradients(cmap_category, cmap_list):    # Create figure and adjust figure height to number of colormaps    nrows = len(cmap_list)    figh = 0.35 + 0.15 + (nrows + (nrows-1)*0.1)*0.22    fig, axs = plt.subplots(nrows=nrows, figsize=(6.4, figh))    fig.subplots_adjust(top=1-.35/figh, bottom=.15/figh, left=0.2, right=0.99)    axs[0].set_title(cmap_category + ' colormaps', fontsize=14)    for ax, name in zip(axs, cmap_list):        ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))        ax.text(-.01, .5, name, va='center', ha='right', fontsize=10,                transform=ax.transAxes)    # Turn off *all* ticks & spines, not just the ones with colormaps.    for ax in axs:        ax.set_axis_off()for cmap_category, cmap_list in cmaps:    plot_color_gradients(cmap_category, cmap_list)plt.show()

plt.cm下可用的色彩图

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

转载地址:http://gymzi.baihongyu.com/

你可能感兴趣的文章
实用小技巧之电脑如何滚动截屏/截取长图
查看>>
Eclipse离线安装Java Decompiler插件
查看>>
Http预请求options
查看>>
未来设计师的工作模式?从室内设计领域的实时设计说起 | Mixlab趋势
查看>>
智能设计 | MixAI 知识库 No.69
查看>>
通过研究微信文章的相关推荐逻辑 ,尝试生成指南| Mixlab设计黑客
查看>>
浏览器低成本实现免手提的用户体验,使用人脸、手势、姿态追踪 | Mix群聊
查看>>
这个世界上肯定有另一个我,做着我不敢做的事,过着我想过的生活 | MixAI 知识库 No.70...
查看>>
表情包数据挖掘 | Mix群聊
查看>>
如何阅读科研论文
查看>>
理解本真的REST架构风格
查看>>
10款免费且开源的项目管理工具
查看>>
java调用javascript :js引擎rhino
查看>>
asp 中常用的文件处理函数
查看>>
ADO中sqlserver存储过程使用
查看>>
Linux KernelTech版FAQ 1.0
查看>>
ntfs分区iis故障的解决
查看>>
个人创业“六大死穴”
查看>>
最重要的 12个 J2EE 最佳实践
查看>>
通过Java Swing看透MVC设计模式
查看>>