help-octave
[Top][All Lists]

## Re: How do you change to an ordinate on gsplot?

 From: Robert A. Macy Subject: Re: How do you change to an ordinate on gsplot? Date: Sun, 24 Apr 2005 15:30:19 -0700

```Henry,

"mesh" function.  I was used to using...

>> gsplot values(1:400,1:70);

to do your idea, I tried "long hand" by using...

>> x=[(1:400)']*ones(1,70);
>> xx=vec(x);
>> y=ordinate(1:70);
>> yy=vec(y);
>> zz=vec(values);
>> mesh(xx,yy,zz);

However, I did discover that it could all be simplified,
using small vectors for x, y, and leave z as an array.
Doing the simplified manner I did have to transpose z.

Yes, it plots.  Yes, it does what I want BUT...

It took over two minutes to plot.  And moving around,
forget it!  Also, turned my plots green [difficult to see]

I tried clipping what I display down to 50:70, but still
waaaaay too slow, like 10 seconds each move.

I'm running
octave 2.1.50a-inst.exe on a 733MHz Win98 machine.

Guess I'll have to write a program to uniformly distribute
the values over index values and live with it, eh?

- Robert -

On Sun, 24 Apr 2005 10:57:01 -0700
"Henry F. Mollet" <address@hidden> wrote:
> Not quite sure if I'm answering your question but gsplot
> z will use a
> counter for x and y starting at 0 (has a name but I
> cannot think of it right
> now)
> *whereas* mesh (x,y,z') will use x and y as given. Note
> that one has to use
> z' to get the same plot. [That is a right-handed
> coordinate system according
> to z = cross-product of x and y (turning x-axis (vector)
> counter-clockwise
> towards y-axis (vector) produces z-axis (vector) pointing
> up].
>
> Octave input follows and 2 graphs are attached for
> demonstration.
> Henry
>
> octave:13> x=[1:1:5]
> x =
>   1  2  3  4  5
> octave:14> y =[2:2:10]
> y =
>    2   4   6   8  10
> octave:15> [xx,yy]=meshgrid(x,y)
> xx =
>   1  2  3  4  5
>   1  2  3  4  5
>   1  2  3  4  5
>   1  2  3  4  5
>   1  2  3  4  5
> yy =
>    2   2   2   2   2
>    4   4   4   4   4
>    6   6   6   6   6
>    8   8   8   8   8
>   10  10  10  10  10
> octave:16> z = xx.^2+yy.^2
> z =
>     5    8   13   20   29
>    17   20   25   32   41
>    37   40   45   52   61
>    65   68   73   80   89
>   101  104  109  116  125
>
> octave:18> gset term aqua 1
> octave:19> gsplot z  % saved as Fig1_gsplot
> octave:21> gset term aqua 2
> octave:22> mesh (x,y,z') % savedd as Fig2_mesh
>
>
>
>
>
>
> on 4/24/05 6:54 AM, Robert A. Macy at address@hidden
> wrote:
>
> > How do you change to an ordinate "scale" in gsplot?
> > I'm not mathematical, so I may be using the wrong
> terms,
> > but what I mean is:
> > Given a two dimensional array of real values,
> > the line...
> >
> >>> gsplot values;
> >
> > ...something automatically makes a great 2d mesh plot
> > with x = rowsofvalues and y = columnsofvalues
> > and z = values
> >
> > I want y to be transformed to a different "scale".
> >
> > I have specific values for the scale.  The values are
> not
> > uniform. so the mesh display has "sawtooth" like
> artifacts.
> > How do I change the y to be a function of indices?
> >
> > Stated another way.
> >
> > How do I 2d mesh plot an array with x = index of rows
> > and y = monotonic function ( index of columns ) ??
> >
> >                 - Robert -
> >
> >
> >
> >
>
-------------------------------------------------------------
> > Octave is freely available under the terms of the GNU
> GPL.
> >
> > Octave's home on the web:  http://www.octave.org
> > How to fund new projects:
>  http://www.octave.org/funding.html
> > Subscription information:
>  http://www.octave.org/archive.html
> >
>
-------------------------------------------------------------
> >
>

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```

reply via email to