Re: Vector overlay on a Hovmoeller Diagram

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 22 2013 - 08:28:05 MST

Dear Yu,

You are on the correct path. Usually when "overlay" fails to work properly, the first thing I check is that both plots are in the same "data space".

That is, ranges of both X and Y axes must intersect at some point, otherwise you will be trying to overlay data in two different data spaces, and the overlay plot simply won't show up.

I check the data space of both plots using two methods:

1. Draw the individual plots before you overlay them to see what their X and Y axes ranges look like.

    You can do this simply by commenting out the gsnFrame and gsnDraw resource settings.

2. Use printVarSummary to see what the coordinate arrays, if any, look like:

printVarSummary( sst(:,{120:280}))
printVarSummary(u(:,{120:280}),v(:,{120:280}))

Please note that a gsn_csm_hov plot assumes that you are plotting time versus longitude. I don't know what your "sst" variable looks like, but the printVarSummary should help.

--Mary

On Nov 22, 2013, at 12:01 AM, Yu Cheng <fischcheng@gmail.com> wrote:

> Hi everyone,
> I’m trying to overlay wind-stress vectors on a SST Hovmoeller Diagram. First, I couldn’t find any examples or function to do the trick, then I thought of overlaying a simple gsn_vector on to a Hovmoeller. But the vectors just couldn’t show up. I tried to change overlay order, still didn’t work. Please give me some hints how that could be solved. Thanks.
>
>
> Cheers,
> Yu
>
> hereby is my plotting scripts:
>
> wks = gsn_open_wks ("ps", "sst.ano.vec" ) ; open ps file
> gsn_define_colormap(wks,"nrl_sirkes") ; choose colormap
>
> res = True ; plot mods desired
> res@cnFillOn = True ; turn on color fill
> ; res@cnLinesOn = False ; turn on color fill
> res@gsnSpreadColors = True ; use full range of colors
> res@gsnDraw = False ; don't draw
> res@gsnFrame = False ; don't advance frame
> res@cnFillOpacityF = 0.2
>
> res@tiMainString = "Annual Deviation of SST" ; title
> res@gsnLeftString ="5S-5N 1993-2012"
>
> res@cnLevelSelectionMode = "ManualLevels" ; manual contour levels
> res@cnMinLevelValF = -3. ; min level
> res@cnMaxLevelValF = 3. ; max level
> res@cnLevelSpacingF = 0.5 ; contour level spacing
> ; res@trYReverse = True
> res@tmYLMode = "Explicit"
> res@tmYLValues = time
> res@tmYLLabels = (/"JAN","FEB","MAR" ,"APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"/)
> plot = gsn_csm_hov(wks, sst(:,{120:280}), res)
>
> vres = True ; plot mods desired
> vres@gsnDraw = False ; don't draw
> vres@gsnFrame = False ; don't advance frame
> vres@vcRefMagnitudeF = 20. ; add a reference vector
> vres@vcRefLengthF = 0.045 ; what the ref length is
> vres@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
>
> plot_ov = gsn_csm_vector(wks,u(:,{120:280}),v(:,{120:280}),vres)
> overlay(plot,plot_ov)
> draw(plot)
> frame(wks)
>
>
> Sent with Unibox
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 22 08:28:17 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 22 2013 - 09:36:32 MST