Re: markers on paneled plots

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 14 2014 - 11:19:52 MDT

Hi Mary,
I think I see the issue.. Here's a shortened version of your code:
dc8dum = new(ndc8_min,"graphic")
......
plots(0) = wrf_map_overlays(a,wks,(/contour_0/),pltres,mpres)
plots(1) = wrf_map_overlays(a,wks,(/contour_1/),pltres,mpres)
...
do im = 0,ndc8_min-1
      gsres@gsMarkerColor = colors(imcl)
      gsres@gsMarkerSizeF = 0.008
      dc8dum(im) =
gsn_add_polymarker(wks,plots(0),dc8_lon(im),dc8_lat(im),gsres)

      gsres@gsMarkerIndex = 4 ; 8=upward triangle;
4=open circle; 16=filled dots for markers.
      gsres@gsMarkerThicknessF = 1.0
      gsres@gsMarkerSizeF = 0.010
      delete(gsres@gsMarkerColor)
      gsres@gsMarkerColor = "black" ; outline
circle in black
      dc8dum(im) =
gsn_add_polymarker(wks,plots(0),dc8_lon(im),dc8_lat(im),gsres)
      delete(gsres@gsMarkerColor)
end do
gsn_panel(wks,(/plots/),(/2,1/),pnlres)

When calling gsn_add_polymarker, you have to save the output graphic
array until the plot is actually drawn and framed. In the above coding
you are overwriting dc8dum due to the 2nd gsn_add_polymarker call..

Try changing to this:
dc8dum = new(ndc8_min,"graphic")
dc8dum2 = new(ndc8_min,"graphic")
dc8dumA = new(ndc8_min,"graphic")
dc8dum2A = new(ndc8_min,"graphic")
......
plots(0) = wrf_map_overlays(a,wks,(/contour_0/),pltres,mpres)
plots(1) = wrf_map_overlays(a,wks,(/contour_1/),pltres,mpres)
...
do im = 0,ndc8_min-1
      ...
      dc8dum(im) =
gsn_add_polymarker(wks,plots(0),dc8_lon(im),dc8_lat(im),gsres)
      dc8dumA(im) =
gsn_add_polymarker(wks,plots(1),dc8_lon(im),dc8_lat(im),gsres)
      ...
      dc8dum2(im) =
gsn_add_polymarker(wks,plots(0),dc8_lon(im),dc8_lat(im),gsres)
      dc8dum2A(im) =
gsn_add_polymarker(wks,plots(1),dc8_lon(im),dc8_lat(im),gsres)
end do
gsn_panel(wks,(/plots/),(/2,1/),pnlres)

I bet that solves the issue of not getting filled polymarkers and gets
the polymarkers on both plots. If not, please respond to ncl-talk..
Adam

On 03/13/2014 05:21 PM, Mary Barth wrote:
> Hi there,
>
> I've been working on a somewhat complicated plot to compare model
> results from two simulations to aircraft observations.
>
> The steps of the script are to
> 1. read aircraft data -- I use ncl/6.2.0 to read icartt files
> 2. read model results from two simulations
> 3. contour and plot model results
> 4. add polymarkers of aircraft data
> 5. panel the two plots
> 6. calculate difference of two model simulations
> 7. add difference plot as 3rd plot of frame
>
> In the past, I have successfully plotted aircraft data onto model
> results for a single plot (e.g.
> /glade/p/mmm/barthm/NCL/DC3/CO_1.5km_obs_05-29_YSUctrl.ps ) and I like
> the result.
>
> For the panel plot, I followed
> https://www.ncl.ucar.edu/Applications/Scripts/polyg_9.ncl as an example.
>
> It's important for my markers to have both a color fill and a black
> outline of the markers (as shown in CO_1.5km_obs_05-29_YSUctrl.ps). So,
> I plot first MarkerStyle=16 and vary the color and then MarkerStyle=4.
> like is done in newcolor_4.ncl . For the panel plot, I get only the open
> circles plotted (i.e. the second gsn_add_polymarker call).
>
> How can I get both color fill and open circles onto the paneled plot?
>
> I would also like to get the aircraft data on both the first two plots.
> Can I simply add a gsn_add_polymarker call pointing to the second plot,
> or do I need to use different resources, or put in another loop?
>
> My script is: /glade/p/mmm/barthm/NCL/DC3/var_compare2sims_obs.ncl
>
> and the current output is: VARgas_ctrl_aqmeii_05-29.ps in the same directory
>
> Thanks for any help,
> Mary
>

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/staff/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 14 11:20:06 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT