hi Mike,
no it is WxAgg, the code is here:
-----
import wx
import os
import matplotlib
matplotlib.use('WxAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
from matplotlib.figure import Figure
import matplotlib.numerix as numpy
class PlotFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Test Printing with WX Backend")
self.fig = Figure(None, 100)
self.canvas= FigCanvas(self, -1, self.fig)
self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75])
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
self.Fit()
self.Plot_Data()
def Print_Data(self):
self.canvas.printerData.SetPaperId(wx.PAPER_A4)
self.canvas.printerData.SetOrientation(wx.LANDSCAPE)
dpi = self.canvas.figure.dpi.get()
self.canvas.figure.dpi.set(200)
self.canvas.Printer_Print()
self.canvas.figure.dpi.set(dpi)
self.canvas.draw()
def Plot_Data(self):
t = numpy.arange(0.0,5.0,0.01)
s = numpy.sin(2.0*numpy.pi*t)
c = numpy.cos(0.4*numpy.pi*t)
self.axes.plot(t,s)
self.axes.plot(t,c)
if __name__ == '__main__':
app = wx.PySimpleApp()
fig = PlotFrame()
fig.Show(True)
fig.Print_Data()
app.MainLoop()
---------------------
But you got a point with usetex : I set it to False and then no more
traceback, though the preview indicates that LANDSCAPE mode was not
applied.
So : WxAgg seems to have issues with usetex=True, and LANDSCAPE request
does not seem to be honored... I am using svn revision 4797.
best, and happy New Year!
Johann
Michael Droettboom wrote:
> From the traceback, it looks as if you are using the Wx backend, not the
> WxAgg
> backend, and you are using "usetex" (text rendering using (La)TeX). The Wx
> backend does not support usetex -- the WxAgg backend does. Check your
> matplotlibrc or your matplotlib.use command and make sure you're selecting
> the
> WxAgg backend.
>
> Cheers,
> Mike
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users