爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3041|回复: 0

[混合编程] IDL之非均一透明度等值线图

[复制链接]

新浪微博达人勋

发表于 2019-8-8 17:31:40 | 显示全部楼层 |阅读模式

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

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

x
非均一透明度等值线图.png


我想过画这么一种图:
透明度随值的大小而变化,比如色条是蓝-绿-黄-红,透明度按此顺序减小,蓝色透明度大,红色不透明度大

一般绘图函数中transparency都只是个标量,不过可以通过设置颜色透明度来实现


conotur函数中,RGBA的A就是透明度
VERT_COLORS
A vector of colors to be used to specify the color of a contour vertex. The vector may be of the form [n*m] or [n, m] where each entry is a color index, or of the form [3,n*m] where each 3-element row is an RGB color, or of the form [4,n*m] where each 4-element row is an RGBA color. To remove vertex colors after they have been set, set VERT_COLORS to a scalar. If VERT_COLORS is not specified, the entire contour is drawn in the single color provided by the COLOR property, which is the default action. If this property is set to a vector or a two-dimensional array of equal size to the data, these values are indices into a color table that can be specified by the RGB_TABLE property. If more vertices exist than elements in VERT_COLORS, the elements of VERT_COLORS are cyclically repeated.



示例代码:
r=[0:240:30]
g=fltarr(9)
b=fltarr(9)
A=[0:240:30]
colors=[transpose(r),transpose(g),transpose(b),transpose(A)]
fig=contour(randomn(s,5,5),c_color=colors,/fill,BACKGROUND_color='w',/overplot)


结果见头部图


密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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