bugGNU Octave - Bugs: bug #47191, contourf plot doesn't print...

 
 

bug #47191: contourf plot doesn't print correctly to pdf (Windows only)

Submitter:  None
Submitted:  Thu 18 Feb 2016 02:34:17 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Michael Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 09 Nov 2017 04:41:41 PM UTC, comment #21: 

Closing report.  The issue with spurious anti-aliasing lines is a different issue.

Rik <rik5>
Group administrator
Wed 08 Nov 2017 10:34:05 PM UTC, comment #20: 

AFAICS the original issue is gone (no more missing patches). This probably due to the fact that 2D figures are now drawn and printed without depth sorting.

The vertical lines are a known issue which is tracked in bug #45494.

Can I mark this bug fixed and close the report?

Pantxo Diribarne <pantxo>
Group Member
Wed 08 Nov 2017 08:42:13 PM UTC, comment #19: 

A pic with the results on windows 7 is attached.
Left the .pdf, right Octave's figure window.

The pdf shows some vertical light-colored traces


Philip Nienhuis <philipnienhuis>
Group Member
Wed 08 Nov 2017 10:04:26 AM UTC, comment #18: 

Can someone check that this bug is still present with the current dev Octave?

Pantxo Diribarne <pantxo>
Group Member
Mon 21 Nov 2016 10:46:14 PM UTC, comment #17: 

I've simplified the original test case.  The new m-file is tst_pdfshading.m, along with the data file shading_data.var.

Within Octave, execute


tst_pdfshading


The resulting output file is out2.pdf and it is clearly very different from the onscreen plotted result.  I tested this in a Windows XP virtual machine with Octave-4.2.0 [w32].  On Linux, everything works correctly.



(file #39042, file #39043)

Rik <rik5>
Group administrator
Mon 21 Nov 2016 07:38:50 PM UTC, comment #16: 

I checked with Octave 4.2.0 (w64) under Windows 8.1. the result is attached and is still not displayed correctly.

files:
out1_20161121.pdf
out2_20161121.pdf

(file #39040, file #39041)

Anonymous
Sun 20 Nov 2016 06:28:14 PM UTC, comment #15: 

Can the original reporter re-test with the newly release Octave-4.2.0?

Rik <rik5>
Group administrator
Mon 29 Feb 2016 09:10:35 AM UTC, comment #14: 

I submitted a comment to the other bug report, linking it to this one.

Thank you for your help everyone!

Anonymous
Mon 29 Feb 2016 09:02:53 AM UTC, comment #13: 

I believe the issue with missing colors in the colorbar has been fixed in default (the future 4.2 release): gl2ps now treats the axes and the colorbar (another axes by the way) in two independent depth trees so this should also be fixed once Octave 4.2 is released.

We don't generally merge bug reports but it may be useful to make a comment in the report of  bug #47217 stating that z-level issues can be triggered by contourf and point to this report. Can you do that?

Pantxo Diribarne <pantxo>
Group Member
Mon 29 Feb 2016 08:41:20 AM UTC, comment #12: 

Adding those lines before printing helped for the PDF output. Both PDF plots look fine now.

EPS output (out2.eps) looks fine, too. However, out1.eps is missing a legend on the 'colorbar' and the right part of the contour plot stays blank.

out1.svg and out2.svg are missing the colours in the 'colorbar', while the legend is being shown.

In conclusion, your workaround seems to solve the problems for PDF output only. Thank you very much for pointing this out, though!


Is there a way to merge this bug reports with the one you just mentioned?

(file #36503)

Anonymous
Fri 26 Feb 2016 06:07:34 PM UTC, comment #11: 

If it is a culling problem in gl2ps then maybe forcing the depth would be a workaround.

Does adding the following before printing change anything?


ch = get (get (gca, "children"), "children");
sz = cellfun (@numel, get (ch, "xdata"));
zz = linspace (1, 0, numel (ch));
arrayfun (@(h, z, n) set (h, "zdata", ones (n, 1) * z), ch, zz', sz)


If so then it may be somewhat related to bug #47217: the order of objects in the children stack is not always respected and should be forced in some way.

Pantxo Diribarne <pantxo>
Group Member
Fri 26 Feb 2016 07:16:45 AM UTC, comment #10: 

So, what kind or problem are we looking at? Is it a bug with Octave or GL2ps or can this issue be solved another way?

Best regards,
Michael

Anonymous
Tue 23 Feb 2016 04:58:41 PM UTC, comment #9: 

So no doubt octave 4.0.1-rc3 is using the most recent gl2ps.

Pantxo Diribarne <pantxo>
Group Member
Tue 23 Feb 2016 04:01:49 PM UTC, comment #8: 

Here is the svg output from Octave 4.0.0 and the RC 3 version.

The renderer actually changed, but the output is still erroneous.

(file #36439, file #36440, file #36441, file #36442)

Anonymous
Tue 23 Feb 2016 10:00:17 AM UTC, comment #7: 

@OP: just to make sure the last release candidate for windows makes use of the most recent gl2ps, can you run the following and report back:


image ();
print foo.svg


If the image is properly saved then this is gl2ps 1.3.9, the fixed version.

Can you also attach the svg output of the original failing example?

Pantxo Diribarne <pantxo>
Group Member
Tue 23 Feb 2016 07:41:56 AM UTC, comment #6: 

@Mike: Thank you for this tip.


Regarding my reported problem with the 'fltk' and 'qt' toolkits: Is there a solution to this or are we looking at a bug?

Best regards,
Michael

Anonymous
Sun 21 Feb 2016 07:51:36 PM UTC, comment #5: 

You may want to ask your gnuplot-related usage questions on the help mailing list help@octave.org.

Mike Miller <mtmiller>
Group Member
Sat 20 Feb 2016 09:28:34 AM UTC, comment #4: 

Hello again,

I checked the output with octave-4.0.1-rc3. Please note that I used a different computer, running Windows 10/64bit. Even though, I believe the latter does not make a difference. Octave had never been installed on this machine before.

The output ist still subject to the same faulty behaviour. 'gnuplot' yields valid output to pdf, while 'fltk' and 'qt' fail (files attached).

Besides: Is there a way to (automatically) fix the placement of the xlabel and ylabel, when using 'gnuplot'?

Kind regards,
Michael

(file #36408, file #36409, file #36410)

Anonymous
Fri 19 Feb 2016 10:10:23 AM UTC, comment #3: 

Hi,

I can't reproduce either on linux but this may well be due to a bug in gl2ps which could show differently in different opengl implementations: the current version of octave on windows (and on linux) uses gl2ps 1.3.8 which was affected by a bug that make some patches be hidden behind others. As I believe that the latest mxe-builds for windows uses the latest version of gl2ps (1.3.9), can the OP test octave 4.0.1 release candidate:

http://alpha.gnu.org/gnu/octave/octave-4.0.1-rc3.zip

@Mike:
The diagonal line are a known bug: patches are tesselated into smaller triangles and the lines you see are an artifact of anti-aliasing. I don't think ghostscript is responsible, but rather that the viewer behaves differently with eps and pdf files.

Pantxo Diribarne <pantxo>
Group Member
Fri 19 Feb 2016 07:56:07 AM UTC, comment #2: 

Thank you for your quick response.

I re-created both files with the graphics_toolkit 'gnuplot'. Please check the results below. There are white areas (e.g. top left), whereas the 'qt' and 'fltk'-based files are completely grey in these areas.

Thus, the graphs are not consistent between 'gnuplot' and for example 'qt', especially because the scaling on the colorbar is the same.

(file #36394, file #36395)

Anonymous
Thu 18 Feb 2016 07:11:56 PM UTC, comment #1: 

I see faint vertical line artifacts in the output, but I don't see wrong colors when comparing against the gnuplot output or against the original eps output file.

Try printing to an eps file and compare against the pdf. I see much fainter vertical line artifacts in that file, it seems that ghostscript is enhancing those artifacts in the pdf conversion.

Mike Miller <mtmiller>
Group Member
Thu 18 Feb 2016 02:34:17 PM UTC, original submission:  

Hello,

I am running Octave 4.0.0 under Windows 7/64bit and experience a problem when saving a plot.

The figure is created using the contourf command. When I save the file to PDF using the print command, the filled areas show the wrong colors, when compared to the colorbar.

This occurs for the graphics_toolkit 'fltk' and 'qt'; 'gnuplot' works fine, even though it messes up the xlabel und ylabel positions.

Besides, there appear to be artifacts within the filled areas.

Please advise.

Kind regards,
Michael

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39042:  tst_pdfshading.m added by rik5 (298B - d2l/unknowntype)
file #39043:  shading_data.var added by rik5 (48KiB - application/octet-stream)
file #39040:  out1_20161121.pdf added by None (18KiB - application/pdf)
file #39041:  out2_20161121.pdf added by None (18KiB - application/pdf)
file #36503:  out_test.zip added by None (352KiB - application/zip)
file #36440:  out1.svg added by None (194KiB - image/svg+xml)
file #36441:  foo_rc3.svg added by None (7KiB - image/svg+xml)
file #36442:  out1_rc3.svg added by None (194KiB - image/svg+xml)
file #36439:  foo.svg added by None (7KiB - image/svg+xml)
file #36408:  out1_4.0.1RC3_fltk.pdf added by None (18KiB - application/pdf)
file #36409:  out1_4.0.1RC3_gnuplot.pdf added by None (15KiB - application/pdf)
file #36410:  out1_4.0.1RC3_qt.pdf added by None (18KiB - application/pdf)
file #36394:  out1_gnuplot.pdf added by None (15KiB - application/pdf)
file #36395:  out2_gnuplot.pdf added by None (15KiB - application/pdf)
file #36382:  test.m added by None (370B - application/octet-stream - test.m loads the variables from values.mat)
file #36383:  values.mat added by None (196KiB - application/octet-stream - test.m loads the variables from values.mat)
file #36384:  out1.pdf added by None (18KiB - application/pdf - test.m loads the variables from values.mat)
file #36385:  out2.pdf added by None (18KiB - application/pdf - test.m loads the variables from values.mat)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-09 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-11-08 philipnienhuis Attached File- Added Bug47191_comm19.PNG, #42351
    2016-11-21 rik5 Attached File- Added tst_pdfshading.m, #39042
        Attached File- Added shading_data.var, #39043
        Release4.0.0 4.2.0
        Summarycontourf with false colour when saving to pdf contourf plot doesn't print correctly to pdf (Windows only)
    2016-11-21 None Attached File- Added out1_20161121.pdf, #39040
        Attached File- Added out2_20161121.pdf, #39041
    2016-02-29 pantxo StatusNeed Info Confirmed
    2016-02-29 None Attached File- Added out_test.zip, #36503
    2016-02-23 None Attached File- Added foo.svg, #36439
        Attached File- Added out1.svg, #36440
        Attached File- Added foo_rc3.svg, #36441
        Attached File- Added out1_rc3.svg, #36442
    2016-02-20 None Attached File- Added out1_4.0.1RC3_fltk.pdf, #36408
        Attached File- Added out1_4.0.1RC3_gnuplot.pdf, #36409
        Attached File- Added out1_4.0.1RC3_qt.pdf, #36410
    2016-02-19 None Attached File- Added out1_gnuplot.pdf, #36394
        Attached File- Added out2_gnuplot.pdf, #36395
    2016-02-18 mtmiller CategoryPlotting Plotting with OpenGL
        StatusNone Need Info
    2016-02-18 None Attached File- Added test.m, #36382
        Attached File- Added values.mat, #36383
        Attached File- Added out1.pdf, #36384

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code