![]() |
[Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
MatPlotLib is a Python library for making 2D and 3D plots, usually using NumPy to calculate the data. See the MatPlotLib gallery to have an idea of which plots can be make using a Nokia N9/N950.
Release history for MeeGo 1.2 Harmattan (see the version history "MatPlotLib What's New") : - MatPlotLib 1.3.1 (10/10/2013) first release for MeeGo 1.2 Harmattan (20/10/2014). New WebAgg backend (from a web browser) and many new features; - MatPlotLib 1.2.1-3 Harmattan release (12/10/2014). MatPlotLib is visible in MeeGo Harmattan Application Manager and is installed easier using Warehouse; - MatPlotLib 1.2.1-2 Harmattan release (15/06/2013); - MatPlotLib 1.2.1-1 (26/03/2013) released for MeeGo Harmattan (06/06/2013); - MatPlotLib 1.2.0-2 Harmattan release (12/02/2013); - MatPlotLib 1.2.0-1 (08/01/2013) released for MeeGo Harmattan (09/02/2013), with graphical backend (Qt4App/PySide) to interactively show plots. It also has animations and many more features; - MatPlotLib 1.0.0 (06/07/2010), released for MeeGo Harmattan in 24/11/2011, based on the Maemo 5 version of Simon Pickering.Manual installation and configuration, with only Agg backend. For MatPlotLib on Sailfish/Mer, see the topic "MatPlotLib - 2D & 3D plots for Sailfish". Examples and screenshots of MatPlotLib on MeeGo Harmattan Some graphics produced by using MatPlotLib 1.3.1 with NumPy 1.9.0 on a Nokia N9. See more examples in post #4. Download the .py (Python) script and using Terminal type in the the same directory the commands after the "$" : 2D plot of a function (sin) of one variable (takes 3.3 s). $ python simple_plot.py http://www.robertocolistete.net/matplotlib/figplot.png Qt4/PySide backend showing a plot of one variable, f=f(x), of a damped harmonic oscillator, see plotfx.py script in post #4, where the "savefig" command was commented and "show()" was uncommented : http://www.robertocolistete.net/MatP...Qt4backend.png 3D surface plot of a function of two variables (takes 3.9 s) : $ python surface3d_demo.py http://www.robertocolistete.net/matp...figsurface.png The same above, shown by the Qt4/PySide backend using "plt.show()" instead of "plt.savefig" in the script, allows to touch to rotate the 3D plot : http://www.robertocolistete.net/MatP...Qt4backend.png 2D vector field plot (takes 3.5 s): $ python convfield.py http://www.robertocolistete.net/matp.../convfield.png Installing MatPlotLib on MeeGo Harmattan See post #33 if you want to install MatPlotLib 1.0.0. The instructions below are for MatPlotLib 1.3.1. MatPlotLib has 2 repositories options, so it can be : - easily installed by using Warehouse / OpenRepos.net. Install Warehouse (OpenRepos.net client) for MeeGo Harmattan, then open Warehouse, search for "MatPlotLib", enable the repository and install; - installed by using my Harmattan repository ("python-matplotlib" package). Warehouse showing MatPlotLib 1.3.1 available to install : http://www.robertocolistete.net/MatP...oHarmattan.png The MatPlotLib v1.3.1 takes 26MB, while its dependencies (NumPy >= 1.7.0 and "python-dateutil", "python-pyparsing", "python-tornado", "python-tz", etc) take additionally 32 MB after automatic installation. "python-pyside" (if not installed by many MeeGo Harmattan other softwares), will be installed, taking >= 16MB. MatPlotLib >= 1.3.x doesn't use '~/.matplotlib" configuration folder, but instead '~/.config/matplotlib". So upgrading from MatPlotLib < 1.3 to >= 1.3, then remove the older folder. Or, to remove any conflicting configuration of MatPlotLib 1.0.0 (previous versions), type in Terminal as user : $ cd ~ $ rm -rf .matplotlib The default backend is Qt4/PySide interactive graphical backend. If you don't want to use an interactive graphical backend by default, then as user in Terminal, type : $ cd ~ $ mkdir .config/matplotlib $ echo 'backend : Agg' > .config/matplotlib/matplotlibrc so the Agg non interactive backend becomes the default one. With non interactive backend, the plots are not shown in the screen and can only be saved to PNG, PDF, PS and SVG files (by using "savefig" command). The WebAgg backend is also available on MatPlotLib >= 1.3, so the figures are displayed in a web browser with the URL http://127.0.0.1:8988/, it is interactive and suppport MatPlotLib animations. If you want to use the WebAgg backend by default, then in Terminal, type : $ cd ~ $ mkdir .config/matplotlib $ echo 'backend : WebAgg' > .config/matplotlib/matplotlibrc Using MatPlotLib on MeeGo Harmattan It is strongly suggested to also install IPython for MeeGo Harmattan, so the interactive use of MatPlotLib/NumPy becomes a lot easier With the new IPython 0.13.1-2 Harmattan, there are 3 interfaces : IPython terminal, IPython Notebook and IPython Qt console. As a simple example (just type the text after the "In [n]:" lines) in IPython terminal : http://www.robertocolistete.net/matp...9_terminal.png In [1]: from pylab import * In [2]: x = randn(10000); hist(x, 100) In [3]: savefig('histogram.png') In [4]: show() The 1st line loads NumPy and MatPlotLib by using PyLab. The 2nd line calculates 10 thousand random numbers using NumPy, and makes a histogram (not shown in the screen). The 3rd line saves the histogram to a PNG file 'histogram.png' in the current directory (it could be a PDF figure, just use '.pdf' extension). Yeah, your Nokia N9 can easily create PDF files of plots ! The 4th line shows the plot in the interactive Qt4/PySide default backend of MatPlotLib >= 1.2, see below : http://www.robertocolistete.net/matp...Qt4backend.png The interactive Qt4/PySide default backend is not touch friendly (as there is no mouse and the N9/N950 screen is small compared to a desktop PC), so only some features are practical to use. But it shows the plot in full screen since MatPlotLib >= 1.2 Harmattan (12/02/20130 allows to rotate 3D plots, etc. To run IPython with PyLab (NumPy + MatPlotLib) in interactive mode in Terminal, there are many options : - tap the IPython icon (v0.13.1), then type "%pylab"; - open the Terminal, type "ipython", then type "%pylab"; - open the Terminal, type "ipython --pylab". See post #42 for time measurements of MatPlotLib 1.3 x 1.2 x 1.0 with NumPy 1.7 and 1.9. Or older post #32 for time measurements of MatPlotLib 1.2 x 1.0 with NumPy 1.4 and 1.7. IPython Notebook and IPython Qt console also support inline plots, just type "%pylab inline" inside the IPython Notebook session : http://www.robertocolistete.net/ipyt...-0.13.1_N9.png Or IPython Qt console session : http://www.robertocolistete.net/ipyt...-0.13.1_N9.png Documentation and Examples for MatPlotLib MatPlotLib documentation is online in the official MatPlotLib site, in PDF format (63MB and more than 2,6 thousand pages), or help available in interactive mode by typing : - "help(matplotlib)", after an "import matplotlib"; - "help(pylab)" or "help(pylab.matplotlib)", when using PyLab. The package "python-matplotlib-doc_*.deb" only contains examples, but anyway it is purged as everything is in "/usr/share/doc/". There is more than one hundred source code examples (.py Python files) in : MatPlotLib gallery MatPlotLib screenshots MatPlotLib examples list which can run on Nokia N9/N950. MatPlotLib is often used together with NumPy (for numerical calculations in Python), so see topic about NumPy for MeeGo Harmattan. For making plots with calculations using derivatives, integrals, etc, then SymPy is also available for MeeGo Harmattan : SymPy (Computer Algebra System) for Maemo 4 & 5 & 6 By the way, be a N9/N950 proud user : MatPlotLib >= 1.2 is only available for Linux, Windows, Mac OS, iOS, Sailfish and MeeGo 1.2 Harmattan. Next steps for MatPlotLib on MeeGo Harmattan : - (DONE, see this post and post #4) show easy script examples (with documentation) to make the most useful plots; - (DONE, see my Harmattan repository) release MatPlotLib packages in a public MeeGo Harmattan repository (App); - (DONE, now with MatPlotLib 1.2.0 there is a interactive backend on Nokia N9/N950) try to release MatPlotLib 1.1 or 1.2, which includes animations, PySide compatibility (so, maybe, I say, maybe, interactive backend could run on Nokia N9/950); - (DONE, see MatPlotLib 1.2.0 Harmattan2) try to show Qt4/PySide backend in full screen; - release MatPlotLib 1.4.x; - release softwares depending on MatPlotLib/Numpy with easy to use interface (in Qt Quick) to make from simple to complex plots of functions of 1 or 2 variables, of experimental data with error bars, eletrical vector field/potential, etc. Python for MeeGo Harmattan More Python packages are listed in the Python Harmattan Wiki. See also OpenRepos.net. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
from pylab import *
does not work for me after your described procedure: No module named pylab |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
Also check if, using Terminal : $ apt-cache show python-matplotlib shows a lot of information about the package (to confirm if it is installed). |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
:rolleyes: |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
This fixed it: Code:
apt-get install python-central |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Will it be possible to have the QT iPython console on the N9 some day?
http://ipython.org/ipython-doc/dev/i...qtconsole.html |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
The installation instructions are now fixed and complete. Thank you very much. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
But my priority is to (try to) release MatPlotLib 1.1 with a possible Qt backend running on Nokia N9/N950. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Hello !
I had just a little problem when i try to install the Library... When i enter this command : " # dpkg -i python-matplotlib-data_1.0.0-1_all.deb " My N9 returning this error : "Aegis rejecting python-matplotlib-data_1.0.0-1_all.deb : Could not open debian archive Aegis aborting dpkg -- all listed package files rejected Sorry for my approxymatly english .. i'm french ^^ |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Hello !
I had just a little problem when i try to install the Library... When i enter this command : " # dpkg -i python-matplotlib-data_1.0.0-1_all.deb " My N9 returning this error : "Aegis rejecting python-matplotlib-data_1.0.0-1_all.deb : Could not open debian archive Aegis aborting dpkg -- all listed package files rejected" Can i clean this error ? What ? Thanks for your help... ^^ Sorry for my approxymatly english .. i'm french ^^ |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Yes yes , i follow the instructions faithfully...
I just got this error for this step ^^ :( |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
- the version (PR1.0, PR1.1 or even PR1.2...) of your MeeGo Harmattan on your Nokia N9; - if the 'python-matplotlib-data_1.0.0-1_all.deb' file was correctly downloaded with 1246086 bytes; - if 'python-matplotlib_1.0.0-1_armel' and 'python-matplotlib-doc_1.0.0-1_all.deb' can be correctly installed using 'dpkg -i'. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Yes, no problems =)
I have a Nokia N9 16Gb PR 1.1 (20.2011.40-4.480.2_PR_480) -'python-matplotlib-data_1.0.0-1_all.deb' was correctly downloaded with 1246086 bytes -same thing for 'python-matplotlib_1.0.0-1_armel.deb' with 5*358*826 bytes And 'python-matplotlib_1.0.0-1_armel' and 'python-matplotlib-doc_1.0.0-1_all.deb' are not installed because i had aegis error .. For the moment i just do : in root mode # apt-get install python-central python-numpy # apt-get install python-dateutil python-gobject python-cairo Intalled with success. How i can unistall 'python-central python-numpy' and 'python-dateutil python-gobject python-cairo' and test if 'python-matplotlib_1.0.0-1_armel' and 'python-matplotlib-doc_1.0.0-1_all.deb' are installed (with error ?). If i can clean all the files , i can retry the installation at zero ... I really want to install this library it's for a project with a Fox g20 card .. ^^ Thanks for your help ! |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
Another question : IPython 0.10.2 can be installed on your N9 ? |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
yes it is on.
Python is installed and works fine when i enter 'ipython' command line |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
I just tried to install 'ipython_0.10.2-1harmattan1_all.deb' package on my N9 and .. i had the same errors.. =/
(Sorry for the answer late .. i had lot of homework for school ^^ ) Do you think i lost this error with a reinstallation software with Nokia SU ? |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
The normal solution would be : http://techprolonged.com/index.php/2...ego-harmattan/ which I suggested some posts before and you confirmed that this setting is already enabled. Quote:
Try to install other .debs outside Nokia Store to confirm the nature of the problem. For example : FirexFox/Fennec (see My-MeeGo site), MeeFolders (here in Talk Maemo.org), etc. Keep me updated about your problem. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
could you do a reboot and try installing it again. sometimes if a background installation isn't completed i've received the same error. a reboot and some wait later the installation goes through well. sry if not useful, just a tip to try.
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Yes i try restart thedead1440 ^^ Don't worry !
rcolistete thanks i go try this solution , and for information Fenne it's already installed on my N9, but for install fennec i just double click on the file ^^ I keep you updated soon =):D |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
http://talk.maemo.org/showthread.php?t=78568 http://talk.maemo.org/showthread.php?t=79997 Please try to install them. As I have packaged SymPy, IPython and MatPlotLib for MeeGo Harmattan, if one install and another don't, I can compare my configuration files to try to find the problem. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Python Sympy is installed but Ipthon don't ...
In french --> " Installation impossible. Programme d'installation invalide " |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Anyone else with the same problem of blinkman04 ?
I have no solution because I am not able to reproduce the problem. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
If you want i show my problem with a vidéo .. But i try to intalled a 2nd fois my N9 soon.
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
I know this post has been around for awhile, but i faced the same problem, as i can't install those deb file for the exact same problem. I can install and run ipython, Numpy and Sympy but not Matlibplot, so it was kinda frustrating, as I tried all the method i can think of.
Quote:
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Quote:
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
My N9 now has PR1.3 and MatPlotLib (python-matplotlib-data & python-matplotlib) is successfully installed using "# dpkg -i" as root and "Allow installations from non-store sources" turned on.
I symply can not reproduce the installation errors of blinkman4 and ep1010 users. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Updated the 1st post with easier installation instructions (using my Harmattan repository), and easier use of MatPlotLib with IPython 0.13.1 Notebook or Qt console.
|
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
(09/02/2013) MatPlotLib 1.2.0 is now released for MeeGo Harmattan, just 1 month after the upstream release (08/01/2013), with interactive graphical backend on Nokia N9/N950 and many new features.
MatPlotLib 1.2.0 Harmattan is based on Ubuntu 13.04 version and MatPlotLib 1.2.0 source code, without Python 3 support, no debug package, adapted dependencies to MeeGo Harmattan, etc. See 1st post por details about installing and using MatPlotLib 1.2.0. Time to load MatPlotLib 1.2.0 on Nokia N9 : - 0.7-0.9 s via "from matplotlib import *" ; - 2.0-2.3 s (with NumPy 1.4.1 or 1.7.0) via "import pylab" or "from pylab import *". Comparing with MatPlotLib 1.0.0 : - 0.7-0.9 s via "from matplotlib import *" ; - 1.5-1.7 s (with NumPy 1.4.1 or 1.7.0) via "import pylab" or "from pylab import *". Benchmarks of MatPlotLib examples (see posts #1 and #4) with NumPy 1.4.1 (from Nokia repositories) on Nokia N9 : simple_plot.py : 2.9s (1.0.0), 4.4s (1.2.0) surface3d_demo.py : 10.0s (1.0.0), 9.7s (1.2.0) convfield.py : 2.8s (1.0.0), 4.6s (1.2.0) plotfx.py : 6.1s (1.0.0), 8.4s (1.2.0) contourfxy.py : 7.4s (1.0.0), 10.2s (1.2.0) densityfxy.py : 7.5s (1.0.0), 10.3s (1.2.0) vectorfieldFxy.py : 5.8s (1.0.0), 8.2s (1.2.0) surfacefxy.py : 19.7s (1.0.0), 16.6s (1.2.0) The same, but using new NumPy 1.7.0 on Nokia N9 : simple_plot.py : 3.2s (1.0.0), 4.8s (1.2.0) surface3d_demo.py : 12.1s (1.0.0), 10.9s (1.2.0) convfield.py : 3.2s (1.0.0), 4.8s (1.2.0) plotfx.py : 6.4s (1.0.0), 8.9s (1.2.0) contourfxy.py : 8.3s (1.0.0), 10.9s (1.2.0) densityfxy.py : 8.0s (1.0.0), 10.6s (1.2.0) vectorfieldFxy.py : 6.5s (1.0.0), 8.6s (1.2.0) surfacefxy.py : 22.8s (1.0.0), 19.0s (1.2.0) As we see above : - MatPlotLib 1.2.0 is slower than v1.0.0, except for surface 3D plots; - using NumPy 1.7.0 is slower than v1.4.1. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
If anyone still wants old MatPlotLib 1.0.0 for some reason :
1) download from my Harmattan repository : python-matplotlib-data_1.0.0-1_all.deb python-matplotlib_1.0.0-1_armel.deb 2) install dependencies, as root in Terminal : # apt-get install python-central python-support python-numpy python-dateutil python-gobject python-cairo 3) install MatPlotLib 1.0.0, again as root in Terminal, in the same directory where the files where downloaded : # dpkg -i python-matplotlib-data_1.0.0-1_all.deb # dpkg -i python-matplotlib_1.0.0-1_armel.deb 4) configure MatPlotLib 1.0.0, in Terminal as root : # mkdir /usr/lib/python2.6/dist-packages/matplotlib/mpl-data As user : $ cd ~ $ rm -rf .matplotlib $ mkdir .matplotlib $ echo 'datapath : /usr/share/matplotlib/mpl-data' > .matplotlib/matplotlibrc MatPlotLib 1.0.0 has no interactive graphical backend, so "show()" doesn't work, instead use "savefig" command to save plots to files. MatPlotLib 1.2.0 is a lot simpler to install (see 1st post) and has more features on MeeGo Harmattan. See the benchmark of MatPlotLib 1.0.0 x 1.2.0 in the previous post. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
NumPy 1.7.0 is released today (11/02/2013), just one day after the mainstream release.
MatPlotLib is compatible with both NumPy 1.4.1 (from Nokia repositories) and v1.7.0 (from my Harmattan repository). See the benchmarks in post #32 above. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
MatPlotLib 1.2.0 Harmattan1 from 09/02/2013 had an error (dependency of NumPy limited to v1.5) which was fixed late yesterday (10/02/2013). So who installed MatPlotLib 1.2.0 in 09-10/02/2013, please reinstall it, as root in Terminal :
# apt-get install --reinstall python-matplotlib |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
This is an awesome program !!!
Thank you developer :) |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
(12/02/2013) MatPlotLib 1.2.0-2 Harmattan is released, now the interactive Qt4/PySide default backend opens in full screen, so Nokia N9/N950 screen is better used.
See the 1st post to install/update, i.e., "apt-get update" then "apt-get install python-matplotlib" as root in Terminal. Before the new release : Ahahhh, I've figured out how to show the Qt4/PySide backend in full screen :) Just one new line of code, PyQt4/PySide rocks ! And it deserves a new version : Matplotlib 1.2.0 Harmattan2. See the new IPython 0.13.1-3 which fixes the bug which prevented dialog boxes to work on Qt4 backend, so save button, vkb on text fields, etc, don't work . With MatPlotLib 1.2.0-2 and IPython 0.13.1-3, your Nokia N9/N950 will show Qt4/PySide backend in full screen and with working dialogs boxes. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
(06/06/2013) MatPlotLib 1.2.1 is released for MeeGo Harmattan.
MatPlotLib 1.2.1 (26/03/2013) is an upstream bug fix release for v1.2.0 (08/01/2013). It needs NumPy >= 1.7.x, even if it asks for NumPy 1.4.1. See next version for this dependency fix. MatPlotLib 1.2.1 Harmattan is based on Ubuntu 13.04 version and MatPlotLib 1.2.1 source code, without Python 3 support, no debug package, adapted dependencies to MeeGo Harmattan, etc. See the 1st post to install/update, i.e., "apt-get update" then "apt-get install python-matplotlib" as root in Terminal. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
(15/06/2013) MatPlotLib 1.2.1-2 Harmattan released, just to force NumPy 1.7.x as dependency.
For some reason, MatPlotLib 1.2.1 needs NumPy 1.7.x to compile and also to run, while MatPlotLib 1.2.0 only needed NumPy 1.4.0. |
Re: [Announce] MatPlotLib - 2D & 3D plots for MeeGo Harmattan
Thanks, irulestar. There is a depency, "python-dateutil", needed by MatPlotLib 1.2.1 but not listed. Until I release a new MatPlotLib version (1.3.1 or 1.4.0) in the following days, a workaround is to install "python-dateutil" in Terminal (with developer mode on) :
$ devel-su then type the root password (default is 'rootme'), then # apt-get install python-dateutil |
All times are GMT. The time now is 01:12. |
vBulletin® Version 3.8.8