bugGNU Octave - Bugs: bug #35908, Fig is saved in pdf in wrong size

 
 

bug #35908: Fig is saved in pdf in wrong size

Submitter:  Dik Dirk <dikdirk>
Submitted:  Tue 20 Mar 2012 03:09:58 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Mar 2012 03:14:16 PM UTC, comment #4: 

I have submitted a new and probably related bug, see #36014. Maybe your changeset fixes this as well...

Dik Dirk <dikdirk>
Mon 26 Mar 2012 09:39:49 PM UTC, comment #3: 
Ben Abbott <bpabbott>
Group Member
Mon 26 Mar 2012 01:18:26 AM UTC, comment #2: 

I may not get back to this for a few days and don't want to forget what I found.


octave:1> set (gcf, "paperunits", "centimeters")
octave:2> set (gcf, "papersize", [15, 12])
octave:3> get (gcf, "papersize")
ans =

   5.9055   4.7244

octave:4> set (gcf, "papersize", [8.5, 11] * 2.54)
octave:5> get (gcf, "papersize")
ans =

   21.590   27.940


I suspect something wrong with the papersize updater when the papertype is "<custom>". Meaning the bug is in graphics.cc and/or graphics.h.in.

Ben Abbott <bpabbott>
Group Member
Mon 26 Mar 2012 01:07:50 AM UTC, comment #1: 

This is broken in both the stable and default branch (but differently).

For the stable branch, the work around is to specify landscape.


figure()
fplot(@sin,[-1 1])
set(gcf,'PaperUnits','centimeters')
set(gcf,'PaperSize', [15 12])
set(gcf,'PaperPosition',[0 0 15 12])
set(gcf,'Orientation', 'landscape')
drawnow
pause(2)
saveas(gcf,'test.pdf','pdf')


For release 3.6.1, if the units are left in inches and the orientation is specified, then all should work.

I'll look at fixing the default branch.

Ben Abbott <bpabbott>
Group Member
Tue 20 Mar 2012 03:09:58 PM UTC, original submission:  

The following code should produce a pdf in which the figure fills the page, how, this is clearly not the case, see attached pdf.
figure()
fplot(@sin,[-1 1])
set(gcf,'PaperUnits','centimeters')
set(gcf,'PaperSize', [15 12])
set(gcf,'PaperPosition',[0 0 15 12])
drawnow
pause(2)
saveas(gcf,'test.pdf','pdf')

Dik Dirk <dikdirk>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25418:  test.pdf added by dikdirk (3KiB - application/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by dikdirk (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-04-06 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-03-26 bpabbott StatusConfirmed Ready For Test
    2012-03-26 bpabbott StatusNone Confirmed
        Assigned toNone bpabbott
        Release3.6.1 dev
        Operating SystemMicrosoft Windows Any
    2012-03-20 dikdirk Attached File- Added test.pdf, #25418

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code