bugGNU Octave - Bugs: bug #65051, print command does not render plot...

 
 

bug #65051: print command does not render plot correctly in pdf

Submitter:  Thomas <betdiscart>
Submitted:  Tue 19 Dec 2023 03:14:37 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  BETDiscart Open/Closed:  * Closed
Release:  * 8.4.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 Dec 2023 08:04:26 PM UTC, comment #5: 

Over the past couple years it has become a fairly standard first test for graphics/plotting related issues that have no other obvious problem source.  See
https://docs.octave.org/latest/Hardware-vs-Software-Rendering.html

Glad things are working for you. Closing report as fixed.

Nicholas Jankowski <nrjank>
Group Member
Wed 20 Dec 2023 07:44:21 AM UTC, comment #4: 

Hi Dmitri

Thank you. The print command works fine. How did you know this property would solve the issue?

Thomas

Thomas <betdiscart>
Tue 19 Dec 2023 06:49:30 PM UTC, comment #3: 

Can you try switching to "SoftWare OpenGL Driver" (using a small utility program included with octave installation) and try again?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 19 Dec 2023 06:47:18 PM UTC, comment #2: 

My apologies, I've added a jpg image of the pdf output in the attachment. As you can see, the graph is rendered only partially. Hopefully this gives more insight on the issue.

Thomas <betdiscart>
Tue 19 Dec 2023 06:10:53 PM UTC, comment #1: 

Could you try attaching the PDF again?  It doesn't seem to be present on the bug report.

For what it's worth, I ran your code on Linux with Octave 9.0.1 and the PDF output is correct.


Rik <rik5>
Group administrator
Tue 19 Dec 2023 03:14:37 PM UTC, original submission:  

Hello

I'm trying to print a pdf plot in GNU Octave. I use Octave on a windows machine. The graph is shown on the plot screen when executing the code. Unfortunately the plot does not show the full graph when opening the plot in the PDF document (see attachment).

Strangely enough the issue does not occur when I print the plot in png.


print(h,'Test.png',"-dpng")


Below i have made an example code to illustrate the problem. Does anyone know how to resolve this issue?


close all
clear all
clc

x = [0:0.001:1]';
y = zeros(size(x,1),10);

y(:,1) = arrayfun(@(x) x^(1/5),x);
y(:,2) = arrayfun(@(x) x^(1/4),x);
y(:,3) = arrayfun(@(x) x^(1/3),x);
y(:,4) = arrayfun(@(x) x^(1/2),x);
y(:,5) = arrayfun(@(x) x,x);
y(:,6) = arrayfun(@(x) x^2,x);
y(:,7) = arrayfun(@(x) x^3,x);
y(:,8) = arrayfun(@(x) x^4,x);
y(:,9) = arrayfun(@(x) x^5,x);
y(:,10) = arrayfun(@(x) x^6,x);

h = figure
hold on

for i = 1:10
  plot(x,y(:,i))
end

grid

set(gcf,'papert', '<custom>')
set(gcf,'paperunits','centimeters');
set(gcf,'papersize',[29.7 21])
set(gcf,'paperposition', [1 1 27.7 19])
set(gcf,'defaultaxesposition', [0.15, 0.15, 0.75, 0.75])
set (0,'defaultaxesfontsize', 11)
print(h,'Test.pdf',"-dpdf")


The same issue occurs when the command "saveas" is used.

Thanks in advance

Thomas

Thomas <betdiscart>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55463:  Test.jpg added by betdiscart (103KiB - image/jpeg - The PDF document with a bad rendered graph)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by betdiscart (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-20 nrjank CategoryOctave Function Plotting with OpenGL
        StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Summary[Windows] print command does not render plot correctly in pdf print command does not render plot correctly in pdf
    2023-12-19 betdiscart Attached File- Added Test.jpg, #55463
    2023-12-19 rik5 Summary[Octave] print command does not render plot correctly in pdf [Windows] print command does not render plot correctly in pdf
    2023-12-19 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code