~ubuntu-branches/ubuntu/precise/mayavi2/precise

« back to all changes in this revision

Viewing changes to docs/source/mayavi/auto/scatter_plot.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-07-09 01:18:36 UTC
  • mfrom: (1.1.10 upstream) (2.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110709011836-fha21zirlgkqh92s
Tags: 4.0.0-1
* New upstream release
* debian/control:
  - Bump Standards-Version to 3.9.2
  - Set X-Python-Version: 2.6, fixes FTBFS (Closes: #625148)
  - Update Depends
* Update debian/watch file
* Cleanup debian/rules file

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
This script creates a bunch of random points with random scalar data
5
5
and then shows these as a "scatter" plot of points.  The script
6
 
illustrates how to 
 
6
illustrates how to
7
7
 
8
8
 1. create a dataset easily using tvtk and numpy,
9
9
 
10
10
 2. use a created dataset in Mayavi and visualize it.
11
11
 
12
12
This example achieve the same functionnality as mlab's points3d
13
 
function ( :func:`enthought.mayavi.mlab.points3d`), but explicitely
 
13
function ( :func:`mayavi.mlab.points3d`), but explicitely
14
14
creating the objects and adding them to the pipeline engine via the Mayavi
15
15
core API. Compared to using mlab, this method has the advantage of giving
16
16
more control on which objects are created, and there life cycle.
29
29
# License: BSD Style.
30
30
 
31
31
import numpy as np
32
 
from enthought.tvtk.api import tvtk
33
 
from enthought.mayavi.scripts import mayavi2
 
32
from tvtk.api import tvtk
 
33
from mayavi.scripts import mayavi2
34
34
 
35
35
 
36
36
@mayavi2.standalone
45
45
    pd.point_data.scalars.name = 'scalars'
46
46
 
47
47
    # Now visualize it using mayavi2.
48
 
    from enthought.mayavi.sources.vtk_data_source import VTKDataSource
49
 
    from enthought.mayavi.modules.outline import Outline
50
 
    from enthought.mayavi.modules.surface import Surface
 
48
    from mayavi.sources.vtk_data_source import VTKDataSource
 
49
    from mayavi.modules.outline import Outline
 
50
    from mayavi.modules.surface import Surface
51
51
 
52
52
    mayavi.new_scene()
53
53
    d = VTKDataSource()