Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion PlotS, Color
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
robinson....@gmail.com  
View profile  
 More options Oct 6 2012, 8:08 pm
Newsgroups: comp.lang.idl-pvwave
From: robinson....@gmail.com
Date: Sat, 6 Oct 2012 17:08:03 -0700 (PDT)
Local: Sat, Oct 6 2012 8:08 pm
Subject: Re: PlotS, Color

On Saturday, October 6, 2012 10:07:56 AM UTC-4, (unknown) wrote:
> Hi all,

> I would like some help. I have this data

> 3   50  5

> 4   60  10

> 5   70  15

> 8   80  20

> 4   90  20

> 3   100 15

> 1   110 10

> The 2nd and 3rd cols are lon and lat. I need to plot a line conecting the values with especific colors. For instance from 3 to 4 in yellow, from 4 to 8 (and 8 to 4) in red, from 4 to 3 in yellow, and 3 to 1 in blue.

> Suggestions?

> Rob

Hi All, after Phillip's suggestion, I am doing this ( I am using David Fanning's IDL libraries, and IDL 6.3):

colors=['blue', 'green', 'yellow', 'gold', 'orange', 'brown', 'red', 'black']
    levels = [0, 5, 8, 10, 15, 23, 30]  ; color levels
    s = Size(vals, /Dimensions)
    TVLCT, cgColor(colors, /Triple), 1
    scaleddata = BytArr(s[0])

    FOR c=1,6 DO BEGIN
     index = Where(vals GE levels[c-1] AND itcws LT levels[c], count)
      IF count GT 0 THEN scaleddata[index] = Byte(c)
    ENDFOR
    index = Where(vals GT 30, count)
    IF count GT 0 THEN scaledImage[index] = 7B
    missing = Where(vals LT 0, missing_count)
    IF missing_count GT 0 THEN scaleddata[missing] = 8B

    FOR c=0,s-2 DO cgPlotS, [lons[c], lons[c+1]], [lats[c], lats[c+1]],color=StrTrim(scaleddata[c],2), Thick=2
    FOR c=0,s-1 DO cgPlotS,  lons[c], lats[c], PSym=2, Color=StrTrim(scaleddata[c],2)

vals, lons and lats have 300 element each.
However, about the second last FOR I am getting the following: Expression must be a scalar in this context: <LONG      Array[1]>.

Can someone help me and tell me what I am doing wrong?

Regards,
Rob.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.