[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy tutorial on how to make 3-dimensional graphics

From: Tetsuji \"Maverick\" Rai
Subject: Re: Easy tutorial on how to make 3-dimensional graphics
Date: Fri, 13 Jan 2006 00:08:40 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060101 SeaMonkey/1.5a

Hash: SHA1

Quentin Spencer wrote:
> Tetsuji "Maverick" Rai wrote:
>> Thanks!  I understood how to plot in 3-dimensional space.  Then how can
>> I "rotate" or "pitch up/down" this 3-dimension graphics display?  I
>> cannot find it in the online document 17.3 "Three-Dimensional Plotting."
> See "help view" for a way to do it from the command line. It can also be
> done interactively with the mouse in gnuplot 4.0 (I don't think you can
> in the older versions), but you need to put "set mouse" in your .gnuplot
> file in order to enable it (an uglier way is to enter
> __gnuplot_raw__("set mouse\n") in octave before you create the 3-d plot).
> -Quentin

Thank you for your help...

I'm a newbie on octave.

Now I've begun writing a small function to make a 3-d plot, but I'm
stuck at linspace(,,).  Following function fails like

octave:2> h100(1)
error: linspace: npoints is 1, but x1 != x2
error: evaluating assignment expression near line 6, column 9
error: evaluating assignment expression near line 6, column 5
error: called from `h100' in file

- ----h100.m----
function h100(dn)

  a0 = 1;
  n = 1;

  x = z = linspace (-10, 10, dn);
  [xx, zz] = meshgrid (x,z);
  [theta,r] = cart2pol (zz,xx);

  r1 = 1 ./(n*a0);
  y = r1 .^1.5 * exp(-r1*r);
  y = y*y ./ pi;

- ---------------

Apparently x and z has a problem (I think I just borrowed this line from
sombrero(n)).  I must be doing something wrong, but don't know what's
wrong..  Looking at sombrero(n), I see a single quote after
linspace(-8,8,n) and a period before slash '/' or hat '^'..... What are
they??  As for math, C++ is much easier to me... very unusual :(

In above function, x and z axes are on the horizontal plane, and y axis
stands vertically.

So are there any good online tutorial for octave (not document on

- -Tetsuji
- --
Tetsuji 'Maverick' Rai
main page
PGP pubkey
PGP Key ID: 0x971E57CA
Key fingerprint: F790 28AF E95B 48C9 19AB  71FD 50B5 3572 971E 57CA
Aviation Jokes:
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]