User Tools

Site Tools


documents:110816pyip_cooking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documents:110816pyip_cooking [2011/12/20 23:12] – added 3D trajectory plotting with mayavi kotadocuments:110816pyip_cooking [2016/05/25 07:56] (current) – [plot 3D coordinates using Mayavi] kota
Line 108: Line 108:
 An example script for loading (x, y, y) coordinates data from tab-delimited text file and plot them in 3D using [[http://github.enthought.com/mayavi/mayavi/|mayavi2]].  An example script for loading (x, y, y) coordinates data from tab-delimited text file and plot them in 3D using [[http://github.enthought.com/mayavi/mayavi/|mayavi2]]. 
  
-<sxh python>+<code python linenums:1>
 from matplotlib import mlab as matp from matplotlib import mlab as matp
 filename = '/Users/miura/data.txt' filename = '/Users/miura/data.txt'
Line 123: Line 123:
     plin1 = plot3d([x1[idx], x2[idx]], [y1[idx], y2[idx]], [z1[idx], z2[idx]], tube_radius=0.1, colormap='Spectral', color=(0, 0, 1))     plin1 = plot3d([x1[idx], x2[idx]], [y1[idx], y2[idx]], [z1[idx], z2[idx]], tube_radius=0.1, colormap='Spectral', color=(0, 0, 1))
 maya.show() maya.show()
-</sxh>+</code>
  
 [{{ :documents:figure20110923:mayaviexample.png?250| plotting data with mayavi}}] [{{ :documents:figure20110923:mayaviexample.png?250| plotting data with mayavi}}]
Line 160: Line 160:
  
 Note that in this example,  Note that in this example, 
-<sxh python>+<code python>
 from mayavi import mlab as maya from mayavi import mlab as maya
-</sxh>+</code>
  
 since the namespace "mlab" overlaps with matplotlib.mlab.  since the namespace "mlab" overlaps with matplotlib.mlab. 
documents/110816pyip_cooking.txt · Last modified: 2016/05/25 07:56 by kota

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki