x-axis labeling and legend issues

From: Cathryn Meyer (cathryn.meyer AT yale.edu)
Date: Mon Mar 21 2005 - 07:48:35 MST

  • Next message: Mary Haley: "Re: x-axis labeling and legend issues"

    Hello,

    I have been trying to make a 6-panel plot that consists of two columns
    and three rows of plots. I want to label the x-axis of only the bottom
    two plots, however I can't seem to get this to work out! I am having
    the same problem with the legend - I only want it at the bottom of all
    six plots, not below each plot. However I can only get the legend to
    appear if I specify it when the first plot is made (and therefore it
    gets placed under the first plot), not if I specify it when the 6th plot
    is made. Why is this? How can I get around this?

    The code I'm using to create the plots is:

    -----------------------------------------------------------------
        resources@tiMainString = "E Tropical"
        resources@tiMainFontHeightF = 0.04
        resources@trYReverse = True ; reverse Y-axis
        resources@tiYAxisString = "Pressure (mb)"
        resources@tiYAxisFontHeightF = 0.04
        resources@xyLineThicknesses = (/3.0,2.0,2.0,2.0,2.0/)
        resources@xyLineColors = (/"black","blue","red","blue","red"/)
        resources@xyDashPatterns = (/0.,0.,0.,16.0,16.0/)
        plots(0) = gsn_xy(wks,datatrop_E,lev,resources)
                                                                           
            
        resources@tiYAxisString = ""
        resources@tiMainString = "E Global"
        plots(1) = gsn_xy(wks,dataglobal_E,lev,resources)
                                                                           
            
        resources@tiYAxisString = "Pressure (mb)"
        resources@tiMainString = "AP0 Tropical"
        plots(2) = gsn_xy(wks,datatrop_AP0,lev,resources)
                                                                           
            
        resources@tiYAxisString = ""
        resources@tiMainString = "AP0 Global"
        plots(3) = gsn_xy(wks,dataglobal_AP0,lev,resources)
                                                                           
            
        resources@tiYAxisString = "Pressure (mb)"
        resources@tiXAxisOn = True ;turn on x axis
        resources@tiXAxisString = "Relative Humidity (%)"
        resources@tiXAxisFontHeightF = 0.04
        resources@tiMainString = "AP1 Tropical"
        plots(4) = gsn_xy(wks,datatrop_AP1,lev,resources)
                                                                           
            
       resources@pmLegendDisplayMode = "Always" ; turn on legend
       resources@xyExplicitLegendLabels =
    (/"Control","KEx2","KExhalf","warm","warm_KEx2"/)
        resources@tiYAxisString = ""
        resources@tiMainString = "AP1 Global"
        plots(5) = gsn_xy(wks,dataglobal_AP1,lev,resources)

      pres1 = True
      pres1@gsnFrame = False ; Don't advance the frame.
                                                                           
            
      gsn_panel(wks,plots,(/3,2/),pres1) ;Draw 3 rows and 2 columns of plots
    -----------------------------------------------------------------

    Thanks,
    Cathy

    -- 
    Cathryn Meyer
    Department of Geology and Geophysics
    Yale University
    cathryn.meyer@yale.edu
    (203)432-1959
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Mon Mar 21 2005 - 09:57:47 MST