Re: tick mark for Lambert plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 07 2011 - 08:19:38 MST

Hi Mark,

To use add_map_tickmarks, you first want to call your plotting routine as usual, and then call add_map_tickmarks *with a new resource list*. You don't want to use the same resource list that you used to create the contours over the map. This is why you were getting the error with "cnFillOn". The add_map_tickmark routine is only for adjusting the map, so it doesn't recognize any contour resources.

Right now you have:

;---Create the map, but don't draw it yet.
  map = gsn_csm_map(wks,res)

;---Attach the new map tickmarks.
  map = add_map_tickmarks(wks,map,res)

and then later you have:

   map = gsn_csm_contour_map(wks,data,res)
   plot = gsn_csm_contour_map(wks,data,res)
  plot = ColorNegDashZeroPosContour(plot,"red","red","blue")
   delete(data)

I'm not sure why you have two calls to gsn_csm_contour_map, but you only need one. Also, the first call to gsn_csm_map is not necessary, since you are creating the map later with gsn_csm_contour_map.

Try removing or commenting out these lines:

;---Create the map, but don't draw it yet.
  map = gsn_csm_map(wks,res)

;---Attach the new map tickmarks.
  map = add_map_tickmarks(wks,map,res)

Remove this line:

   map = gsn_csm_contour_map(wks,data,res)

and then after these lines:

   plot = gsn_csm_contour_map(wks,data,res)
  plot = ColorNegDashZeroPosContour(plot,"red","red","blue")

Add these lines:

  tmres = True
  tmres@tmXBValues = ispan(0,30,10) ; bottom labels
  tmres@tmYLValues = ispan(35,60,5) ; right labels
  tmres@tmXTValues = tmres@tmXBValues ; use the same values as bottom
  tmres@tmYRValues = tmres@tmYLValues ; use same values as left
  tmres@tmXBLabelFontHeightF = 0.01
  plot = add_map_tickmarks(wks,plot,tmres)

You will need to set the tmXXValues resources to whatever values you want for tickmarks and labels on both sets of axes. Note that your bottom and top axes are going to be very different because of the projection you're using. You may not want to use the same labels on the top and bottom.

The "maximize_output" call that you have at end will draw everything.

--Mary

On Mar 6, 2011, at 4:06 PM, Mark Chan wrote:

> NCL users,
>
> The attached file is a NCL scripts and a plot made by this script. Can one help
> put the tick mark on the same longitude on top and bottom?
> In addition, why is there the warning message as: "warning:cnFillOn is not a
> valid resource in map at this time", since if "cnFillOn" is commented out, there
> will be no color filled.
> Thanks a lot!
>
> Mark
>
>
>
> <NCL_question1.PNG><Europe_Lambert.ncl>_______________________________________________
> 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
Received on Mon Mar 7 08:19:46 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 07 2011 - 15:20:57 MST