bugGNU Octave - Bugs: bug #46469, Changing papersize and...

 
 

bug #46469: Changing papersize and paperposition leads to cropped images while printing to PDF or PNG

Submitter:  None
Submitted:  Wed 18 Nov 2015 09:26:50 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Jens Potschadtke Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 Nov 2017 09:45:00 AM UTC, comment #4: 

Thanks. Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Mon 13 Nov 2017 09:36:41 AM UTC, comment #3: 

Original submitter here:

I just tested it with GNU Octave, version 4.2.1
Octave was configured for "x86_64-w64-mingw32".

The two bugs have gone away.
The script now produces plots as PDF and PNG without any cropping and even without sleep() all plots get generated.

Bug report can be closed!

Thanks for fixing!
Jens

Anonymous
Thu 09 Nov 2017 12:30:40 PM UTC, comment #2: 

Can someone check that this issue is still present with Octave 4.2 on Windows? I see nothing obviously wrong on linux with the original example.

Pantxo Diribarne <pantxo>
Group Member
Wed 03 Feb 2016 08:03:31 PM UTC, comment #1: 

It looks like bug #46292.
The outcome was that octave will stick to matlab nonsense:
Even with "physical" units,
for printing, the units are turned to "normalized",
and then interpreted as positions relative to "paperposition"
for the actual printing.

ederag <ederag>
Wed 18 Nov 2015 09:26:50 AM UTC, original submission:  

This affects Octave 4.0.0 on Windows 7 64 bit installed as 32 bit Cygwin package.

Printing the a plot with the default renderer and the following script leads to two problems:

  • cropped images
  • broken pipe or similar errors when omitting the sleep between prints which leads to image test02.pdf not being generated


When setting the graphics_toolkit to "fltk", the images are produced correctly but with broken pipe for the print without sleep.

myPaperSize = [30, 10];
myBorder = [1, 1];
data = rand(50,1);

#graphics_toolkit ("fltk");
plot(data);
#set(gcf,"paperunits","inches");
set(gcf,"paperunits","centimeters");
#set(gcf,"paperpositionmode","manual");
#set(gcf,"paperorientation","landscape");
set(gcf,"papertype","<custom>");
set(gcf,"papersize",myPaperSize);
set(gcf,"paperposition",[myBorder, myPaperSize-myBorder]);


title ("Plot 01")
xlabel "Timestamp [samples]";
ylabel "Interval [ms]";
sleep(1);
print "test01.pdf" -dpdf
sleep(1);
print "test01.png" -dpng



clf;
plot(data);
title ("Plot 02 without sleep")
print "test02.pdf" -dpdf
print "test02.png" -dpng


The images have the correct aspect ratio and correct size (PDF), but the image contains only about one quarter (upper left corner) of the plot.
I can see the plot window temporarely being resized to the correct aspect ratio and I see the full plot inside the image. But during export as PNG (PDF has the same problem) the image gets cropped and only about a quarter of the image gets saved.

The execution of the script above in a file named plotsize.m produces the following error on the prompt:

$ octave plotsize.m
warning: print.m: fig2dev binary is not available.
Some output formats are not available.
warning: called from
    __print_parse_opts__ at line 385 column 9
    print at line 288 column 8
    plotsize.m at line 21 column 1
warning: gl2ps-renderer::draw: empty feedback buffer and/or nothing else to print
/bin/sh: /usr/bin/gs: Bad address
/bin/sh: /usr/bin/rm: Bad address


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35487:  test01.pdf added by None (3KiB - application/pdf)
file #35488:  test02.png added by None (30KiB - image/png)
file #35489:  test01.png added by None (29KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by ederag (Posted a comment)
  • -email is unavailable- added by None (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-13 pantxo StatusNone Fixed
        Open/ClosedOpen Closed
    2017-11-09 pantxo CategoryPlotting Plotting with OpenGL
    2015-11-18 None Attached File- Added test01.pdf, #35487
        Attached File- Added test02.png, #35488
        Attached File- Added test01.png, #35489

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code