Re: Adding Marker on line

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 14 May 2008 17:13:51 -0600 (MDT)

Louis,

This one is a bug.

To fix, you can directly edit
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl, then search for the
line:

   res3_new = True ; Make sure this is True.

and add right after it:

   res3_new_at_xyMarkLineMode = "Lines" ; Make sure not markers!

If you can't directly edit this file, then you can make a personal
copy of it, change your personal copy, and then load this file
instead.

(Thanks for sending me your data.)

--Mary

On Wed, 7 May 2008, louis Vonder wrote:

> Ncl users,
>
> Here attached a script I am using to plot xy_3 (i.e. one x-axis and three
> y-axis).
> I am trying to build my own legend, but I dont know how to add markers on
> lines.
>
> Secondly, markers appear on my third y-axis, I dont know why?
>
> Thanks for help
>
>
>
> ;*****************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ;*****************************************************
> begin
> ; Create variables to contain data.
> ;
>
> data = asciiread("SMT", (/48, 6/), "float")
>
> xyz = new((/48, 3/), "float")
>
>
> u = data(:, 0)
> v = data(:, 1)
> t = data(:, 2)
>
> lon = fspan(1, 48, 48)
>
>
> wks = gsn_open_wks("eps","xy") ; Open an X11 workstation.
>
> res1 = True
> res2 = True
> res3 = True
>
>
> ; res1_at_tmXUseBottom = False ; Keep top axis independent of bottom.
> ; res1_at_tmXTLabelsOn = True ; have tick mark labels
> ; res1_at_tmXTOn = True ; have tick marks
>
>
> res1_at_tmXUseBottom = False ; Keep top axis independent of bottom.
> res1_at_tmXBLabelsOn = True ; have tick mark labels
> res1_at_tmXTOn = False ; have tick marks
>
>
> res1_at_tmXBMode = "Explicit" ; label independently
> res1_at_tmXBValues = (/2, 8, 14, 20, 26, 32, 38, 44/)
> res1_at_tmXBLabels = (/"12", "15", "18", "21", "00", "03", "06",
> "09"/)
>
>
>
> res1_at_gsnDraw = False ; don't draw yet
> res1_at_gsnFrame = False ; don't advance frame yet
>
>
> res1_at_vpHeightF = 0.4 ; change aspect ratio of plot
> res1_at_vpWidthF = 0.7
>
>
>
> res1_at_gsnMaximize = True
> res1_at_trXMaxF = max(lon) ; Control end of X axis
> res1_at_trXMinF = min(lon) ; Control end of X axis
>
> res1_at_tmXBLabelFontHeightF = 0.015
> res2_at_tmXBLabelFontHeightF = 0.015
> res3_at_tmXBLabelFontHeightF = 0.015
>
>
> res1_at_xyLineColor = "black" ; t
> res2_at_xyLineColor = "black" ; u
> res3_at_xyLineColor = "black" ; v
>
> res1_at_xyLineThicknesses = 3.0
> res2_at_xyLineThicknesses = 3.0
> res3_at_xyLineThicknesses = 3.0
>
> res1_at_xyDashPattern = 0.
> res2_at_xyDashPattern = 2.
>
> pattern3 = "$$$$______$$$$______$$$$______$$$$_____$$$$______"
>
> res3_at_xyDashPatterns = NhlNewDashPattern(wks, pattern3)
>
>
> res1_at_tiYAxisString = "t"
> res2_at_tiYAxisString = "u"
> res3_at_tiYAxisString = "v"
>
> res3_at_amOrthogonalPosF = 0.7 ; Move "v" axis line to right a little.
>
>
> res1_at_xyDashPattern = 0 ; Make curves all solid
> res1_at_xyMarkLineMode = "MarkLines" ; Markers *and* lines
> res1_at_xyMarkers = (/6/) ; 3 different markers
> res1_at_xyMarkerColors = (/"black"/) ; 3 different colors
> res1_at_xyMarkerSizeF = 0.01
>
> res2_at_xyDashPattern = 0 ; Make curves all solid
> res2_at_xyMarkLineMode = "MarkLines" ; Markers *and* lines
> res2_at_xyMarkers = (/11/) ; 3 different markers
> res2_at_xyMarkerColors = (/"black"/) ; 3 different colors
> res2_at_xyMarkerSizeF = 0.01
>
> res3_at_xyDashPattern = 0 ; Make curves all solid
> res3_at_xyMarkLineMode = "MarkLines" ; Markers *and* lines
> res3_at_xyMarkers = (/16/) ; 3 different markers
> res3_at_xyMarkerColors = (/"black"/) ; 3 different colors
> res3_at_xyMarkerSizeF = 0.01
>
> ; Set up resources for a customized legend.
> ;
>
> labels = (/"t","u","v"/)
> nitems = dimsizes(labels) ; number of legend items
>
>
>
>
>
> plot = gsn_csm_xy3(wks, lon, t, u, v, res1, res2, res3)
> draw(plot)
>
> ; Manually create legend
> ;*****************************************************
> res_text = True ; text mods desired
> res_text_at_txFontHeightF = 0.015 ; change text size
> res_text_at_txJust = "CenterLeft" ; text
> justification
>
> res_lines = True ; polyline mods
> desired
>
> res_lines_at_gsLineDashPattern = 0. ; solid line
> res_lines_at_gsLineThicknessF = 5. ; line thicker
> res_lines_at_gsLineColor = "black" ; line color
> xx = (/2, 5/)
> yy = (/44, 44/)
>
> gsn_polyline(wks,plot, xx, yy, res_lines) ; add polyline
> gsn_text(wks,plot,"t", 6, 44, res_text); add text
> delete(xx)
> delete(yy)
>
> xx = (/2, 5/)
> yy = (/42, 42/)
> gsn_polyline(wks,plot, xx, yy, res_lines) ; add polyline
> gsn_text(wks,plot,"u", 6, 42, res_text); add text
> delete(xx)
> delete(yy)
>
> xx = (/2, 5/)
> yy = (/40, 40/)
> gsn_polyline(wks,plot, xx, yy, res_lines) ; add polyline
>
> gsn_text(wks,plot,"v", 6, 40, res_text); add text
>
>
>
>
> frame(wks) ; advance frame
>
>
> end
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> En finir avec le spam? Yahoo! Mail vous offre la meilleure protection
> possible contre les messages non sollicités
> http://mail.yahoo.fr Yahoo! Mail
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 14 2008 - 17:13:51 MDT

This archive was generated by hypermail 2.2.0 : Thu May 15 2008 - 09:09:08 MDT