bugGNU Octave - Bugs: bug #37554, PaperPositionMode = 'auto' is...


bug #37554: PaperPositionMode = 'auto' is ignored for printing

Submitted by:  None
Submitted on:  Thu 11 Oct 2012 11:51:16 PM UTC  
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: ConfirmedAssigned to: None
Originator Name: Dov KrugerOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Mon 22 Oct 2012 12:08:23 PM UTC, comment #11:

I don't have much time to look at this now ... I just became a father 3 wks ago :-)

Hopefully, someone else can take this on.

Ben Abbott <bpabbott>
Project Member
Mon 22 Oct 2012 03:02:25 AM UTC, comment #10:

Alas, I haven't done much with the graphics code. I'm not sure who the expert is here, but jwe would probably know enough to point you in the right direction.

Rik <rik5>
Project Administrator
Sun 21 Oct 2012 01:38:06 AM UTC, comment #9:


I've been looking at the c++ side, but so far have only gotten frustrated trying to figure out how the paperpositonmode updater should work. Do you have any insight into that?

Ben Abbott <bpabbott>
Project Member
Sat 20 Oct 2012 04:08:51 PM UTC, comment #8:

I just occurred to me that ML is likely using listeners to handle this. So I did a test to confirm.

This means my proposed patches are the wrong approach. Instead graphics.cc and graphics.h.in will need to be modified to properly handle the paperpositionmode and related properties.

Specifically we need the following updaters.

(1) If "position", "paperorientation", or "papersize" are modified and "paperpositionmode" == "auto" update "paperposition" so that the image is centered on the page.
(2) If "paperposition" is modified set "paperpositionmode" to "manual".

Anything else?

If those updaters are added, I think the current implementation for print.m will function correctly.

Ben Abbott <bpabbott>
Project Member
Sat 20 Oct 2012 03:06:41 PM UTC, comment #7:

Thanks Ben. The patch works for me for image formats like png, but ps and pdf outputs still appear scaled.

I've attached the two plots for reference.

(file #26805, file #26806)

Rik <rik5>
Project Administrator
Sat 20 Oct 2012 01:55:55 PM UTC, comment #6:

The diff below works properly for pdf/ps output

Ben Abbott <bpabbott>
Project Member
Sat 20 Oct 2012 03:20:59 AM UTC, comment #5:

I took a quick look. More testing (maybe some tests should be added to the script?) is needed, but this change below should fix this.

Ben Abbott <bpabbott>
Project Member
Tue 16 Oct 2012 11:44:46 PM UTC, comment #4:

The PaperPositionMode property, when set to auto, should use the plot size on screen for the print size. The image should be rendered centered on the page. Instead, printing uses the PaperPosition property values as if PaperPositionMode were set to manual.

Rik <rik5>
Project Administrator
Tue 16 Oct 2012 11:36:23 PM UTC, comment #3:

Agreed that this is bad design feature, but I also believe we need to keep Matlab compatability. I've found another problem. There is a PaperPositionMode property which defaults to manual. When it is set to 'auto', however, it is supposed to print the figure using the current on-screen dimensions. If this were working then you could have exactly what you want. I am going to re-title this report to reflect that bug.

Rik <rik5>
Project Administrator
Tue 16 Oct 2012 11:08:15 PM UTC, comment #2:

If you define a bug as working like matlab, this is a bug. Otherwise, I guess the fact that you have a window and by default it doesn't print is just a really bad feature.

Dov Kruger <dkruger>
Fri 12 Oct 2012 03:31:17 AM UTC, comment #1:

The size of the printed image is set using the PaperPosition property. This is not the same as the on-screen position set using the Position property. Try adjusting the PaperPosition property and verifying that the printed png image is sized differently.

Rik <rik5>
Project Administrator
Thu 11 Oct 2012 11:51:16 PM UTC, original submission:

set(gcf, 'Position', [800 300 500 600])
plot(t, sin(t))
print(gcf, 'test.png', '-dpng');

Only the default window area is printed as a png, not the area appearing on the screen.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #26805:  tst.png added by rik5 (4kB - image/png)
file #26806:  tst.ps added by rik5 (18kB - application/postscript)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by dkruger (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 Oct 2012 03:06:41 PM UTCrik5Attached File-=>Added tst.png, #26805
      Attached File-=>Added tst.ps, #26806
    Tue 16 Oct 2012 11:44:46 PM UTCrik5StatusWont Fix=>Confirmed
      Summaryprint fails on sized windows?=>PaperPositionMode = 'auto' is ignored for printing
    Tue 16 Oct 2012 11:36:23 PM UTCrik5StatusNeed Info=>Wont Fix
    Fri 12 Oct 2012 03:31:17 AM UTCrik5StatusNone=>Need Info

    Back to the top

    Powered by Savane 3.1-cleanup