octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49698] Setting PNG output resolution and size


From: anonymous
Subject: [Octave-bug-tracker] [bug #49698] Setting PNG output resolution and size in print command overwrites resolution
Date: Fri, 25 Nov 2016 09:08:34 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

URL:
  <http://savannah.gnu.org/bugs/?49698>

                 Summary: Setting PNG output resolution and size in print
command overwrites resolution
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri Nov 25 09:08:32 2016
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Wysi
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.3
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Task: Saving a figure to .png as it appears on the screen, using both size and
resolution options (e.g. -S800,500, -r600). 
Result: While both Options alone work, setting them together overwrites the
rsolution with 72. 

Example code: 

figure(1,'Position',[100,100,800,500]); 
plot(randn(100,2))
title('test'); ylabel('y axis'); xlabel('x axis');
pos=get(gcf,'Position');
print('-dpng', 'test.png',
'-r600',['-S',num2str(pos(3)),',',num2str(pos(4))]);

The output is of very much lower resolution, probably 72 (cf. below). 

The problem may be related to code in the function
scripts/plot/util/private/__print_parse_opts__.m, where it says around line
367:

arg_st.ghostscript.resolution = 72;

Simply commenting out this line, the output looks as expected. However, this
is probably not the solution for all cases. 




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49698>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]