[matplotlib-devel] How to add a new backend?
Hello,
we want to add a new backend for some specific XML format.
Can I find somewhere a sort of How-To documentation about the required
steps?
In particular I want to avoid modifying the matplotlib installation which
resides in system directories which not every user has access to. Is it
possible to extend the backend base class to a full backend implementation
located below my home directory, and then have matplotlib use this backend?
How would I tell matplotlib about my new class, and how do I prepare things
so that a simple
matplotlib.use('MyXML')
will plot in our file format?
Thanks
Jason
--
View this message in context:
http://www.nabble.com/How-to-add-a-new-backend--tp20089848p20089848.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] How to add a new backend?
John Hunter-4 wrote:
>
> On Tue, Oct 21, 2008 at 8:40 AM, John Hunter <[EMAIL PROTECTED]> wrote:
> import matplotlib
> matplotlib.use('module://my_backend')
>
Unfortunately that doesn't work for me. I get a "ValueError: Unrecognized
backend string "module://mybackend"" in rcsetup.py. Any other suggestions?
Matplotlib ist version 0.98.3.
Here is the output:
$ python
Python 2.5.1 (r251:54863, Mar 7 2008, 03:41:45)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.use("module://mybackend")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 809,
in use
rcParams['backend'] = name
File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 588,
in __setitem__
cval = self.validate[key](val)
File "/usr/lib/python2.5/site-packages/matplotlib/rcsetup.py", line 49, in
__call__
% (self.key, s, self.valid.values()))
ValueError: Unrecognized backend string "module://mybackend": valid strings
are ['ps', 'Qt4Agg', 'FltkAgg', 'GTKAgg', 'agg', 'cairo', 'GTK', 'GTKCairo',
'WXAgg', 'TkAgg', 'QtAgg', 'svg', 'pdf', 'CocoaAgg', 'emf', 'gdk',
'template', 'WX']
>>>
Neither does the -d option work. "python --help" says:
...
-d : debug output from parser (also PYTHONDEBUG=x)
...
How is this option related to plotting backends?
Thanks
Jason
--
View this message in context:
http://www.nabble.com/How-to-add-a-new-backend--tp20089848p20091178.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] How to add a new backend?
John Hunter-4 wrote:
>
> _validate_standard_backends = ValidateInStrings('backend',
> all_backends, ignorecase=True)
> def validate_backend(s):
> if s.startswith('module://'): return s
> else: return _validate_standard_backends(s)
>
>
> Should work...
>
Thanks. Now matplotlib.use('module://...') works.
(The -d option still doesn't, but I don't need it.)
Jason
--
View this message in context:
http://www.nabble.com/How-to-add-a-new-backend--tp20089848p20092273.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
