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

Home » Public Forums » archive » Re: symsize in data units
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
Re: symsize in data units [message #66292] Mon, 04 May 2009 19:29
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On May 4, 5:31 pm, pyoac...@gmail.com wrote:
>  > I think it's impossible to do with PSYM or SYMSIZE.
>
>
>
>> On the other hand, it's simple enough to write a small procedure that
>> OPLOT's what you want, in the units you want.  For example, a circle
>> could be done like this,
>
>> pro plot_circle, xcent, ycent, symsize=radius, _EXTRA=extra
>>   th = 2*!dpi/100*dindgen(101)
>>   if n_elements(radius) EQ 0 then r = 1 else r = radius(0)
>>   x = r*cos(th) & y = r*sin(th)
>>   for i = 0, n_elements(xcent)-1 do $
>>     oplot, xcent(i)+x, ycent(i)+y, _EXTRA=extra
>> end
>
>> Then you can call PLOT_CIRCLE, x, y, symsize=4.5
>
> Thanks Craig, that works great.  I replaced your oplot with a polyfill
> so I could get solid points.  I was also surprised that I can get this
> to make smaller postscript files than using the plotsym procedure.  I
> thought for sure your routine would make giant output.

Heh, if you want a bigger postscript file, you could change the 100
above to 1000 :-)

It's strange you say PLOTSYM makes bigger files, since it seems to use
only 50 points instead of 100 to construct a circle.

Craig
Re: symsize in data units [message #66297 is a reply to message #66292] Mon, 04 May 2009 14:31 Go to previous message
pyoachim is currently offline  pyoachim
Messages: 2
Registered: January 2009
Junior Member
> I think it's impossible to do with PSYM or SYMSIZE.
>
> On the other hand, it's simple enough to write a small procedure that
> OPLOT's what you want, in the units you want.  For example, a circle
> could be done like this,
>
> pro plot_circle, xcent, ycent, symsize=radius, _EXTRA=extra
>   th = 2*!dpi/100*dindgen(101)
>   if n_elements(radius) EQ 0 then r = 1 else r = radius(0)
>   x = r*cos(th) & y = r*sin(th)
>   for i = 0, n_elements(xcent)-1 do $
>     oplot, xcent(i)+x, ycent(i)+y, _EXTRA=extra
> end
>
> Then you can call PLOT_CIRCLE, x, y, symsize=4.5

Thanks Craig, that works great. I replaced your oplot with a polyfill
so I could get solid points. I was also surprised that I can get this
to make smaller postscript files than using the plotsym procedure. I
thought for sure your routine would make giant output.
Re: symsize in data units [message #66307 is a reply to message #66297] Sun, 03 May 2009 18:21 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On May 1, 5:42 pm, ianpaul.free...@gmail.com wrote:
> Does anyone know a way to set the plotting symbol size in terms of
> data units?  In particular, I'd like to make the plotting symbol a
> circle with diameter 4.3 data units.  Then I'd like to do it both on-
> screen and output to postscript.

I think it's impossible to do with PSYM or SYMSIZE.

On the other hand, it's simple enough to write a small procedure that
OPLOT's what you want, in the units you want. For example, a circle
could be done like this,

pro plot_circle, xcent, ycent, symsize=radius, _EXTRA=extra
th = 2*!dpi/100*dindgen(101)
if n_elements(radius) EQ 0 then r = 1 else r = radius(0)
x = r*cos(th) & y = r*sin(th)
for i = 0, n_elements(xcent)-1 do $
oplot, xcent(i)+x, ycent(i)+y, _EXTRA=extra
end

Then you can call PLOT_CIRCLE, x, y, symsize=4.5
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL Workspace error won't go away
Next Topic: newbie question on array manipulation

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

Current Time: Wed Oct 08 19:57:18 PDT 2025

Total time taken to generate the page: 0.00479 seconds