[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 3d gsplot using first column of z as axis (was Re: timefmt with splo
From: |
Colin Telmer |
Subject: |
Re: 3d gsplot using first column of z as axis (was Re: timefmt with splot? |
Date: |
Wed, 14 Oct 1998 22:12:41 -0400 (EDT) |
On Wed, 14 Oct 1998, John W. Eaton wrote:
> Sorry, I don't understand the question. If the description of gsplot
> in the Octave manual doesn't help, then maybe I could answer your
> question if you provided some example data. How many rows and columns
> are in z? What do you mean by `using a vector', etc.?
>
> If you can figure out how to make the 3D plot you want directly in
> gnuplot, then there's a good chance that there is a way to do it from
> Octave (at least by opening your own pipe to gnuplot). But if it doesn't
> even work directly in gnuplot, then maybe you should be reporting the
> bug to the gnuplot maintainers instead.
Sorry, perhaps this is more of a pure gnuplot. However, I will try to
explain what I want to end up with for clarity. I have a 2d array in which
the columns are different interest rates (maturities ascending from a one
period rate upwards) and the rows are points through time. So any given
row is an interest rate yield curve at a given date. I want to plot a 3d
graph of these yield curve across time. The octave function mesh(z) or
it's equivalent gnuplot commands from within octave does this exactly.
Assume that the interest rate is on the z axis, the maturity (each column)
is on the y axis and time is on the x axis and the there are 470 rows
(time points). I wanted to do the same thing as the code within the
function mesh, but I want to use the values in a vector d as the x axis
scale rather than 1 through 470 (corresponding to the row index of z). The
vector d could be anything, but the one I had in mind was
d = [1952+1/12:1/12:1992+2/12]
which has length 470 but will look like dates (I understand I could have a
vector of true dates and use the timefmt stuff in gnuplot, but I have
become accustom to using this simple hack before discovering the time
stuff in gnuplot). I'll have to poke around in gnuplot more to see if this
is possible. If I figure it out I will try to write a function that
expands mesh to include this ability and forward it to octave-source.
Cheers, Colin.
--
Colin Telmer, Ottawa, Ontario, Canada
<mailto:address@hidden>
<http://www.telmer.com>