bugGNU Octave - Bugs: bug #52838, implement print keyword 'fillpage'

 
 

bug #52838: implement print keyword 'fillpage'

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Mon 08 Jan 2018 08:03:13 PM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Avinoam Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 20 Nov 2018 10:45:20 PM UTC, comment #10: 

This turned out to be a lot of work to implement once documentation and cleaning up to Octave coding standards was complete.  I checked in the changeset here (https://hg.savannah.gnu.org/hgweb/octave/rev/9cfbe7688368) under Jun Wang's name.  I also added Jun Wang to the list of contributors to Octave.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sun 11 Nov 2018 02:41:11 AM UTC, comment #9: 

@jwe: Did you want to check in the patch on this bug report.  You were only waiting for the Author field which "Jun Wang" has provided.

Rik <rik5>
Group administrator
Sun 28 Oct 2018 08:43:03 AM UTC, comment #8: 

Thanks for your review. You could use name "Jun Wang" in changeset and contributors file.

JunWang <junwang>
Fri 26 Oct 2018 07:20:11 PM UTC, comment #7: 

JunWang: Sorry for the delay in looking at this.  I'd like to apply this changeset.  Please let me know how you'd like to be credited so I can give you credit in the changeset and add your name to the contributors file.

John W. Eaton <jwe>
Group administrator
Thu 22 Mar 2018 06:10:41 PM UTC, comment #6: 

I add '-fillpage' and '-bestfit' for print.
These resize options don't change 'paperposition' property of figure.


f = figure;
plot(1:10);
get(f, "paperposition");
print("FillPageFigure", "-dpdf", "-fillpage");
get(f, "paperposition");

Matlab ouput:
ans =
    1.3333 3.3125 5.8333 4.3750

ans =
    1.3333 3.3125 5.8333 4.3750

Octave ouput:
ans =
   0.25000   2.50000   8.00000   6.00000

ans =
   0.25000   2.50000   8.00000   6.00000




(file #43633)

JunWang <junwang>
Tue 09 Jan 2018 08:23:37 PM UTC, comment #5: 

This looks really easy to implement if someone wants to try it.  Just need to detect the option and then set the PaperPosition property.  Should check with Matlab, does using 'bestfit' alter the PaperPosition property or does it save/restore the current value during printing?

Rik <rik5>
Group administrator
Mon 08 Jan 2018 08:42:49 PM UTC, comment #4: 

This seems to be a new Matlab option to print:

https://www.mathworks.com/help/matlab/creating_plots/save-figure-at-specific-size-and-resolution.html

Maybe this should also be marked as a feature request to implement this option, as well as "-bestfit".

Rik <rik5>
Group administrator
Mon 08 Jan 2018 08:40:20 PM UTC, comment #3: 

From the help text for print


     The 'print' command supports many OPTIONS:

     '-fH'
          Specify the handle, H, of the figure to be printed.  The
          default is the current figure.


So for "-fillpage" Octave is trying the handle "illpage" which obviously isn't valid.  It seems the print function is behaving as it should.

Rik <rik5>
Group administrator
Mon 08 Jan 2018 08:31:10 PM UTC, comment #2: 

Is '-fillpage' a Matlab option for print?  I don't find it in any of the Octave help text


cd doc/interpreter
grep 'fillpage' *.texi



Rik <rik5>
Group administrator
Mon 08 Jan 2018 08:06:44 PM UTC, comment #1: 

sorry, markup problems:


>> plot (1:10)
>> print ('a.pdf', '-dpdf', '-fillpage')
error: print: no figure to print
error: called from
    print at line 340 column 5


The bug is triggered in line 157 of __print_parse_opts__


   elseif (length (arg) > 2 && arg(1:2) == "-f")
        arg_st.figure = str2num (arg(3:end));


a quick and dirty fix is to change line 159 to


      elseif (any (strcmp (arg, {"-painters", "-opengl", "-fillpage"})))


and move lines 159-160 before line 157



Avinoam Kalma <avinoam>
Group Member
Mon 08 Jan 2018 08:03:13 PM UTC, original submission:  




>> plot (1:10)
>> print ('a.pdf', '-dpdf', '-fillpage')
error: print: no figure to print
error: called from
    print at line 340 column 5


The bug is triggered in line 157 of __print_parse_opts__


   elseif (length (arg) > 2 && arg(1:2) == "-f")
        arg_st.figure = str2num (arg(3:end));
-verbatim+

a quick and dirty fix is to change line 159 to

+verbatim+
      elseif (any (strcmp (arg, {"-painters", "-opengl", "-fillpage"})))


and move lines 159-160 before line 157

Avinoam Kalma <avinoam>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #43633:  print-resize-option.patch added by junwang (4KiB - text/x-patch - implementation of 'fillpage' and 'bestfit')

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by junwang (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by avinoam (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 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-20 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-10-26 jwe Priority5 - Normal 3 - Low
        Item GroupMatlab Compatibility Feature Request
        StatusConfirmed Patch Submitted
    2018-03-22 junwang Attached File- Added print-resize-option.patch, #43633
    2018-01-27 rik5 Severity3 - Normal 1 - Wish
        Release4.2.1 dev
        Summaryproblem with print keyword 'fillpage' implement print keyword 'fillpage'
    2018-01-09 rik5 Item GroupIncorrect Result Matlab Compatibility
    2018-01-08 rik5 StatusWorks For Me Confirmed
    2018-01-08 rik5 StatusNeed Info Works For Me
    2018-01-08 rik5 StatusNone Need Info
    2018-01-08 avinoam Summaryproblem with print keyword 'filpage' problem with print keyword 'fillpage'

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code