[ncl-talk] Plotting several variables into one Hovmuller plot

Adam Phillips asphilli at ucar.edu
Wed Sep 12 15:54:07 MDT 2018


Hi Toni,
The overlay procedure allows you to overlay as many plots as you want on
one base plot.  Here's an example from a script of mine:
map_n34sc_jja0 = gsn_csm_contour_map(wks_n34sc,n34sc_sst(6,:,:),scres)    ;
6 = JJA 0
o1 = gsn_csm_contour(wks_n34sc,n34sc_tas(6,:,:),scres2)
o2 = gsn_csm_contour(wks_n34sc,n34sc_psl(6,:,:),scres3)
overlay(map_n34sc_jja0,o1)
overlay(map_n34sc_jja0,o2)
draw(map_n34sc_jja0)
frame(wks)

When you say it did not work correctly, can you elaborate?

Also, if you are paneling, and the exact location of each plot from one
frame to the next is not changing, you can try the following:

panres = True
panres at gsnFrame = False

gsn_panel(wks,grass,(/2,2/),panres)
gsn_panel(wks,shrubs,(/2,2/),panres)
gsn_panel(wks,trees,(/2,2/),panres)
frame(wks)

This will overlay the 3 sets of panel plots, titles and all. You would want
to alter the opacity of the colors for the two overlaid plots.
Hope that helps!
Adam

On Wed, Sep 12, 2018 at 11:51 AM Toni Klemm <toni-klemm at tamu.edu> wrote:

> Hello!
>
> I emailed earlier (see below) about a complex graphics problem, plotting 3
> variables in one Hovmueller plot and then four Hovmueller plots into one
> panel (I didn’t mention the panel). After some offline advice I tried
> gsn_attach_plots and overlay, but unfortunately neither worked.
>
> gsn_attach_plots only plotted the charts connected along the X *or* Y
> axis, but not both at the same time (so that they would basically be on top
> of each other). overlay only allowed me to overlay 2 plot, but I needed 3.
>
> My laborious solution was creating 3 sets of panel plot, one for each of
> the 3 variables, separately in NCL, and then layering them on top of each
> other in Photoshop and removing the white space in the plots so that the
> underlying layer becomes visible. I also rearranged the color bars and
> named them.
>
> I attached a sample plot. If anyone knows how to automate all of this in
> NCL, I would be very grateful.
>
> Thanks in advance,
> Toni
>
>
> *Toni Klemm**, Ph.D.*
> Postdoctoral Research Associate
> Department of Ecosystem Science and Management
> College of Agriculture and Life Sciences
> Texas A&M University, College Station, TX
> Contributor to the Early Career Climate Forum <https://www.eccforum.org/>
> www.toni-klemm.de | @toniklemm <https://twitter.com/ToniKlemm>
>
>
>
>
>
> On Sep 10, 2018, at 6:50 PM, Toni Klemm <toni-klemm at tamu.edu> wrote:
>
> Hello!
>
> I’m trying to plot three variables, percentages of land cover of grasses,
> shrubs, and trees, into one Hovmueller plot (gsn_csm_hov
> <https://www.ncl.ucar.edu/Applications/time_lon.shtml>, longitude vs.
> years). I have the data arranged such that each grid point will only show
> one land cover type, namely the one with the largest percentage. In
> principle, this is similar to the seasonal tercile forecasts by the US
> Climate Prediction Center
> <http://www.cpc.ncep.noaa.gov/products/predictions/long_range/lead14/index.php> that
> show the likelihood for above, below, and near normal temperature (see the
> map attached). The difference in my case is I need to plot time vs.
> longitude, not latitude vs. longitude.
>
> I would appreciate any help for integrating three variables into one plot.
> Each variable will also need its own legend (like in the map).
>
> Thank you very much!
>
> Toni
>
>
>
> *Toni Klemm, Ph.D.*Postdoctoral Research Associate
> Department of Ecosystem Science and Management
> College of Agriculture and Life Sciences
> Texas A&M University, College Station, TX
> Contributor to the Early Career Climate Forum <http://www.eccforum.org/>
> www.toni-klemm.de | @toniklemm <http://twitter.com/toniklemm>
>
>
>
> <off15_temp.gif>
>
>
>
> <Screen Shot 2018-09-10 at 6.28.47 PM.png>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/2054c718/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rcp_45_fs_CCSM4_VTYPE_percentage_HOV_3_groups_GST_terciles_zone_0-3.png
Type: image/png
Size: 112417 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/2054c718/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rcp_45_fs_CCSM4_VTYPE_percentage_HOV_3_groups_GST_terciles_zone_0-3.png
Type: image/png
Size: 112417 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180912/2054c718/attachment-0001.png>


More information about the ncl-talk mailing list