reasonzhang的个人博客分享 http://blog.sciencenet.cn/u/reasonzhang

博文

IDL 修改现有的predefined colortable

已有 3807 次阅读 2014-8-10 06:25 |个人分类:经验|系统分类:科研笔记|关键词:学者

与colortable相关的几个比较重要命令:

xloadct/xpalette 修改与查看现有的colortable,后者可以提供详尽的colortable颜色参数。

loadct,colortable_number  载入某colortable(默认为41个,即0-40号)

tvlct,red,green,blue,/get 将现在所使用的colortable的红绿蓝属性赋予red,green,blue变量里,此三者为256长度的变量,对应colortable 256个颜色中,红绿蓝的强度

modifyct,colortable_number,colortable_name,red,green,blue[,file=file_name]

将red,green,blue三个变量以colortable_name为名,colortable_number为序号,存入现有的colortable文件中。


范例:

由于经常有colortable只有黑色和白色中一个颜色,在使用device,decomposed=0(即使用colortable中256个颜色)后,可能无法同时调用黑色和白色(只针对过程作图法的情况)。于是考虑修改现有的colortable。


本范例利用13号colortable,将其第一个颜色改为白色,第二个颜色改为纯黑色,并以41序号存入。

 loadct,13

 tvlct,red,green,blue,/get

 red[0]=255 & green[0]=255 & blue[0]=255

 red[1]=0 & green[1]=0 & blue[1]=0

 modifyct,41,'Rea 13',red,green,blue,file='G:colors1.tbl'




https://m.sciencenet.cn/blog-733034-818407.html

上一篇:IDL使用IDL_IDLbridge进行“多线程”运算
下一篇:IDL中使用对象出图法和过程出图的交互

0

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-21 01:34

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部