From: John H. <jdh...@ac...> - 2004-05-03 14:37:40
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@fi...> writes: Flavio> from matplotlib.backends.backend_wx import Toolbar, Flavio> FigureCanvasWx, FigureManager Flavio> do you think this can be the problem? If So How should I Flavio> change it to make it right? Oh... so now you tell me :-) ! This is definitely a problem. Yes, you should do from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWx, FigureManager The backend switching mechanisms (eg -d, matplotlib.use, matplotlibrc) are for the matlab interface. You are using the API directly and so these do not apply. Note that the toolbar and the figure manager are the same in backend_wx and backend_wxagg (the latter just imports them directly from the former). So if you want to easily switch between backend_wx or backend_wxagg (ie to test performance or use a different one if yo encounter troubles) you can do from matplotlib.backends.backend_wxagg import Toolbar, FigureManager from matplotlib.backends.backend_wxagg import FigureCanvasWx as FigureCanvas Then use FigureCanvas in your code to instantiate new canvases. Switching back to the wx canvas (native wx drawing rather than agg drawing) is as simple as changing the one line to from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas Hope this helps, John |