bugGNU Octave - Bugs: bug #59819, Boundary of plot for printing is...

 
 

bug #59819: Boundary of plot for printing is incorrect for plotyy with a legend

Submitter:  Dmitry <dam239>
Submitted:  Mon 04 Jan 2021 04:22:14 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 6.1.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 03 Mar 2022 04:10:10 PM UTC, comment #4: 

Are there any progress?

Dmitry <dam239>
Tue 05 Jan 2021 07:46:24 PM UTC, comment #3: 

Confirmed.  I've re-titled to more specifically highlight what I believe the issue is.  plotyy() is a difficult function and is made more complicated by the addition of a legend object.  During the print routine Octave seems to be calculating the size of the figure incorrectly.

I'm attaching a copy of the script from comment #2 so testers can just download and run.  I'm all CC'ing the developer Pantxo who understands quite a bit about legend objects and printing.

(file #50662)

Rik <rik5>
Group administrator
Tue 05 Jan 2021 12:59:27 PM UTC, comment #2: 

Here is an script example which does not work on windows 10 with octave 6.1 release.
A generated svg file is attached
Quite interestingly, it works without "legend" command

function  test_saveas()
   close all
   f = figure;
   x1 = (0:0.1:12)';
   x2 = (0:0.01:10)';
   ysin = 100*sin(x1);
   ycos = 10*cos(x2);  
   [p1,h1,h2] = plotyy(x1,ysin ,x2,ycos);
   set(h2,'color','red') 
   set(h1,'color','black')
   set(p1(1),'fontsize', 18);
   set(p1(2),'fontsize', 18);
   xlabel('x')
   ylabel(p1(1),'100sin(x)')
   ylabel(p1(2),'10cos(x)')
   legend('100sin(x)','10cos(x)','Location','southeast')
   title('Test saveas function')

   saveas(f,'a.jpg')
   saveas(f,'a.svg')
 
end


(file #50657)

Dmitry <dam239>
Mon 04 Jan 2021 04:46:36 PM UTC, comment #1: 

Could you be more specific about the sequence of commands you use and the graphics toolkit you are using?  This works fine for me, albeit on Linux.


close all
graphics_toolkit qt
sombrero
# Use mouse to execute File Menu->Save As
# type in name "tst.ofig"
# type <RETURN>


The file is saved and there is are no changes to the displayed figure for me.

Rik <rik5>
Group administrator
Mon 04 Jan 2021 04:22:14 PM UTC, original submission:  

saveas function destroys current figure as saves it incorrectly

Dmitry <dam239>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50662:  tst_saveas.m added by rik5 (499B - text/x-matlab)
file #50657:  a.svg added by dam239 (32KiB - image/svg+xml)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dam239 (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
    2021-01-05 rik5 Attached File- Added tst_saveas.m, #50662
        Item GroupNone Incorrect Result
        StatusNeed Info Confirmed
        Operating SystemMicrosoft Windows Any
        SummarySaveas does not work correctly Boundary of plot for printing is incorrect for plotyy with a legend
        Carbon-Copy- Added pantxo
    2021-01-05 dam239 Attached File- Added a.svg, #50657
    2021-01-04 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code