bugGNU Octave - Bugs: bug #38666, gnuplot and imagesc prints garbled...


bug #38666: gnuplot and imagesc prints garbled image for certain matrix sizes for sufficently large colormap size

Submitted by:  None
Submitted on:  Fri Apr 5 16:56:49 2013  
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 3 - LowItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: John SchneelochOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Wed Nov 16 19:50:58 2016, comment #5:

I'm not sure there is any good solution, other than jettisoning gnuplot.

When the size of the data transferred is larger than the max size of the SW pipe used for communication between Octave and gnuplot then there are problems. See /proc/sys/fs/pipe-max-size for the maximum size in the current kernel. At least in Linux, a particular pipe can be resized, on the fly, with

as long as the size does not exceed pipe-max-size.

I suppose there might be a way to recode _gnuplot_draw_now_ to send data over in chunks. But will gnuplot on the other side understand when it has only received partial input and needs to wait?

Rik <rik5>
Project Administrator
Wed Nov 16 19:40:10 2016, comment #4:

Still confirmed with the development version of Octave (4.3.0+) and gnuplot 5.

Mike Miller <mtmiller>
Project Administrator
Sun Apr 7 18:22:16 2013, comment #3:

The result is confirmed. It is definitely a problem with the interaction with gnuplot--the FLTK backend seems to work just fine. I tried Octave versions 3.6.4 and a recent development tip as well as gnuplot versions 4.4.3 and 4.6.2.

Rik <rik5>
Project Administrator
Sun Apr 7 05:10:01 2013, comment #2:

I've attached garbled and non-garbled versions of the plot for nsize = 99 and ncolors = 257 for the garbled version, ncolors=256 for the non-garbled one. (I think I reported the direction of the gradient in the wrong direction, by the way.) According to the graphics_toolkit command, I'm using gnuplot.

(file #27799, file #27800)

Sat Apr 6 00:02:12 2013, comment #1:

Can you upload the generated png file that is in error so we can take a look at it. Also, are you using gnuplot or FLTK for plotting? That also makes a big difference.

Rik <rik5>
Project Administrator
Fri Apr 5 16:56:49 2013, original submission:

While making plots using imagesc, I ran into this weird bug. Sometimes the image displays fine in AquaTerm but the plot saved with the "print" command produces a garbled output. Below is the simplest example I could come up with, which displays a rainbow gradient (red in the lower right corner to blue in the upper left), but when saved produces a png file with red horizontal bands crossing the image, blue speckles, and pieces of the image displaying in the wrong locations. As far as I can tell, the result is garbled only for ncolors (the number of colors in the colormap) greater than 256, and only for certain nsize values (e.g., 103 is bad, 100-102 are fine, 99 is bad, etc.)



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

Attach File(s):

Attached Files
file #27799:  garbled.png added by None (17kB - image/png)
file #27800:  notgarbled.png added by None (21kB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Nov 16 19:40:10 2016mtmillerPriority5 - Normal=>3 - Low
      Summaryimagesc prints garbled image for certain matrix sizes for sufficently large colormap size=>gnuplot and imagesc prints garbled image for certain matrix sizes for sufficently large colormap size
    Sun Apr 7 18:22:16 2013rik5CategoryPlotting=>Plotting with gnuplot
      StatusNeed Info=>Confirmed
      Operating SystemMac OS=>Any
      Carbon-Copy-=>Added -unavailable-
    Sun Apr 7 05:10:01 2013NoneAttached File-=>Added garbled.png, #27799
      Attached File-=>Added notgarbled.png, #27800
    Sat Apr 6 00:02:12 2013rik5StatusNone=>Need Info

    Back to the top

    Powered by Savane 3.1-cleanup1