11

Matlab and Mathematica both have features that allow the user to manipulate the contents of a plot using, say, a slider. For example, if you have a set of 3D data, it is easy to make a small program that lets you view 2D slices of a set of 3D data where the user can slide a slider to move through which slice is displayed. Is there anything in python that allows for this sort of capability without tons of effort? For example, is it possible to do such a thing in matplotlib, or something similar? I

Thanks.

4 Answers 4

5

My first thought would be Mayavi, which is great for data visualization, especially in 3D. It relies on VTK. It is included in the Enthought flavoured version of Python, together with Chaco for 2D plotting. To get an idea, look at Travis Vaught's nice screencast in Multidimensional Data Visualization in Python - Mixing Chaco and Mayavi.

It also possible to embed basic interactive functionalities (like slider) to Matplotlib, see matplotlib.widgets and the widget examples.

Finally, you can use rpy (or better, rpy2) and benefit from the R interface.

Sign up to request clarification or add additional context in comments.

1 Comment

In addition to these, IPython now has new interactive plotting capabilities. (Check out the 2.1 release!)
1

Have you looked at Vtk? http://www.vtk.org/ One of their demos does exactly what you're asking.

Comments

1

In principle, you can do it by help of MathGL. This is cross-platform GPL library for plotting.

For each mouse clicks you can find the x,y,z position in plot or clicked object and adjust (replot) some other information correspondingly. However you should handle mouse clicks by yourself (for example, using PyQt).

Comments

1

Another option is to use python within the SAGE computation interface/environment, which has the @interact command (see here for specific help on this command)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.