Postscript bug?

"My users" want to see the ps output scaled to A4, which I also think is the correct behaviour. Usually you increase the size of the window on the screen to get a better view of things, but when you want to print the figure it should adjust to the papersize.
Also, how do you know the figure is larger than the papersize?!

f = figure(figsize=(5,4))
# resize with mouse, and when you are ready to save:
f.set_figsize_inches(5,4)
savefig('t.ps')

set_figsize_inches will change the printed output, although it does not seem
to effect the screen size (is this a bug?).

Darren

···

On Thursday 08 September 2005 6:30 pm, Malte.Marquarding@...83... wrote:

"My users" want to see the ps output scaled to A4, which I also think is
the correct behaviour. Usually you increase the size of the window on the
screen to get a better view of things, but when you want to print the
figure it should adjust to the papersize. Also, how do you know the figure
is larger than the papersize?!

Thanks Darren!

I managed to wite a bit of wrapper code to handle this now.
The only bad thing to data is that I hardcode "A4".
Maybe this can be moved into backend_ps.

<snip>
def my_print(self, fname,orientation=None):
    w = self.figure.figwidth.get()
    h = self.figure.figheight.get()
    a4w = 8.25
    a4h = 11.25
    
    if orientation is None:
        # auto-oriented
        if w > h:
            orientation = 'landscape'
        else:
            orientation = 'portrait'
    ds = None
    if orientation == 'landscape':
        ds = min(a4h/w,a4w/h)
    else:
        ds = min(a4w/w,a4h/h)
    ow = ds * w
    oh = ds * h
    self.figure.set_figsize_inches((ow,oh))
    self.canvas.print_figure(fname,orientation=orientation)