help-octave
[Top][All Lists]

## Re: surface plot

 From: Tatsuro MATSUOKA Subject: Re: surface plot Date: Wed, 18 Aug 2010 08:20:03 +0900 (JST)

```Hello

Perhaps
meshgrid(xx,yy,zz);

gives tree dimensional array

octave:22> x=[0 1]
x =

0   1

octave:23> [x2,y2,z2]=meshgrid(x,x,x)
x2 =

ans(:,:,1) =

0   1
0   1

ans(:,:,2) =

0   1
0   1

y2 =

ans(:,:,1) =

0   0
1   1

ans(:,:,2) =

0   0
1   1

z2 =

ans(:,:,1) =

0   0
0   0

ans(:,:,2) =

1   1
1   1

***************
However, in my case your operation gives

octave:31> xx = linspace(1,12,50);
octave:32> yy=linspace(2,9,50);
octave:33> zz = linspace(0.4,2000,50);
octave:34> [x2,y2,z2] = meshgrid(xx,yy,zz);
octave:35> surface(x2,y2,z2);
error: invalid value for array property "xdata"
error: set: expecting argument 2 to be a property name
error: set: expecting argument 4 to be a property name
error: set: expecting argument 6 to be a property name
error: called from:
error:   C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\surface.m
at line 150, column 7
error:   C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\surface.m
at line 51, column 5
error: __go_draw_axes__: invalid grid data
error: called from:
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\__go_draw_axes__.m
at line 903,
column 8
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\__go_draw_figure__.m
at line 92,
column 3
error:
C:\Programs\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\gnuplot_drawnow.m
at line 99,
column 5

and a plot appears.

I have tested on octave-3.2.4/mingw32 on octave-forge website.

BTW, did you install the octave-forge packages?
If you install the octave-forge package, please read carefully and treat the
oct2mat issue

http://wiki.octave.org/wiki.pl?OctaveForWindows
1. Standalone ports
1.1. Octave 3.2.4 for Windows MinGW32
Additional important topics found after the release:

Regards

Tatsuro

> Hi all,
>
> since some time, I try to plot some simple data as a surface plot, but
> something
> seems to be strange.
>
> First,
> I have to work on windows (it's on the office pc), so I'm currently using:
> windows vista, and the newest windows-
> version of octave, 3-2-4
>
> Everything runs perfectly, except the current problem.
>
> Sample 1, still running:
>
> =====================
> xx = linspace(1,12,50);
> yy = linspace(2,9,50);
> zz = linspace(0.4,2000,50);
>
> [x2,y2] = meshgrid(xx,
> yy);
> z2 = x2.^2 + y2.^2;
> surface(x2,y2,z2);
>
> Sample 2, not running:
> =====================
> xx = linspace(1,12,50);
> yy =
> linspace(2,9,50);
> zz = linspace(0.4,2000,50);
>
> [x2,y2,z2] = meshgrid(xx,yy,zz);
> surface(x2,y2,z2);
>
> following error
> occures:
> ========================
> h = -5.5609
> error: invalid value for array property "xdata"
> error: set: expecting
> argument 2 to be a property name
> error: set: expecting argument 4 to be a property name
> error: set: expecting argument
> 6 to be a property name
> error: called from:
> error:   C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\surface.m at
> line 1
> 50, column 7
> error:   C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\surface.m at
> line 5
> 1, column 5
>
> error:   c:\users\scm696\Documents\10002_Optimisation\octaveScript.m at line
> 32,
>  column 1
> error: __go_draw_axes__:
> invalid grid data
> error: called from:
> error:
> C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\__go_draw_axes__.m
>
> at line 903, column 8
> error:
> C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\__go_draw_figure__.
> m at line 92,
> column 3
> error:
> C:\Octave\3.2.4_gcc-4.4.0\share\octave\3.2.4\m\plot\gnuplot_drawnow.m a
> t line 99, column 5
> octave-
> 3.2.4.exe:40>
>
> What's wrong? I can't find any samples with meshgrid(x,y,z) only with
> meshgrid(x,y)!
>
> Thanks for some
> help
>
> Michael

--------------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

```