Archive for September 1st, 2015

ggplot for python calling kivy matplotlib backend

September 1st, 2015 No comments

Based on the grammar of graphics, ggplot is a library for plotting graphs in R. By doing some readings seems like ggplot is a very good choice to produce multi-layered graphs. I found a package for python which provides a ggplot structure wrapped into matplotlib instructions. I gave it a try by installing it from source and then, since the library is heavily depending on matplotlib I changed the backend by default to use kivy by placing these two lines on top of each example tested:

import matplotlib

The main advantage in my case is the minimum set of instructions required for creating plots. Some resources can be found here I have not fully tested it but I am giving it a try. ggplot

Matplotlib backend kivy in Windows hands on

September 1st, 2015 7 comments

The backend implementations for matplotlib in kivy work just with kivy versions greater or equal than 1.9.1. It is required to install kivy in development mode following these steps: After step 10 you can additionally run

python install

The script kivy.bat creates an environment in which some python tools are ready to use, for instance pip. The next step is to download numpy and matplotlib from this binaries repositories: and Once downloaded install both using pip and then install kivy-garden and the matplotlib package for kivy.

pip install "numpy-1.10.0b1+mkl-cp27-none-win32.whl"
pip install "matplotlib-1.4.3-cp27-none-win32.whl"
pip install kivy-garden
garden install matplotlib

You can go now to the folder that by default garden packages are installed. In my case C:\Users\my_user\.kivy\garden\

cd garden.matplotlib/examples

And you should be able to see the matplotlib widget working on windows. Follow the steps from to create a shortcut to execute your kivy apps.

Now you can go directly to the garden path using a file explorer, do right click on and send to kivy-2.7.bat which will start the application.

Categories: kivy, matplotlib Tags: , ,