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

Home » Public Forums » archive » Re: Frustrated by 2 Data Plotting problems
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: Frustrated by 2 Data Plotting problems [message #76299 is a reply to message #76298] Thu, 26 May 2011 12:54 Go to previous messageGo to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
>
> data = cgDemoData(14)
> Help, data
> ; The data will be in three columns, lon, lat, data.
> cgLoadCT, 33
> cgPlot, data[0,*], data[1,*], /YNoZero, /NoData
> cgPlotS, data[0,*], data[1,*], PSym=16, SymSize=2.0, $
> SymColor=BytScl(data[2,*])
>

So say you wanted to colour the points based on a 2D histogram of the data, so that when the overplotting fills a part of the plot, at least colour gives you an indication that there is a higher density of dots... (see http://tinyurl.com/3kv9kdm and sorry for the partial thread hijack!) Would you go about it in a similar way or is there a faster way?

Here's what I came up with, using sshist_2d.pro (http://tinyurl.com/3on7bzx) that automagically finds bin size:


h2=sshist_2d(x,y, re=ri1, cost=co)

col=x*0
nn=n_elements(h2)
for b=0L, nn-1 do begin &$
w=histobin(ri1,b) &$
if w[0] ne -1 then col[w]=h2[b] &$
endfor


cgloadct, 33

set_plot, 'z'
device, z_buff=0, set_res=[!D.X_SIZE,!D.Y_SIZE]
cgplot, x, y, /noda, back=cgcolor('black'), $
color=cgcolor('white'), chars=1.5
cgplots, x, y, ps=16, syms=.1, symcol=bytscl(col)
a=tvrd(/tr)
set_plot, 'x'
tv, a, /tr
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: question
Next Topic: re-binning with linear interpolation

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

Current Time: Wed Oct 08 15:26:57 PDT 2025

Total time taken to generate the page: 0.00490 seconds