~ubuntu-branches/debian/sid/pyx/sid

« back to all changes in this revision

Viewing changes to examples/3dgraphs/color.txt

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2011-05-20 00:13:52 UTC
  • mto: (9.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110520001352-odcuqpdezuusbbw1
Tags: upstream-0.11.1
ImportĀ upstreamĀ versionĀ 0.11.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
A colored surface
 
2
 
 
3
To add colors to the surface you need to pass color data to the plot command.
 
4
As in this example, you can just reuse the z value. Alternatively you could
 
5
pass some independend color data. ...
 
6
 
 
7
To bring colors instead of black/white to the surface, you need to change the
 
8
gradient. Be sure to use the same color space for the gridcolor and the
 
9
backcolor too.
 
10
 
 
11
! In this example we also modified the projector. By that you can change the
 
12
view angle, and you can also (as in this example) use a parallel projection
 
13
instead of the default central projection. While the later looks more natural,
 
14
a parallel projection keeps lines parallel independend from their depths. An
 
15
very simple justification of the parallel projection is the vertical z axis,
 
16
which stays vertical in the projection. Also the linear axes have equal
 
17
distances between the ticks, which is not true for central projections.
 
18
 
 
19
! Skipping the value for the z component will allow you to plot this surface
 
20
on a two-dimensional graph as well.