octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSoC project: new graphics backend


From: Eric S. Carlson
Subject: Re: GSoC project: new graphics backend
Date: Sun, 22 Mar 2009 13:44:10 -0700 (PDT)


>>>1. I'd be interested in a brief summary of what is needed to use 
>>>python+matplotlib+Mayavi2 to implement a functional backend 
>>>for Octave.
>>>2. Do you recommend a binary interface, or might a pipe be used?

I am definitely not qualified to make this judgment for Octave in general.
For my work, I created a wxpython GUI shell, and ran Octave as a subprocess.
The shell input through Octave's stdin and monitored stdout for any console
output. After sending commands to Octave, my communication routine would
scan the output for python escape sequences, which were signals to the GUI
to run embedded python commands. After creating the escape sequence, I set
Octave in an indefinite loop until it could open up file(s) output by the
GUI to tell Octave that the python commands had been completed with or
without errors. Python and Octave remained synchronized with this system.

Other than the monitoring, all the plot commands were set up through m
files. I created a directory of modified plot commands and inserted this
directory to be first in the Octave search path.

As hacky as this sounds, it worked beautilfully and performance was at least
as good gnuplot-based plotting. In certain circumstances, the matplotlib UI
can bog down, and it is best to run in non-interactive mode (when making a
lot of subplots or doing a lot of commands to the same plot). In one case
where I created 8 different subplots, each with a title, labels,
annotations, etc, it could take maybe 5-10 seconds to get through them all
in interactive mode while they took less than a second in non-interactive
mode. You should be aware that this same behavior happens when running
matplotlib directly under python 


>>>3. Also, does python allow the plot window position and size to be set?
>>>4. If so, if the window is moved via the mouse, is the python able to  
>>>detect the window was moved and determine the 
>>>new window position/size?

Using my subprocess model under the GUI, it would likely be pretty easy to
set and keep track of the positions. It is also possible to embed the
windows into a notebook panel, etc. 

>>>5. What about the printing capabilities?

Both matplotlib and Mayavi2 allow saving figures in any number of formats,
both through the figure frame or from the command line. I never do this, but
I think that each system allows the creation of a device context that might
allow you to output directly to a printer.

-- 
View this message in context: 
http://www.nabble.com/GSoC-project%3A-new-graphics-backend-tp22611226p22650371.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]