On Tuesday 06 February 2007 01:28:10 pm Gerhard Spitzlsperger wrote:
> I am new to matplotlib and playing around with it. I am interested in
> embedding in Qt, displaying TeX within such a window and finally
> save the plot as postscript.
[...]
> and modified the (according agg_oo example):
>
> def compute_initial_figure(self):
[...]
> function, to create labels (with TeX) but they are not displayed.

The example you posted works fine for me. Are you sure you have installed and 
properly configured all the required external dependencies? See 
http://www.scipy.org/Cookbook/Matplotlib/UsingTex for more details.

> Additionally if I include self.print_figure("test.eps")
>
>    File "embedding_in_qt.py", line 67, in compute_initial_figure
>      self.print_figure("test.eps")
>    File
> "D:\APPS\PYTON2~1\Lib\site-packages\matplotlib\backends\backend_qtagg.py",
> line 159, in print_figure
>      agg = self.switch_backends( FigureCanvasAgg )
>    File
> "D:\APPS\PYTON2~1\Lib\site-packages\matplotlib\backend_bases.py", line
> 944, in switch_backends
>      newCanvas = FigureCanvasClass(self.figure)
> AttributeError: figure

Your class MyMplCanvas needs a figure attribute. Change all self.fig 
references to self.figure (see attached).

Darren

Attachment: EmbeddingInQt_UseTeX.py
Description: application/python

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to