Skip to content

Commit

Permalink
added mayavi files
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesq34 committed Apr 10, 2018
1 parent 6b0bf59 commit ae6e5b6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mayavi/mayavi_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#/bin/bash
# Install Mayavi (scientific data visualization and plotting in Python) on Ubuntu
# Ref: http://docs.enthought.com/mayavi/mayavi/installation.html
sudo apt-get install python-vtk python-qt4 python-qt4-gl python-setuptools python-numpy python-configobj
sudo pip install mayavi
19 changes: 19 additions & 0 deletions mayavi/test_drawline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import numpy
from mayavi.mlab import *

def test_plot3d():
"""Generates a pretty set of lines."""
n_mer, n_long = 6, 11
pi = numpy.pi
dphi = pi / 1000.0
phi = numpy.arange(0.0, 2 * pi + 0.5 * dphi, dphi)
mu = phi * n_mer
x = numpy.cos(mu) * (1 + numpy.cos(n_long * mu / n_mer) * 0.5)
y = numpy.sin(mu) * (1 + numpy.cos(n_long * mu / n_mer) * 0.5)
z = numpy.sin(n_long * mu / n_mer) * 0.5

l = plot3d(x, y, z, numpy.sin(mu), tube_radius=0.025, colormap='Spectral')
return l

test_plot3d()
raw_input()

0 comments on commit ae6e5b6

Please sign in to comment.