Re: xy markers

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 3 Nov 2006 11:47:15 -0700 (MST)

On Fri, 3 Nov 2006, Keith Oleson wrote:

> On Fri, 3 Nov 2006, Mary Haley wrote:
>
>> Hi Keith,
>>
>> You can only have one type of marker per curve, and in your gsn_csm_xy
>> call below, it thinks you just have one curve, so it only uses one marker
>>
>> To make gsn_csm_xy see these as multiple curves, you need to give it
>> an ncurves x npts arrays, where ncurves will be 50, in your case,
>> and npts will be 1.
>>
>> I hope this will work as I'm not sure I've tried gsn_csm_xy with one-point
>> curves.
>>
>> Try this:
>>
>> riv_data!0 = "npts"
>> riv_data!1 = "ncurves"
>> ...
>> plot = gsn_csm_xy(wks,riv_data(ncurves | 0:49, npts | 1), \
>> riv_data(ncurves | 0:49, npts | 3),res)
>>
>
> Mary,
>
> This didn't work. I'm still getting ones. Maybe I should draw a plot with no
> data
> (although I'm not sure how to do this) and then use gsn_add_polymarker?
>
> Keith
>

Whoops, sorry, the code I gave you effectively collapsed your
2D array to a 1D array, so gsn_csm_xy thought you just had one
curve again. Try this:

    plot = gsn_csm_xy(wks,riv_data(ncurves | 0:49, npts | 1:1), \
                          riv_data(ncurves | 0:49, npts | 3:3),res)

The "1:1" syntax will force NCL not to collapse this dimension,
so this subset will become a 50 x 1 array.

If this still doesn't work, then yes, you can effectively draw a blank
plot and then use gsn_add_polymarker. Here's a kludgy way to do it
(there's an unadvertised gsn_blank_plot function, but it's not ready
for public consumption yet).

Untested:

   markers = NhlNewMarker(wks, mstring, fontnum, xoffset, yyoffset, \
                          ratio, size, angle)

   res = True
   res_at_gsnFrame = False
   res_at_gsnDraw = False
   res_at_xyLineColor = -1 ; transparent
   plot = gsn_csm_xy(wks,riv_data(1,0:49),riv_data(3,0:49),res)

   dum = new(50,graphic)
   mkres = True

   mkres_at_gsMarkerColor = "Blue"
   mkres_at_gsMarkerSizeF = 0.010

   do i=0,49
     mkres_at_gsMarkerIndex = markers(i)
     dum(i) = gsn_add_polymarker(plot,riv_data(1,i),riv_data(3,i),mkres)
   end do

   draw(plot)
   frame(wks)

--Mary

>> --Mary
>>
>>
>> On Fri, 3 Nov 2006, Keith Oleson wrote:
>>
>>> I would like to produce an xy plot where each data point is identified by
>>> a
>>> unique number (1-50). I thought the following would work but I get a plot
>>> where all of the datapoints are marked with a "1". Any ideas?
>>>
>>> condensed version:
>>>
>>> mstring = sprinti("%2.0i",ispan(1,50,1))
>>> fontnum = 21
>>> xoffset = 0.0
>>> yoffset = 0.0
>>> ratio = 1.0
>>> size = 1.0
>>> angle = 0.0
>>>
>>> res = True
>>> res_at_xyMonoMarkLineMode = True
>>> res_at_xyMarkLineMode = "Markers"
>>> res_at_xyMarkers = NhlNewMarker(wks, mstring, fontnum, xoffset,
>>> yoffset, ratio, size, angle)
>>>
>>> res_at_xyMonoMarkerColor = True
>>> res_at_xyMarkerColor = "Blue"
>>> res_at_xyMonoMarkerSize = True
>>> res_at_xyMarkerSizeF = 0.010
>>> plot = gsn_csm_xy(wks,riv_data(1,0:49),riv_data(3,0:49),res)
>>>
>>>
>>> thanks,
>>>
>>> Keith
>>>
>>> ____________________________________________________________________________
>>> Keith Oleson oleson_at_ucar.edu
>>> Terrestrial Sciences Section Work Phone: 303-497-1332
>>> Climate and Global Dynamics Division Fax: 303-497-1348
>>> National Center for Atmospheric Research Express mail: NCAR
>>> P.O. Box 3000 1850 Table Mesa
>>> Dr.
>>> Boulder, CO 80307 Boulder, CO 80305
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>
> --
> ____________________________________________________________________________
> Keith Oleson oleson_at_ucar.edu
> Terrestrial Sciences Section Work Phone: 303-497-1332
> Climate and Global Dynamics Division Fax: 303-497-1348
> National Center for Atmospheric Research Express mail: NCAR
> P.O. Box 3000 1850 Table Mesa Dr.
> Boulder, CO 80307 Boulder, CO 80305
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 03 2006 - 11:47:15 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 03 2006 - 11:48:28 MST