Plot3 in Python – ‘almost’ like Matlab

Here’s an interesting picture titled “language family” from 1985!! Found via this blog.


But this post is really about mimicking  Matlab’s very useful plot3 command in python using matplotlib !!

The following function gives a bare bone plot3 command in python.

Plot3 in python

def plot3(a,b,c,mark="o",col="r"):
  from matplotlib import pyplot
  import pylab
  from mpl_toolkits.mplot3d import Axes3D
  fig = pylab.figure()
  ax = Axes3D(fig)
  ax.scatter(a, b, c,marker=mark,color=col)


One thought on “Plot3 in Python – ‘almost’ like Matlab

  1. Pingback: Python VTK script to Display 3D xyz data |

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s