Monday 23 March 2015

Daunting Task

As of right now:
4 days
9 hours
53 minutes
left for the gsoc proposal, a daunting task indeed.(How did I end up here when I had a early start?)
I have a basic understanding of what needs to be done in the project matplotlib Integration, but I need specifics.
I also need to write the widget that is supposed to do the work of the artist Figure.
Most of my time till now went with familiarizing my self with mpl interface, understanding it, looking at the files backend writers are most concerned with and understanding the kivy drawing api.
All of this stuff needs to be arranged up and put in my research document.



I can write start writing the basic steps for writing a matplotlib backend, that would start with the backend_bases file itself:
Step 1(as given in backend_template):
Copy this to backend_xxx.py and replace all instances of 'template'
with 'xxx'. Then implement the class methods and functions below, and
add 'xxx' to the switchyard in matplotlib/backends/__init__.py and
'xxx' to the backends list in the validate_backend methon in
matplotlib/__init__.py and you're off. You can use your backend with::

import matplotlib
matplotlib.use('xxx')
from pylab import *
plot([1,2,3])
show()

matplotlib also supports external backends, so you can place you can
use any module in your PYTHONPATH with the syntax::
import matplotlib

matplotlib.use('module://my_backend')

where my_backend.py is your module name. This syntax is also
recognized in the rc file and in the -d argument in pylab, e.g.,::
python simple_plot.py -dmodule://my_backend

If your backend implements support for saving figures (i.e. has a print_xyz()
method) you can register it as the default handler for a given file type
from matplotlib.backend_bases import register_backend

register_backend('xyz', 'my_backend', 'XYZ File Format')
...
plt.savefig("figure.xyz")

The files that are most relevant to backend_writers are
matplotlib/backends/backend_your_backend.py
matplotlib/backend_bases.py
matplotlib/backends/__init__.py
matplotlib/__init__.py
matplotlib/_pylab_helpers.py


Important links:

No comments:

Post a Comment