百度空间 | 百度首页 
 
查看文章
 
【转】用数字作为线画图的标记
2009-08-28 12:18

大卫的网站被和谐后,给很多IDLer带来了不便。不能及时访问到大卫老兄的最新发布。这里转来一些大卫老兄的好东西,分享给大家。不翻译了,懒。。。

Using Numbers as Symbols

QUESTION: I would like to display a normal IDL line plot, but instead of using a symbol to represent each point, I would like to use a number. Is this possible in IDL?

ANSWER: Yes, it is possible to do this. Here is an example of the kind of code you might have to write. First, let's create some data to plot.

x = Indgen(50)
   y = RandomU(-3L, 50) * 100

And now we plot the data. Notice that we are going to create a space for the numbers by first overplotting a blank space where we can write the numbers.

Plot, x, y, BACKGROUND=FSC_Color('ivory'), COLOR=FSC_Color('navy')
   OPlot, x, y, COLOR=FSC_Color('ivory'), PSYM=SymCat(15), SYMSIZE=2.0
   XYouts, x, y, StrTrim(Sindgen(50)+1, 2), COLOR=FSC_Color('red'), $
        ALIGN=0.5, CHARSIZE=0.75

You can see the result of the code above in the figure below.

An IDL plot with numbers used in place of symbols.


类别:idl实用大全 | 添加到搜藏 | 浏览() | 评论 (3)
 
最近读者:
 
网友评论:
1
2009-08-29 17:25 | 回复
大卫的网站只能用代理上了
 
2
2009-08-30 21:09 | 回复
David的资源丰富啊,如果把他的电脑硬盘拿过来
 
3
2009-09-26 17:40 | 回复
正好,用到,不错
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu