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

Home » Public Forums » archive » How do I create a scatter plot with colored symbols in accordance with their frequency of occurrence?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How do I create a scatter plot with colored symbols in accordance with their frequency of occurrence? [message #88696] Wed, 04 June 2014 14:26 Go to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

I know how to make a scatter plot. But I want the symbol colors being represented by the frequency of occurrence. Can anyone help me with an example synthetic data?

Thanking you in advance,
With regards,
Madhavan
Re: How do I create a scatter plot with colored symbols in accordance with their frequency of occurrence? [message #88697 is a reply to message #88696] Wed, 04 June 2014 15:01 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> I know how to make a scatter plot. But I want the symbol colors being represented by the frequency of occurrence. Can anyone help me with an example synthetic data?

x = RandomU(-3L, 200)*5
y = 2.2 + RandomU(-5L, 200)*x
data = RandomU(-2L, 200) * 10

h = cgHistogram(data, binsize=0.5, REVERSE_INDICES=ri)
cgLoadCT, 33, NColors=20
cgPlot, x, y, /NoData, Position=[0.15,0.15, 0.8, 0.9]
FOR j=0,19 DO BEGIN
indices = cgReverseIndices(ri, j, COUNT=count)
IF count GT 0 THEN BEGIN
cgPlotS, x[indices], y[indices], PSYM=16, COLOR=Byte(j)
ENDIF
ENDFOR
cgColorbar, NColors=20, Range=[0,10], Divisions=10, /Vertical, $
Title='Frequency of Occurance', TLocation='Right'
END

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.")
Re: How do I create a scatter plot with colored symbols in accordance with their frequency of occurrence? [message #88698 is a reply to message #88697] Thu, 05 June 2014 08:53 Go to previous message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Thank you David ...It works!


On Thursday, June 5, 2014 12:01:00 AM UTC+2, David Fanning wrote:
> Madhavan Bomidi writes:
>
>
>
>> I know how to make a scatter plot. But I want the symbol colors being represented by the frequency of occurrence. Can anyone help me with an example synthetic data?
>
>
>
> x = RandomU(-3L, 200)*5
>
> y = 2.2 + RandomU(-5L, 200)*x
>
> data = RandomU(-2L, 200) * 10
>
>
>
> h = cgHistogram(data, binsize=0.5, REVERSE_INDICES=ri)
>
> cgLoadCT, 33, NColors=20
>
> cgPlot, x, y, /NoData, Position=[0.15,0.15, 0.8, 0.9]
>
> FOR j=0,19 DO BEGIN
>
> indices = cgReverseIndices(ri, j, COUNT=count)
>
> IF count GT 0 THEN BEGIN
>
> cgPlotS, x[indices], y[indices], PSYM=16, COLOR=Byte(j)
>
> ENDIF
>
> ENDFOR
>
> cgColorbar, NColors=20, Range=[0,10], Divisions=10, /Vertical, $
>
> Title='Frequency of Occurance', TLocation='Right'
>
> END
>
>
>
> 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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl 32 bit not starting in 64 bit Ubuntu 14.04 system
Next Topic: undefined procedure/function CIRC

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

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

Total time taken to generate the page: 0.00702 seconds