View Single Post
Posts: 924 | Thanked: 2,160 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 ---
2 Nokia N9 16GB Black @ 1.35 GHz, 1 with Sailfish, Stowaway foldable BT keyboard.
Nexus 4 with Sailfish. Nokia N900 @ 1.1 GHz. N810. Nokia 9500. Psion Revo+.

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

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