Re: problem using polymarkers

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 22 2010 - 11:05:14 MDT

Hi Juliane,
Can you send me your complete script so we can test it here? Thanks... Adam

On 07/21/2010 07:43 AM, Juliane Otto wrote:
> Hey again,
>
> thanks for your help. With the dummy example, I found out that the fonts
> are at least being recognized. In fact it turns out that it had to do
> with the resources used for the underlying map - here a bit of code,
> containing just the resources used
>
> resA = True
> resA@gsnDraw = False ; don't draw
> resA@gsnFrame = False ; don't advance frame
> resA@cnFillOn = True ; turn on color fill
> resA@gsnSpreadColors = True ; use full range of colors
>
> resA@cnLinesOn = False ; turn of contour lines
> resA@cnFillMode = "RasterFill" ; Raster Mode
> resA@cnLinesOn = False ; Turn off contour lines
> resA@lbLabelBarOn = False ; we will draw a common label
> bar for all experiments
> resA@cnLineLabelsOn = False ; Turn off contour lines
> resA@mpMinLatF = lat_min ; range to zoom in on
> resA@mpMaxLatF = lat_max
> resA@mpMinLonF = lon_min
> resA@mpMaxLonF = lon_max
>
>
> exp_plot = gsn_csm_contour_map_ce(wks, data , resA)
>
> gsres = True
> gsres@gsMarkerIndex = 1 ; new_indexes(0)
> gsres@gsMarkerColor = "black"
>
> dum_low(exp_loop) = gsn_add_polymarker(wks,exp_plot,lonpol,latpol,gsres)
>
> In fact resA@lbLabelBarOn = False ; we will draw a common
> label bar for all experiments
> is the culprit, in my case. All other resources are fine, but if you
> want to take away the colour-bar (to later panel the plots)
> the polymarker symbols suddenly change and the font-tables no longer work.
>
> So now I don't know how to simultaneously have the correct marker AND a
> panel of my plots without extra colourbars.
>
> But still I am closer to my goal than before!
>
>
>
> Adam Phillips wrote:
>> Hi Juliane,
>> Looking again at your query, I think my post from earlier will not help
>> you. The correct procedure for creating your own marker index and using
>> that new marker can be seen in the following example that was forwarded
>> to me:
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>
>> begin
>> wks = gsn_open_wks("x11","polyg") ; Open a workstation and
>>
>> mpres = True
>> mpres@gsnMaximize = True ; Maximize plot in frame.
>> mpres@gsnFrame = False ; Don't advance the frame
>> mpres@gsnDraw = False ; Don't advance the frame
>>
>> map = gsn_csm_map(wks,mpres)
>>
>> mstrings = (/"Z","x"/)
>> fontnums = (/37,1/)
>> xoffset = 0.0
>> yoffset = (/0.075,0.0/)
>> ratio = (/1.3125,1.0/)
>> sizes = (/1.5,1.4/)
>> angle = 0.0
>> new_indexes = NhlNewMarker(wks, mstrings, fontnums, xoffset, yoffset, \
>> ratio, sizes, angle)
>>
>> gsres = True
>> gsres@gsMarkerIndex = new_indexes(0)
>>
>> gsres@gsMarkerColor = "red"
>> gsres@gsMarkerThicknessF = 10.
>> dum1 = gsn_add_polymarker(wks,map,0.,0.,gsres)
>>
>> gsres@gsMarkerIndex = new_indexes(1)
>> gsres@gsMarkerColor = "blue"
>>
>> dum2 = gsn_add_polymarker(wks,map,0.,20.,gsres)
>> draw(map)
>> frame(wks)
>> end
>>
>> note specifically that gsMarkerIndex needs to be set to new_indexes(0)
>> or new_indexes(1). If you are following this procedure correctly, are
>> you receiving any error messages?
>> Adam
>>
>>
>> On 07/20/2010 08:51 AM, Juliane Otto wrote:
>>
>>> Hello NCL-people,
>>>
>>> I have a problem using polymarkers. They get displayed where I want them
>>> but the wrong marker (symbol) gets displayed. I have tried both using the
>>> pre-defined markers e.g.
>>> gres@gsMarkerIndex = 14 ; new_indexes(1)
>>>
>>> and creating my own. e.g.
>>> mstrings = (/"Z","x"/)
>>> fontnums = (/37,1/)
>>> xoffset = 0.0
>>> yoffset = (/0.075,0.0/)
>>> ratio = (/1.3125,1.0/)
>>> sizes = (/1.5,1.4/)
>>> angle = 0.0
>>>
>>> new_indexes = NhlNewMarker(wks, mstrings, fontnums, xoffset, yoffset,
>>> ratio, sizes, angle)
>>>
>>> I think the problem has to do with the font tables. All font tables that I
>>> want to use lie under the NCARG_ROOT, but it seems like just the default
>>> font table is being recognised.
>>> Does anyone know how to sort out this problem?
>>> I am using ncl-5.1.1.
>>>
>>> Thanks a lot in advance
>>> Juliane
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 22 11:05:21 2010

This archive was generated by hypermail 2.1.8 : Wed Jul 28 2010 - 10:42:06 MDT