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 #86536 is a reply to message #86534] Sun, 17 November 2013 07:38 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lim writes:

> My final code:
>
> Pro sctrpInt
>
> X=[2, 4, 5, 6, 7, 8]
> Y=[20, 40, 45, 30, 10, 5]
> I=[100,200,300,400,500,600]
> nelm=n_elements(X)
> 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,nelms-1 DO cgPlotS, X[j], Y[j],Color=clr[j], Psym=16,symsize=2,/AddCMD
> cgColorbar, Divisions=5, Format='(I3)', Range=[100,600], /AddCMD , Title='I'
>
> End

I prefer to have the color bar separate from the plot and not
overwritten on top of it, but aesthetics are completely up to you. ;-)

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:36:34 PDT 2025

Total time taken to generate the page: 0.00436 seconds