View Single Post
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#4
Here are some useful examples/templates scripts for ploting with MatPlotLib/NumPy. They have many options to change : domain, function, labels, title, etc. To adapt them to your use, just open the .py file with a text editor (for example Nano for Nokia N9 in Nokia Store), change the definitions in the section "# Personalize your plot parameters here", save and run (using Terminal) :
$ python <scriptname>.py
Timings for MatPlotLib 1.2.0 and NumPy 1.4.1 on Nokia N9.

plotfx.py : Plot of one variable, f=f(x), saving to a (PNG) file. Takes 8.4 s on Nokia N9.


contourfxy.py : contour plot of two variables, f=f(x,y), saving to a (PNG) file. Takes 10.2 s on Nokia N9.


densityfxy.py : density shaded relief plot of two variables, f=f(x,y), saving to a (PNG) file. Takes 10.3 s on Nokia N9.


vectorfieldFxy.py : vector field plot in 2D, F=F(x,y), saving to a (PNG) file. Takes 8.2 s on Nokia N9.


surfacefxy.py : surface plot of two variables, f=f(x,y), saving to a (PNG) file. Takes 16.6 s on Nokia N9.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-02-11 at 16:42. Reason: Timings for MatPlotLib 1.2.0.
 

The Following 6 Users Say Thank You to rcolistete For This Useful Post: