views:

648

answers:

3

Hi all. I am currently have a n by 3 matrix array. I want plot the three columns as three axises. how can i do that? I have googled and people suggested using matlab, but I am really having a hardtime with understanding it. Can someone teach me? Thanks in advance

sorry for the missing infomation. Its in python and I want a scatter plot.

+1  A: 

Use asymptote instead!

This is what it can look like:

http://asymptote.sourceforge.net/gallery/3D%20graphs/helix.pdf

This is the code: http://asymptote.sourceforge.net/gallery/3D%20graphs/helix.asy

Asymptote can also read in data files.

And the full gallery: http://asymptote.sourceforge.net/gallery/

To use asymptote from within Python:

http://www.tex.ac.uk/tex-archive/graphics/asymptote/base/asymptote.py

Hamish Grubijan
+2  A: 

You can use matplotlib for this. matplotlib has a mplot3d module that will do exactly what you want.

from matplotlib import pyplot
import pylab
from mpl_toolkits.mplot3d import Axes3D
import random


fig = pylab.figure()
ax = Axes3D(fig)

sequence_containing_x_vals = range(0,100)
sequence_containing_y_vals = range(0,100)
sequence_containing_z_vals = range(0,100)

random.shuffle(sequence_containing_x_vals)
random.shuffle(sequence_containing_y_vals)
random.shuffle(sequence_containing_z_vals)

ax.scatter(sequence_containing_x_vals, sequence_containing_y_vals, sequence_containing_z_vals)
pyplot.show()

The code above generates a figure like:

matplotlib 3D image

Chinmay Kanchi
+2  A: 

from enthought.mayavi import mlab

J.F. Sebastian
You should seriously consider MayaVi. We use MayaVi here for all of the 3D plotting and it is really good.
Madhusudan.C.S