[ncl-talk] Overlay streamlines on streamlines
Will Hobbs
will.hobbs at utas.edu.au
Tue Dec 15 20:42:23 MST 2015
Jiali
I cannot see anything in your code or in the streamlinePlort class documentation (https://www.ncl.ucar.edu/Document/HLUs/Classes/StreamlinePlot.shtml) that explains why you are not getting the expected output (although someone else might know better).
I would suggest that you do one or both of the following:
1. Try and plot both plots separately (i.e. without the overlay), just to check that there's nothing wrong in the input data.
2. Try and retain the coordinate data when you average both data files (i.e. use dim_avg_n_Wrap()); this will ensure that both plots have the same plot domain.
Will
From: <Wang>, Jiali <jialiwang at anl.gov<mailto:jialiwang at anl.gov>>
Date: Wednesday, 16 December 2015 10:20 AM
To: "ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>" <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>
Subject: [ncl-talk] Overlay streamlines on streamlines
Dear NCL help,
I am trying to make a plot with one set of streamline overlaid on another set of streamline. But I was not able to figure it out. I can only get the first set of streamline (as attached).
I copy the main part of my code below. Could you please take a look and give advice? Thanks for your time! -Jiali
=====================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f = addfile("uv10m_01deg_daily_1995.nc","r")
u = f->U10(:,200:300,500:600)
v = f->V10(:,200:300,500:600)
u10 = dim_avg_n(u,0)
v10 = dim_avg_n(v,0)
f1 = addfile("uv10m_01deg_daily_2004.nc","r")
u1 = f1->U10(:,200:300,500:600)
v1 = f1->V10(:,200:300,500:600)
u11 = dim_avg_n(u1,0)
v11 = dim_avg_n(v1,0)
wks = gsn_open_wks("ps","stream_1995_2004") ; open a ps file
res1 = True ; plot mods desired
res1 at gsnDraw = False
res1 at gsnFrame = False
res1 at stLineColor = "orange" ; changes color
res2 = True ; plot mods desired
res2 at gsnDraw = False
res2 at gsnFrame = False
res2 at stLineColor = "black"
plot_1 = gsn_csm_streamline(wks,u10,v10,res1)
plot_2 = gsn_csm_streamline(wks,u11,v11,res2)
overlay(plot_1,plot_2)
draw(plot_1)
frame(wks)
end
====================================
Jiali Wang, Ph. D
Environmental Science Division
Argonne National Laboratory
Tel: 630-252-2848
http://www.evs.anl.gov/about-evs/staff/detail/index.cfm?/Wang/Jiali
University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151216/fb5451b9/attachment.html
More information about the ncl-talk
mailing list