X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 Oct 2008 09:58 PM by  anon
problem with plot title in shade_surf using /t3d keyword
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
07 Oct 2008 09:58 PM
    I've been working with the shade_surf routine using the /t3d keyword to plot power spectra and have noticed some odd behavior with the title keyword.  If you plot a 3D surface using shade_surf, the plot title resides in a plane parallel to the x-z plane.  When you project the surface onto a 2D plane using the /t3d keyword, the title and z-axis labels remain in this plane and appear as though you're looking down on the tops of the letters in the title.  Here is an example using the title "Test Title", first as a 3D surface, and then again using the /t3d keyword to shade_surf.  Along the top of the 2D plot you can clearly see the z-axis and title rendered in a plane perpendicular to the plot plane.  Very strange behavior. Am I doing something wrong here?  Has anyone run into this problem and found a workaround?  I'd rather not have to calculate the position and use xyouts every time.   Thanks in advance for any help.   -Kris  

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 Oct 2008 01:25 PM
    Hi Kris, This is the behavior of SHADE_SURF. That said, the workaround with XYOUTS isn't bad. Given this approximation to your figure: IDL> window, 0 IDL> shade_surf, dist(40), title='IDL Graphics', ax=90, az=0 here are the reengineered steps to produce "on the glass" text: IDL> window, 1 IDL> shade_surf, dist(40), ax=90, az=0, zstyle=4 ; note I removed the z axis IDL> xyouts, 0.5, 0.95, 'IDL Graphics', alignment=0.5, /normal  Note that the coordinates given for XYOUTS should be fairly robust.  Regards, mp

    Deleted User



    New Member


    Posts:
    New Member


    --
    27 Oct 2008 12:23 PM
    Thanks for the reply, mp. I was afraid that was the case. The XYOUTS workaround isn't bad for a single plot. It becomes a bit tricky when you need a general solution that respects the !p.multi variable. Using the !x.window and !y.window variables is an acceptable solution assuming the xyouts call immediately follows the shade_surf call: xyouts,(!x.window[1]-!x.window[0])/2.+!x.window[0],!y.window[1]+.025*(!y.window[1]-!y.window[0]),title,/normal,alignment=0.5 The .025 scaling in the y position would certainly have to be changed if the charsize varied. For the default charsize, it seems to work. -Kris
    You are not authorized to post a reply.