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

Home » Public Forums » archive » Re: text positioning within multiple plots
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: text positioning within multiple plots [message #54703 is a reply to message #54698] Tue, 10 July 2007 09:22 Go to previous messageGo to previous message
astroboy2k is currently offline  astroboy2k
Messages: 34
Registered: July 2007
Member
I think the problem here is in using the /normal keyword in multiple
plots.

Doing this:
plot,findgen(10)
xyouts,.1,.1,char,/normal

places char in the lower left hand part of the screen, regardless of
whether you're using multiple plots or not, which is no good.

I wrote the following code to overcome this problem:

Mark


;
pro
sub_xyouts,xx0,yy0,char,charsize=charsize,xdata=xdata,ydata= ydata,color=color,align=align

;xx0 and yy0 are usually normal coordinates, eg, fraction of the
current area of the plot
;setting the xdata or ydata keywords converts xx0 and yy0 from data to
normal coordinates

xx=xx0
yy=yy0

delx=!x.window(1)-!x.window(0)
dely=!y.window(1)-!y.window(0)

if keyword_set(ydata) then yy=(yy-!y.crange(0))/(!y.crange(1)-!
y.crange(0))
if keyword_set(xdata) then xx=(xx-!x.crange(0))/(!x.crange(1)-!
x.crange(0))
col=0
if keyword_set(color) then col=color

xx=!x.window(0)+xx*delx+.02*delx
yy=!y.window(0)+yy*dely+.02*dely


csize=.8
if (keyword_set(charsize)) then csize=charsize

col=0
if keyword_set(color) then col=color


aline=0.
if keyword_set(align) then aline=align
xyouts,xx,yy,char,charsize=csize,/normal,color=col,align=ali ne

return
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MOD43B3 Col.4 Processing. unexpected error message. why?
Next Topic: storing string array into HDF

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

Current Time: Sat Oct 11 19:07:11 PDT 2025

Total time taken to generate the page: 0.56109 seconds