登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我想过画这么一种图:
透明度随值的大小而变化,比如色条是蓝-绿-黄-红,透明度按此顺序减小,蓝色透明度大,红色不透明度大
一般绘图函数中transparency都只是个标量,不过可以通过设置颜色透明度来实现
conotur函数中,RGBA的A就是透明度
VERT_COLORSA 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)
结果见头部图
|