Re: Contour plot with no axes ticks

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 08 2010 - 10:54:56 MST

Ekin,

You didn't mention it, but I assume you got an error when you ran
this script?

You are using 2D arrays for your X and Y coordinate values. This
means potentially that your 2D data grid is not "nice" and linear,
and thus, NCL can't assume that a linear axis system will represent
your data correctly. In this case, then, it turns off the tickmarks.

If your data *is* on a "nice" grid, and you want to force the
tickmarks, then see example 4 at:

http://www.ncl.ucar.edu/Applications/barb.shtml

This shows how to create a "loglin" plot (log-linear) which will get
you the tickmarks you need.

In your case, the last part of your code might look like this:

  plot = gsn_contour(wks,phyto(0:19,0:99),res) ; create plot
  genCmapMnMxSpan (wks, plot, "Blue" , "Red") ; choose color map

   getvalues plot ; get the X/Y axis min/max
for use in the loglin plot
     "trXMinF" : trxmin
     "trXMaxF" : trxmax
     "trYMinF" : trymin
     "trYMaxF" : trymax
   end getvalues

   loglin = create "logling" logLinPlotClass wks ; draw a loglin
plot, with expanded X/Y axis
     "trXMinF" : trxmin
     "trXMaxF" : trxmax
     "trYMinF" : trymin
     "trYMaxF" : trymax
     "trYReverse" : True
   end create
   overlay(loglin,plot) ; overlay plot with the loglin plot
   draw(loglin) ; draw the plot
   frame(wks) ; advance the frame

--Mary

On Mar 8, 2010, at 5:00 AM, Ekin Akoglu wrote:

> Dear All,
>
> I draw a contour plot but it does not put tick marks on both x and
> y axes. The code and the resulting figure in eps are attached.
> Could you please help me what is wrong with the code?
>
> Regards,
>
> --
> Ekin Akoglu
>
> Institute of Marine Sciences
> Middle East Technical University
> P.O. Box 28, 33731
> Erdemli, Mersin
> Turkey
>
> Web: www.ims.metu.edu.tr
> Email: ekin@ims.metu.edu.tr
> Phone: +90 324 521 34 34
> GSM: +90 506 554 03 90
> <cont.ncl><ocean.eps>
> _______________________________________________
> 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 8 10:55:39 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 08 2010 - 12:07:42 MST