[ncl-talk] Unable to overlay
Mary Haley
haley at ucar.edu
Fri Jul 13 14:37:50 MDT 2018
Geeta,
You can't create two contour/map plots and overlay one on the other. You
can only overlay contour plots or vector plots on a map.
I think all you need to do is change this line:
plot_q(deltaT) = gsn_csm_contour_map(wks,Q_flt(deltaT,lev,:,:),resq)
to:
plot_q(deltaT) = gsn_csm_contour(wks,Q_flt(deltaT,lev,:,:),resq)
which turns it into a contour plot.
You may want to visit the overlays examples page for some help
understanding overlays:
http://www.ncl.ucar.edu/Applications/overlay.shtml
--Mary
On Wed, Jul 11, 2018 at 10:55 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:
> Hi.
> I need 3 variables in one plot. these are wind speed (shaded contours),
> wind vectors and specific humidity (Q_flt).
> I am able to overlay two but the third one does not get overlaid. I have
> tried the function gsn_csm_contour_overlay
>
> Can U pls help me. attaching my code
> ; ---------------Plot the wind speed Filled Contours and Specific
> humidity
>
> base(deltaT) = gsn_csm_contour_map(wks,wndspd,res)
> plot_q(deltaT) = gsn_csm_contour_map(wks,Q_flt(deltaT,lev,:,:),resq)
>
> ; tried both with gsn_csm_contour and gsn_csm_contour_map
> india_id(deltaT) = gsn_add_shapefile_polylines(
> wks,base(deltaT),IND_shape_fname,shpres)
> ; overlay(base(deltaT),plot_q(deltaT))
>
>
> DCC_WCC = storms_file
> TSTR_DCC_WCC = asciiread(DCC_WCC,-1,"string")
> print(TSTR_DCC_WCC)
> LATC_DCC_WCC = stringtofloat(str_get_field(
> TSTR_DCC_WCC,1,delim))
> LONC_DCC_WCC = stringtofloat(str_get_field(
> TSTR_DCC_WCC,2,delim))
> add_DCC_WCC(deltaT) = gsn_add_polymarker(wks,base(
> deltaT),LONC_DCC_WCC,LATC_DCC_WCC,RES_MARK_DCC_WCC)
> ;:::: Vector wind ::::::::
>
> plot(deltaT) = gsn_csm_vector(wks,U_flt(
> deltaT,lev,:,:),V_flt(deltaT,lev,:,:),res_vc)
>
> overlay(base(deltaT),plot(deltaT))
>
>
>
> draw(base)
> frame(wks)
> end do
>
>
> panelres = True
> gsn_panel(wks,base,(/2,2/),True)
>
> Geeta.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180713/667d2acd/attachment.html>
More information about the ncl-talk
mailing list