X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Jun 2011 10:42 AM by  anon
TEXT Function
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:10
New Member


--
09 Jun 2011 10:42 AM
    Hello, I am having trouble with the TEXT function when I put multiple plots on the same figure (in a FOR loop). In the following example, the text is written in the same location on the first plot instead of each subsequent plot. Any advice would be greatly appreciated. Thank you, Kim W = WINDOW(DIMENSIONS=[1024,1024]) FOR N=0,3 DO BEGIN Y = SIN((N+1)*FINDGEN(201)*!PI/25.0) P = PLOT(Y,/CURRENT,LAYOUT=[1,4,N+1]) T = TEXT(0.18,0.94,'N = '+STRING(N+1),/NORMAL,TARGET=P) ENDFOR

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Jun 2011 04:58 PM
    Hi Khyde, This is because you are using normalized coordinates in the TEXT() function, instead of using DATA coordinates. Try the following: T = TEXT(0.18,1.1,'N = '+STRING(N+1),TARGET=P, /DATA) In other words, the following should work better: W = WINDOW(DIMENSIONS=[1024,1024]) FOR N=0,3 DO BEGIN Y = SIN((N+1)*FINDGEN(201)*!PI/25.0) P = PLOT(Y,/CURRENT,LAYOUT=[1,4,N+1]) T = TEXT(0.18,1.1,'N = '+STRING(N+1),TARGET=P, /DATA) ENDFOR Cheers, Fernando
    You are not authorized to post a reply.