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.
|
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.
|
Sun 21 Oct 2012 01:38:06 AM UTC, comment #9:
Rik,
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?
|
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.
|
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)
|
Sat 20 Oct 2012 01:55:55 PM UTC, comment #6:
The diff below works properly for pdf/ps output
|
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.
|
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.
|
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.
|
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.
|
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.
|
Thu 11 Oct 2012 11:51:16 PM UTC, original submission:
set(gcf, 'Position', [800 300 500 600])
t=0:.1:10*pi;
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.
|