[ncl-talk] Multi-faceted question about multiple contour overlays, not WRF data
Alan Brammer
abrammer at albany.edu
Fri Jul 29 08:00:44 MDT 2016
Others may have different preferences or insights on this.
IMO, the easiest way is to create the plots as you have.
Then create a blank map e.g. map = gsn_csm_map(wks, map_resources)
then go through and use overlay(); I can’t tell which plots are which for you so pseudo example here:
overlay(map, shaded_plot)
overlay(map, contour_plot)
overlay(map, next_contour_plot)
draw(map)
frame(wks)
Although this is a little longer than using one of the combined functions, it means your resources can all be distinct for each aspect of the plot.If you want to remove any layer you can just comment out the overlay line without any other changes.
Also, this is all gsn_csm_contour_map_overlay() is doing,
from that function
…
contour2 = gsn_contour(wks,datanew,res2_tmp)
overlay(contour1,contour2)
….
As for your errors, gsn_csm_contour_map_overlay() wants args 1,2 to be numeric data not graphic objects.
> plot = gsn_csm_contour_map_overlay(wks,fill_pv,contour_psl,opts,opts2)
should be
> plot = gsn_csm_contour_map_overlay(wks, pv300, slp,opts,opts2)
Hope that helps,
Alan
##############################
Alan Brammer,
Post-Doc Researcher
Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer at albany.edu
##############################
> On 29 Jul 2016, at 01:21, Ryan Connelly <rconne01 at gmail.com> wrote:
>
> I have a RAP file which I converted to netCDF.
>
> I want to plot three variables (one filled, two contoured) over a map. This can be done rather easily with the wrf_map_overlays function for WRF-ARW data, but it doesn't seem there is an equivalent function for non-WRF data. My current plan is to use gsn_csm_contour_map_overlays for the first two, then take that plot and the use overlay for the third. Will this work? Is there a better way? The documentation makes it seem that gsn_csm_contour_map can only handle two datasets at a time.
>
> In doing this, I get two main errors:
>
> The first is that all of my map plotting options are not valid. I made sure that the opts for just the first variable in gsn_csm_contour_map had the map plotting options, since that's what the documentation says to do.
>
> The second is this:
>
> fatal:Argument type mismatch on argument (1) of (gsn_csm_contour_map_overlay) can not coerce
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 190 in file rap_fgen_1.ncl
>
> Here's a code snippet:
>
> ; Plotting options for fgen
> opts3 = True
> [...]
> contour_fgen = gsn_csm_contour(wks,pett_fgen,opts3)
>
>
> ; Plotting options for pv
> opts = mpres
> [...]
> fill_pv = gsn_csm_contour(wks,pv300,opts)
>
>
> ; Plotting options for SLP
> opts2 = True
> [...]
> contour_psl = gsn_csm_contour(wks,slp,opts2)
>
>
> ; MAKE PLOTS
> plot = gsn_csm_contour_map_overlay(wks,fill_pv,contour_psl,opts,opts2)
> overlay(plot,contour_fgen)
>
>
> Thank you in advance!
> Ryan
>
> --
> Ryan Connelly
> M.S. Student in Atmospheric Sciences, Stony Brook University
> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso University
> rconne01 at gmail.com <mailto:rconne01 at gmail.com>
> ryan.connelly at stonybrook.edu <mailto:ryan.connelly at stonybrook.edu>_______________________________________________
> 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/20160729/c399e99f/attachment.html
More information about the ncl-talk
mailing list