Re: Bug in XYOUTS? [message #13764] |
Sat, 28 November 1998 00:00 |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Vinay L. Kashyap wrote:
> Anyone know why XYOUTS "wraps" back? Why does it place labels
> on the plot area even though the specified locations are waay
> outside the view area?
>
> Here is an example of what I mean..
>
> xr=[99.9,100.1] & yr=[-20,20] ;define the plotting area
> x=findgen(1000)*0.1+100. ;points at which to mark labels
> ;(expect only 2 within defined area)
> y=randomn(seed,1000)*5. ;y-locations, staggered for readability
> l=strtrim(x,2) ;labels, same as x-positions
> plot,[0],xrange=xr,yrange=yr ;set up plotting area
> xyouts,x,y,l ;plot the labels
>
> the actual numbers that show up on the viewing area appear to
> depend on the size of the window and XRANGE. Sometimes there
> are also horizontal lines running across the window.
>
> this does not happen if one sets plotting device to 'ps'
>
> thanks to Jim Petreshock, I do have a workaround (use keyword
> NOCLIP=0 for XYOUTS), but this feature is so strange that I
> would like to know the explanation, if anyone knows it!
>
> I am using IDL4 and IDL5.1 on Solaris 2.5 .
>
> Thanks,
> Vinay
> ____________________________________________________________ __________________
> kashyap@head-cfa.harvard.edu 617 495 7173 [CfA/P-146] 617 496 7173 [F]
> --
> kashyap@ \
> head-cfa.harvard.edu \
> ____________________________________________________________ __________\_______
> Vinay Kashyap 617 495 7173 [P146] 617 591 9492 [H]
Hi Vinay,
haven't shown up at Badminton for a while now -- probably because I am doing
too much IDL ;-)
I don't know the solution to your problem, but it is the same that happens with
plots. Apparently, IDL prefers not to clip anything in these two routines.
I believe, it does some kind of conversion to integer arithmetics for speed
reasons and then ends up at the wrong memory locations. Interestingly, though,
plots does plot the symbols at the correct y locations ... If NOCLIP=0 works,
that's good to know. Otherwise you'll have to manually clip your labels like
ind = where(x ge !x.crange[0] AND x le !x.crange[1] AND y ge !y.crange[0] AND
y le !y.crange[1]) ; after the plot command!
xyouts,x[ind],y[ind],l[ind]
Regards,
Martin.
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
|
|
|