[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
3D plotting with gnuplot
From: |
Pete Watkins |
Subject: |
3D plotting with gnuplot |
Date: |
Tue, 28 Jan 2003 06:27:56 -0600 |
I'm having trouble with simple 3D plotting of points via gnuplot. For
instance, as an simple example if I define a matrix describing
the four corners of a unit cube
"cube = [0 0 0; 0 0 1; 0 1 0; 0 1 1; 1 0 0; 1 0 1; 1 1 0; 1 1 1]"
and try and plot it
"gsplot cube with dots"
gnuplot seems to use the i and j indicies of the matrix for the x and y
coordinates, and the data as the z coordinate, resulting in a mess. In
contrast, if I save the matrix in an ascii file, cube.txt, and plot that
file with
"gsplot 'cube.txt' with dots"
The four corners of the cube are plotted fine. Obviously I can overcome
the problem by saving an ascii file each time before I plot. However I am
doing real-time visualisation during a simulation, and writing/reading
ascii files at each timestep may slow it down somewhat.
Cheers,
Pete
-------------------------------------------------------------
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
-------------------------------------------------------------
- 3D plotting with gnuplot,
Pete Watkins <=