comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » scatter plot , intensity colors. Help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: scatter plot , intensity colors. Help [message #86515 is a reply to message #86511] Fri, 15 November 2013 06:25 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lim writes:

>
> Dear all,
>
> I need to do a scatterplot with colored symbols representing the intensity. I am adapting an example I found at http://www.idlcoyote.com/gallery/colored_line_plot.pro I am doing the following:
>
> X=[2, 4, 5, 6, 7, 8]
> Y=[20, 40, 45, 30, 10, 5]
> I=[100,200,300,400,500,600]
>
> ;intensity color
> colors = cgScaleVector(Findgen(N_Elements(I)), Min(I), Max(I))
> clr = Value_Locate(colors, I)
> clr = Byte(Round(cgScaleVector(clr, 0, 255)))
>
> cgLoadCT, 33
> cgWindow
>
> ;the scatterplot
> cgPlot, X, Y, /Nodata, /AddCMD
> FOR j=0,N_Elements(X)-2 DO cgPlotS, [X[j], X[j+1]], [Y[j], Y[j+1]], $
> Color=clr[j], Psym=16,symsize=2,/AddCMD
> FOR j=0,N_Elements(pNPP)-1,2 DO cgPlotS, X[j], Y[j], $
> Color=clr[j], Psym=16,symsize=2, /AddCMD
>
>
> However the output produces a gray scale image.
> 1. What am I doing wrong?

My guess would be using an outdated Coyote Library. There is no gray
scale coloring when I run your example. I follow these steps to resolve
these kinds of issues:

http://www.idlcoyote.com/code_tips/fixcoyoteprogram.php

> 2. How can I add a color bar associated with the intensity (I)?

I think I would use cgColorbar. Did this *not* work for some reason?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: =?UTF-8?Q?How=20to=20use=20IDL=20to=20?==?UTF-8?Q?call=20?= =?UTF-8?Q?SQL=5FServer=5F2008=20datab?==?UTF-8?Q?ase?=
Next Topic: reading in from multiple files, performing operations and printing them to multiple output file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:39:49 PDT 2025

Total time taken to generate the page: 0.00455 seconds