[ncl-talk] panel plot, each with their own colormap

Laura Fowler laura at ucar.edu
Fri Aug 3 14:36:09 MDT 2018


Hello:

I followed panel_26.ncl to create 3 panels plots below each other, each set
with their own colormap (see attached file totPREC.dec2015.png). Now, I
would like to do the same thing, but with only one TMPA map centered at the
top of the figure (see tentative figure test.png).


For both the 6 and 5 panel plots, I used:

resP                  = True

resP at gsnMaximize      = True

resP at gsnDraw          = False

resP at gsnFrame         = False

resP at gsnPanelLabelBar = True


pplots = gsn_panel_return(wks,plots(0:1),(/1,2/),resP)

bb     = NhlGetBB(pplots)

height = max(bb(0:1,0)) - min(bb(0:1,1))

print("--- bb(0)  = "+bb(0:1,0))

print("--- bb(1)  = "+bb(0:1,1))

print("--- height = "+height)


;--- using height value, now we can panel all sets of plots:

resP at gsnDraw        = True

resP at gsnMaximize    = True

resP at gsnPanelTop    = 1.0

resP at gsnPanelBottom = resP at gsnPanelTop - height


For the 6 panel plot, I used the loop:

do n = 0,nplots-1,2

   gsn_panel(wks,plots(n:n+1),(/1,2/),resP)


;---Set for the next panel call.

   resP at gsnPanelMainString = ""

   resP at gsnPanelTop        = resP at gsnPanelBottom - 0.02

   resP at gsnPanelBottom     = resP at gsnPanelTop-height

end do

frame(wks)


wheres for the 5 panel plot, I used the loop:

do n = 0,nplots-1,2

   print("--- n = "+n)

   if(n .eq. 0) then

      gsn_panel(wks,plots(0:0),(/1,1/),resP)

   else

      gsn_panel(wks,plots(n-1:n),(/1,2/),resP)

   end if

   resP at gsnPanelMainString = ""

   resP at gsnPanelTop        = resP at gsnPanelBottom - 0.02

   resP at gsnPanelBottom     = resP at gsnPanelTop-height

end do

frame(wks)


I do not understand why the second plot of the second column is so much
bigger than the one on the left side and the two plots for the third row?
Can somebody help me figure this out?


Many thanks,
Laura


-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler

Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180803/184fe1e6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: totPREC.dec2015.png
Type: image/png
Size: 365149 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180803/184fe1e6/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 363189 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180803/184fe1e6/attachment-0003.png>


More information about the ncl-talk mailing list