Free Python optimization framework

Sunday, December 9, 2007

minor changes in graphics

As I had already mentioned, matplotlib still suffer some drawbacks.
For to avoid one of them one more OO graphics parameter have been implemented: show (boolean). It means does OpenOpt have to call pylab.show() function after solver finish or not.

p.show = {True} | False | 0 | 1
or p = NLP(f, x0,..., show=1,...) (other OO classes can be used as well)

It should be equal to False for some certain cases, for example in benchmark of some solvers or when some code should be run immediately after solver finish, no waiting for user to close the matplotlib window. When all calculations will be done and you finally want to handle your picture (resize, save, etc) user should call it by himself:
import pylab
pylab.show()
or
from pylab import show
show()
or
from pylab import *
show()

I have to notice: MATLAB plotting tool doesn't suffer the inconvenience, in OO for MATLAB/Octave version there were no needs to implement the feature. Maybe, in future this pylab drawback will be fixed and the "show" parameter will became unused.

No comments: