Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

plot3d - multiple surfaces?

85 views
Skip to first unread message

krt...@charter.net

unread,
Oct 27, 2006, 11:22:11 AM10/27/06
to
I am new to SciLab. I'd like to use plot3d to plot multiple surfaces.
I just do not get the documentation on how to do that (You can draw
multiple plots by replacing xf , yf and zf by multiple matrices
assembled by rows as [xf1 xf2 ...] , [yf1 yf2 ...] and [zf1 zf2
...] .) I keep getting "!--error 999 - plot3d: first and third
arguments have incompatible length", with no more explanation than
that.

Is there some additional documentation out there for how to do this?
I'd like to test it by plotting two, parallel surfaces.

Thanks.

Thomas

Francois Vogel

unread,
Oct 27, 2006, 11:43:16 AM10/27/06
to
Did you try help plot3d ???

t=[0:0.3:2*%pi]';
z=sin(t)*cos(t');
[xx,yy,zz]=genfac3d(t,t,z);
plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)]))

and much more in that help page.

Francois


krt...@charter.net a écrit :


> I am new to SciLab. I'd like to use plot3d to plot multiple surfaces.
> I just do not get the documentation on how to do that (You can draw
> multiple plots by replacing xf , yf and zf by multiple matrices
> assembled by rows as [xf1 xf2 ...] , [yf1 yf2 ...] and [zf1 zf2

> ....] .) I keep getting "!--error 999 - plot3d: first and third

krt...@charter.net

unread,
Oct 27, 2006, 12:04:17 PM10/27/06
to
I did try help, that is where the line I posted came from. I can
replicate their example, but cannot make my own work. Is it necessary
to use the function "genfac3d" to do what I want? If so, that is not
mentioned, that I recall, in help for plot3d.

Thomas

Matthias Zenker

unread,
Oct 30, 2006, 4:48:41 AM10/30/06
to
I just played around a little bit and did not manage to plot two
parallel surfaces without using gensurf. First try:

-->x = [0 1]
-->y = [0 1]
-->z = ones(2,2)
-->plot3d([x x],[y y],[z 2*z])
!--error 999


plot3d: first and third arguments have incompatible length

Then I tried two successive plot3d commands:

-->plot3d(x, y, z)

-->plot3d(x, y, 2*z)
Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "plot3d" function.
Scilab may become unstable.


With gensurf, I run into trouble already with one surface:

-->x=[0 1];
-->y=[0 1];
-->z=ones(2,2);
-->[xx,yy,zz] = genfac3d(x,y,z)
zz =

1.
1.
1.
1.
yy =

0.
1.
1.
0.
xx =

0.
0.
1.
1.

-->plot3d(xx,yy,zz)
!--error 999
Objplot3d: x vector is not monotonous

I this the expected behaviour of Scilab? If yes,what did I do wrong?
I use scilab-4.0-b4-20061019 on Windows XP.

Matthias

Enrico Segre

unread,
Oct 30, 2006, 5:13:47 AM10/30/06
to

Matthias Zenker wrote:
> -->plot3d(x, y, z)
>
> -->plot3d(x, y, 2*z)

no problem on my side with

-->plot3d([0 1],[0 1],ones(2,2))
-->plot3d([0 1],[0 1],2*ones(2,2))

> With gensurf, I run into trouble already with one surface:

...


> -->plot3d(xx,yy,zz)
> !--error 999
> Objplot3d: x vector is not monotonous

likely,
http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2163

Matthias Zenker

unread,
Oct 30, 2006, 8:00:09 AM10/30/06
to

Enrico Segre wrote:
> no problem on my side with
>
> -->plot3d([0 1],[0 1],ones(2,2))
> -->plot3d([0 1],[0 1],2*ones(2,2))

I have downloaded the latest nightly build scilab-4.0-b4-20061030, and
the problem I had before is gone. So the code above now works for me
also.
BTW, it worked in scilab-4.0 as well. Probably a transient bug in the
nightly build I had used before... ;)

> > With gensurf, I run into trouble already with one surface:
> ...
> > -->plot3d(xx,yy,zz)
> > !--error 999
> > Objplot3d: x vector is not monotonous
>
> likely,
> http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2163

This bug is fixed since a few days, my previous scilab version
(scilab-4.0-b4-20061019) was the last one with this bug. :)

So the answer to Thomas' initial question is probably:
Either use two successive plot3d commands, like in

x = [0 1]
y = [0 1]
z = ones(2,2)
plot3d(x,y,z)
plot3d(x,y,2*z)

or use genfac3d if you want to issue a single plot3d command:

[xx,yy,zz] = genfac3d(x,y,z)
plot3d([xx xx],[yy yy],[zz 2*zz])

Matthias

0 new messages