~ubuntu-branches/ubuntu/trusty/mayavi2/trusty

« back to all changes in this revision

Viewing changes to docs/source/mayavi/auto/example_custom_colormap.rst

  • Committer: Package Import Robot
  • Author(s): Varun Hiremath
  • Date: 2012-04-23 16:36:45 UTC
  • mfrom: (1.1.11) (2.2.6 sid)
  • Revision ID: package-import@ubuntu.com-20120423163645-wojak95rklqlbi1y
Tags: 4.1.0-1
* New upstream release
* Bump Standards-Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
for a given object.
11
11
 
12
12
Although the end user specifies colormaps by giving the name of a set of
13
 
predefined colormaps, Mayavi (and VTK) deal with color internally using 
 
13
predefined colormaps, Mayavi (and VTK) deal with color internally using
14
14
'Look Up Tables' (LUT): a table that associate a scalar value to a
15
15
color defined by its RGBA components.
16
16
 
17
17
In this example, we show how the LUT of an object can be retrieved and
18
18
modified. Specificaly, we start by giving a surf object the 'cool'
19
 
colormap, but we modify add to add a transparency effect. 
 
19
colormap, but we modify add to add a transparency effect.
20
20
 
21
21
Notice in the resulting image how the surface becomes more transparent
22
22
for its lower points.
23
23
 
 
24
Note that if you want to use a different number of colors, you can
 
25
change the 'number_of_colors' attribute of the lut object and assign a
 
26
new array of the right shape to its 'table' attribute.
 
27
 
24
28
 
25
29
.. image:: ../generated_images/example_custom_colormap.jpg
26
30
    :align: center
30
34
**Python source code:** :download:`custom_colormap.py`
31
35
 
32
36
.. literalinclude:: custom_colormap.py
33
 
    :lines: 17-
 
37
    :lines: 21-
34
38
 
35
39
 
36
40
    
 
 
b'\\ No newline at end of file'