[Thread Prev][Thread Next][Index]

Re: [ferret_users] irregularly decreasing x-axis



Hi Sujata,
Ferret doesn't allow coordinate axes with decreasing values. You can reverse both the coordinates and the data representing your variable with the XREVERSE function. Then define an axis from the reversed coordinates. Finally we can plot the data in such a way that the axis will look reversed.

  file/var="xin,pin" test.dat
  let xcor = xreverse(xin)
  let rev_p = xreverse(pin)

  define axis/x xax = xcor   ! this is an alternate syntax for def axis/from_data
  let power = rev_p[gx=xax@asn]

  plot/line/symbol=20/nolab power

  ! Now we can use the /hlimits qualifier to reverse the axis on the plot

  plot/line/sym=20/nolab/hlim=32:0.5 power

-Ansley

On 8/24/2012 2:39 AM, Sujata Mandke wrote:
Dear Ferret users
    I am beginner to ferret.

I had searched Users guide, email archives but did not
find solution to the problem.

My problem is as follows:

    Using ascii data file with data in two columns,
i am plotting a line plot.

The values in the first column should be plotted on
x-axis. The values in the second column is to be
plotted as line graph. The x-axis values provided in the
first column increases irregularly.

I wish to plot x-axis values in decreasing order
of magnitude as indicated below:

32, 16, 8, 4, 2, 1, 0.5

  which  should be equally spaced  on the x-axis.
(The decreasing order is such that each value is
half of its previous. It is not monotonically decreasing)

As i was unable to plot x-axis values in the decreasing order
  mentioned above, i had written script for line plot,
  with x-axis increasing regularly.

I am reproducing below the script i have used for the purpose.
------------------------------------------------------------------
test.jnl

file/var="xcor,-" test.dat
define axis/x/from_data/name=xax xcor
define grid/x=xax gt
file/var="xcor,power"/grid=gt test.dat
plot/line/symbol=20/HLIMITS=32.00:0.5/nolab power
--------------------------------------------------

How shall i  change this script for x-axis
decreasing irregularly, in the way mentioned above.

Regards
Dr. Sujata Mandke
Scientist, CGMD, Indian Institute of Tropical Meteorology
PUNE,INDIA.



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement