颜色表设置
<p>[TOC]</p>
<h3>颜色表使用方式</h3>
<p>graphics层调用方式:</p>
<pre><code class="language-python">import metdig.graphics.cmap.cm as cm_collected
#matplotlib调用方式
cmap = cm_collected.get_cmap('PuOr')
#met调用方式
cmap = cm_collected.get_cmap('met/rain')
#guide调用方式
cmap = cm_collected.get_cmap('guide/cs26')
#ncl调用方式
cmap = cm_collected.get_cmap('ncl/3saw')
#自定义颜色表方式一
cmap = cm_collected.get_cmap(['#ff0000', '#00ff00' , '#0000ff'])
cmap = cm_collected.get_cmap(['red', 'green', 'blue'])
# 使用extend, levels
cmap,norm = cm_collected.get_cmap('PuOr', extend='both', levels=[500,600,700])
cmap,norm = cm_collected.get_cmap(['white', 'red', 'green', 'blue'], extend='both', levels=[500,600,700])
cmap,norm = cm_collected.get_cmap(['red', 'green'], extend='neither', levels=[500,600,700])</code></pre>
<h3>颜色表</h3>
<h4>matplotlib</h4>
<p>详见https://matplotlib.org/tutorials/colors/colormaps.html#choosing-colormaps-in-matplotlib
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=7c0abbf8e6c15b610be92a1796c6b198" alt="matplotlib_Perceptually_Uniform_Sequential" title="matplotlib_Perceptually_Uniform_Sequential" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=227564b9dcb1501f5db13ffe3ff6a494" alt="matplotlib_Sequential" title="matplotlib_Sequential" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=3955d20a78af9b7aa703f67a179d2263" alt="matplotlib_Sequential2" title="matplotlib_Sequential2" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=9820f693e8879ab92804c5f8638abba2" alt="matplotlib_Diverging" title="matplotlib_Diverging" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=b78a81b7c5306f9a11a1a8fc7128828c" alt="matplotlib_Cyclic" title="matplotlib_Cyclic" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=5647a87f1d7a467a6c509fbd0118ee6b" alt="matplotlib_Qualitative" title="matplotlib_Qualitative" /></p>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=0bce50c58b0b36d50fb14859a9266997" alt="matplotlib_Miscellaneous" title="matplotlib_Miscellaneous" /></p>
<h4>guide</h4>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=9987cbeac5b2c7aec3e466e3225e51b0" alt="guide_colorbar" title="guide_colorbar" /></p>
<h4>met</h4>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=df7169d83e77f8560beb97c52f843f56" alt="met_colorbar" title="met_colorbar" /></p>
<h4>ncl</h4>
<p>详见http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=b65f42dd0cb88f4293f2506774e12cde" alt="ncl_colorbar" title="ncl_colorbar" /></p>