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

Home » Public Forums » archive » plotting filled circles of defined radius
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
plotting filled circles of defined radius [message #88674] Thu, 29 May 2014 23:48 Go to next message
Krishnakumar M.A is currently offline  Krishnakumar M.A
Messages: 19
Registered: March 2013
Junior Member
Hi,

I was able to plot circles of radius as given from a file in idl. Is it possible to make the circle shaded inside? I tried with /fill which did not work. Is there a work around to do this?

Thanks,
Krishnakumar
Re: plotting filled circles of defined radius [message #88675 is a reply to message #88674] Fri, 30 May 2014 04:10 Go to previous messageGo to next message
dg86 is currently offline  dg86
Messages: 118
Registered: September 2012
Senior Member
On Friday, May 30, 2014 2:48:54 AM UTC-4, Krishnakumar M.A wrote:
> Hi,
>
>
>
> I was able to plot circles of radius as given from a file in idl. Is it possible to make the circle shaded inside? I tried with /fill which did not work. Is there a work around to do this?
>
>
>
> Thanks,
>
> Krishnakumar

Using function graphics, the following should do what you want:

p = plot(/test, color='black', symbol='o', /sym_filled, sym_fill_color='light yellow',sym_size=1.5)

All the best,

David
Re: plotting filled circles of defined radius [message #88676 is a reply to message #88675] Fri, 30 May 2014 06:42 Go to previous messageGo to next message
Krishnakumar M.A is currently offline  Krishnakumar M.A
Messages: 19
Registered: March 2013
Junior Member
On Friday, May 30, 2014 4:40:23 PM UTC+5:30, David Grier wrote:
> On Friday, May 30, 2014 2:48:54 AM UTC-4, Krishnakumar M.A wrote:
>
>> Hi,
>
>>
>
>>
>
>>
>
>> I was able to plot circles of radius as given from a file in idl. Is it possible to make the circle shaded inside? I tried with /fill which did not work. Is there a work around to do this?
>
>>
>
>>
>
>>
>
>> Thanks,
>
>>
>
>> Krishnakumar
>
>
>
> Using function graphics, the following should do what you want:
>
>
>
> p = plot(/test, color='black', symbol='o', /sym_filled, sym_fill_color='light yellow',sym_size=1.5)
>
>
>
> All the best,
>
>
>
> David

Hi,

Thanks for your reply.

Its not working for my data.
The below is a script I wrote, to plot the circles. Please let me know if anything can be done on that? Sorry I didnt post it before.

openr,1,'test_idl.dat'
data1=fltarr(3,218)

readf,1,data1
lo=reform(data1[0,*])
bo=reform(data1[1,*])
dm=reform(data1[2,*])

plot, [0,1], [0,1], /nodata,xrange=[0,360],yrange=[-35,30], xticklen=1,yticklen=1,xgridstyle=1,ygridstyle=1, background=0,xstyle=9

for i=0,217 do begin

n=49.0
theta=findgen(n)/(n-1.0)*2*!pi

xo=lo(i)+ro(i)*sin(theta)/110
yo=bo(i)+ro(i)*cos(theta)/120

oplot,xo,yo,linestyle=0,color=0

endfor
close,1
end


Thanks,
Krishnakumar
Re: plotting filled circles of defined radius [message #88678 is a reply to message #88676] Fri, 30 May 2014 06:57 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Krishnakumar M.A writes:

> Its not working for my data.
> The below is a script I wrote, to plot the circles. Please let me know if anything can be done on that?

If you just want filled circles of different radii, you can do something
like this:

data = Randomu(-3L, 50) * 10
x = 0.5 > (Randomu(seed, 50) * 10) < 9.5
y = 0.5 > (Randomu(seed, 50) * 10) < 9.5
radius = cgScaleVector(data, 1.0, 4.0)
colors = Bytscl(data)
cgPlot, x, y, /Nodata
cgLoadCT, 33
FOR j=0,N_Elements(data)-1 DO BEGIN
cgOplot, x[j], y[j], SYMSIZE=radius[j], PSYM=16, COLOR=colors[j]
ENDFOR
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: plotting filled circles of defined radius [message #88679 is a reply to message #88676] Fri, 30 May 2014 13:32 Go to previous messageGo to next message
Bill Nel is currently offline  Bill Nel
Messages: 31
Registered: October 2010
Member
> theta=findgen(n)/(n-1.0)*2*!pi
> xo=lo(i)+ro(i)*sin(theta)/110
> yo=bo(i)+ro(i)*cos(theta)/120
> oplot,xo,yo,linestyle=0,color=0

For "direct" (old) graphics, the IDL procedure USERSYM lets you define a plotting symbol, a circle in your case. Then you just use
plot, x, y, usersym=8
I use it all the time -- works great.
Re: plotting filled circles of defined radius [message #88680 is a reply to message #88678] Sat, 31 May 2014 08:45 Go to previous message
Krishnakumar M.A is currently offline  Krishnakumar M.A
Messages: 19
Registered: March 2013
Junior Member
On Friday, May 30, 2014 7:27:24 PM UTC+5:30, David Fanning wrote:
> Krishnakumar M.A writes:
>
>
>
>> Its not working for my data.
>
>> The below is a script I wrote, to plot the circles. Please let me know if anything can be done on that?
>
>
>
> If you just want filled circles of different radii, you can do something
>
> like this:
>
>
>
> data = Randomu(-3L, 50) * 10
>
> x = 0.5 > (Randomu(seed, 50) * 10) < 9.5
>
> y = 0.5 > (Randomu(seed, 50) * 10) < 9.5
>
> radius = cgScaleVector(data, 1.0, 4.0)
>
> colors = Bytscl(data)
>
> cgPlot, x, y, /Nodata
>
> cgLoadCT, 33
>
> FOR j=0,N_Elements(data)-1 DO BEGIN
>
> cgOplot, x[j], y[j], SYMSIZE=radius[j], PSYM=16, COLOR=colors[j]
>
> ENDFOR
>
> 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.")

Thanks a lot David. That worked like charm for me.

Krishnakumar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Create an XML file in IDL
Next Topic: shp file to ENVI classification file type

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

Current Time: Wed Oct 08 15:13:32 PDT 2025

Total time taken to generate the page: 0.00773 seconds