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

Home » Public Forums » archive » Re: Strange positioninig with xyouts
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: Strange positioninig with xyouts [message #46623] Thu, 01 December 2005 05:18 Go to next message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1133431475.452885.103440@g47g2000cwa.googlegroups.com>,
"Darius" <write2darius@gmail.com> wrote:

> Dear group,
>
> how do I get the asterisk to be at 10.0, 10.0 and not at 10.0, 10.5?
> And, the larger the charsize the higher the asterisk in the
> y-direction.
> BTW, I use IDL 6.0 on WinXP.
>
> pro test_xyouts
> loadct, 13
> x = indgen(20)
> _10 = MAKE_ARRAY(20, /INTEGER, VALUE = 10)
> set_plot, 'ps'
> device, filename='test_xyouts.ps', /color
> plot, x, _10, xrange=[0,20], yrange=[0,20]
> oplot, _10, x
> xyouts, 10.,10., '*', /data, charsize=1, FONT=0.0, ALIGNMENT=0.5,
> color=250
> device, /close
> end
>
>
> Cheers, Darius

Since an asterisk is drawn at the top of the "character box", for example, x*,
it won't be centered at the plotting location unless you adjust for the
character size.

Have you tried using PSYM = 2? Symbols are centered at the plotting location.

IDL> plot, [-1,1],[-1,1],/nodata
IDL> plots, [-1,1],[0,0],psym=-3
IDL> plots, [0,0],[-1,1],psym=-3
IDL> plots, 0, 0, psym=2


Ken Bowman
Re: Strange positioninig with xyouts [message #46624 is a reply to message #46623] Thu, 01 December 2005 05:21 Go to previous message
Darius is currently offline  Darius
Messages: 2
Registered: December 2005
Junior Member
Thanks,

the second options works fine for me, even for big symbols, where the
first does not.
Re: Strange positioninig with xyouts [message #46625 is a reply to message #46623] Thu, 01 December 2005 05:09 Go to previous message
rm is currently offline  rm
Messages: 4
Registered: June 2005
Junior Member
Hows about using device coordinates

scale=0.5
pos=CONVERT_COORD(10,10, /data, /to_device)
XYOUTS, pos[0], pos[1]-!d.y_ch_size*scale, /device, '*', align=0.5

you might need to modify scale, as the character might not be
vertically centered

Or alternatively if all you want to do is put a symbol at (10,10) then
use the PLOTS command

PLOTS, 10, 10, psym=2
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Strange positioninig with xyouts
Next Topic: Re: Performance improvement on IDL 6.2 for Linux/MacOSX?

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

Current Time: Wed Oct 08 13:45:42 PDT 2025

Total time taken to generate the page: 0.00519 seconds