bugGNU Octave - Bugs: bug #50417, overplotting contour over imagesc...

 
 

bug #50417: overplotting contour over imagesc fails (gnuplot)

Submitter:  ryusuke numata <rnumata>
Submitted:  Tue 28 Feb 2017 08:49:40 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Dec 2017 04:47:49 PM UTC, comment #3: 

This bug has been fixed on the stable branch an will be part of the 4.2.2 bug fix release due at the end of this year.

Rik <rik5>
Group administrator
Tue 28 Feb 2017 08:00:24 PM UTC, comment #2: 

This looks like something that was never tested upon making some kind of change to address something specific to the Qt gnuplot terminal.

Here's what Octave generates for gnuplot to process:


plot "-" binary array=101x101 scan=yx origin=(0,0) dx=0.01 dy=0.01 using 1 title "" with image; \
if (GPVAL_TERM eq "qt") unset obj 1;
unset obj 2; \
plot "-" binary format='%float64' record=40 using ($1):($2) title "" with linespoints linewidth 0.500000 pointtype -1 dashtype solid pointsize 0.666667 lc rgb "#ff0000" \


There is a continuation character ('\') at the end of the plot command, then some separate gnuplot command conditional which has nothing to do with the plot command, then a new plot command.  That obviously is wrong.

Here's the code from _gnuplot_draw_axes_.m that generate the offending lines:


      elseif (is_image_data (i-1))
        if (bg_is_set)
          fputs (plot_stream, "if (GPVAL_TERM eq \"qt\") unset obj 1;\n");
          bg_is_set = false;
        endif
        if (fg_is_set)
          fputs (plot_stream, "unset obj 2; \\\n");
          fg_is_set = false;
        endif
        fprintf (plot_stream,"%s \"-\" binary format='%%float64' %s %s %s \\\n",
                 plot_cmd, usingclause{i}, titlespec{i}, withclause{i});


The logic here is obviously wrong, given there is no special consideration just a few lines above that would leave off the continuation character ('\').  I will look into this.

Dan Sebald <sebald>
Tue 28 Feb 2017 04:57:45 PM UTC, comment #1: 

Confirmed.  I used gnuplot 5.0.1 on Linux for testing.  This is just one of the reasons that Octave development has moved away from gnuplot towards qt.  As a workaround use one of the OpenGL toolkits such as qt or fltk.

When running the sample code I get the following errors


multiplot> A
           ^
           line 0: invalid command


multiplot> 8B
           ^
           line 0: invalid command


multiplot> ?�.J�?���Q��?��Q��?��P�O�?~q1���?{�G�z�?C@4c�G�?�������?q=
            ^
           line 0: invalid character


There are pages and pages of similar errors which all seem to show binary input from Octave delivered to the multiplot command line.

Rik <rik5>
Group administrator
Tue 28 Feb 2017 08:49:40 AM UTC, original submission:  

When I overplot contour over imagesc, I get lots of unreadable errors and a wrong image as attached.


x=0.:0.01:1.;
y=x;
z=cos(2.*pi*x')*sin(2.*pi*y);
hold on;
imagesc(x,y,z);
contour(x,y,z,'r');


The same code with graphics_toolkit('qt') seems working fine.

For older versions of octave (4.0.3),  contour lines are not shown for both graphics toolkits.

I'm using gnuplot 5.0, I've tested on mac and linux.

ryusuke numata <rnumata>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39846:  error.tiff added by rnumata (27KiB - image/tiff)
file #39847:  contour_imagesc.png added by rnumata (22KiB - image/png)

 

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 sebald (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rnumata (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-13 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-02-28 rik5 Carbon-CopyRemoved 72865 -
    2017-02-28 rik5 StatusNone Confirmed
        Release4.2.0 4.2.1
        Summaryoverplotting contour over imagesc fails overplotting contour over imagesc fails (gnuplot)
        Carbon-Copy- Added sebald
    2017-02-28 rnumata Attached File- Added error.tiff, #39846
        Attached File- Added contour_imagesc.png, #39847
        Attached File- Added contour_imagesc_4.0.3.png, #39848

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code