bugGNU Octave - Bugs: bug #49022, "demo light 11" results...

 
 

bug #49022: "demo light 11" results in gnuplot errors

Submitter:  Mike Miller <mtmiller>
Submitted:  Wed 07 Sep 2016 03:49:03 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Dec 2017 06:40:27 PM UTC, comment #4: 

This has been fixed somewhere along the way.  A warning is printed, but nothing disastrous like a broken pipe.  Closing report.

Rik <rik5>
Group administrator
Wed 14 Sep 2016 06:45:03 PM UTC, comment #3: 

The problem seems to be that color has one entry rather than 3.  I can trace this back to


              if ((strcmp (ec, "flat") || strcmp (ec, "interp"))
                  && isfield (obj, "cdata"))
                if (ndims (obj.cdata) == 2
                    && (columns (obj.cdata) == nc
                        && (rows (obj.cdata) == 1
                            || rows (obj.cdata) == 3)))
                  ccol = cdat(:, i);
                elseif (ndims (obj.cdata) == 2
                        && (rows (obj.cdata) == nc
                            && (columns (obj.cdata) == 1
                                || columns (obj.cdata) == 3)))
                  ccol = cdat(i, :);
                elseif (ndims (obj.cdata) == 3)
                  ccol = permute (cdat (:, i, :), [1, 3, 2]);
                else
                  ccol = cdat;
                endif


It seems that cdat is 3xN so that the line picked out is


                  ccol = cdat(:, i);


But that makes ccol a 3x1 vector, rather than a 1x3 vector which is the usual.  If I add a transpose


                  ccol = cdat(:, i).';


then I get a 1x3 vector, but some of the values are negative.  So, whatever cdata is getting produced, it is not RGB.

Rik <rik5>
Group administrator
Thu 08 Sep 2016 06:49:42 AM UTC, comment #2: 

Binary gibberish is the data coming through the pipe.

I think this may be a duplicate of the bug Rik pointed out in a similar bug report:

https://savannah.gnu.org/bugs/?42561

The line for which we put in uint8() as a temporary fix is the source of this as well.  I make the following change:


diff --git a/scripts/plot/util/private/__gnuplot_draw_axes__.m b/scripts/plot/ut
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m
@@ -1010,8 +1010,9 @@ function __gnuplot_draw_axes__ (h, plot_
                 ccol = 255*ccol*[0x1; 0x100; 0x10000];
               endif
             else
+color
               colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"",
-                                   uint8 (255*color));
+                                   uint8 (255*color))
             endif

             sidx = 1;


and amongst all the screen garbage see lines like:


color =  0.18286
colorspec = lc rgb "#2f


That sprintf() is failing because the color has only one element, not the customary three color components.  There is negative numbers in the color data.  I think this is just simply a case of having to run the color data through the cmap, as we've recently added elsewhere for patch colors (recall the green sphere inside a yellow sphere with holes?).  Before fixing though, I'm waiting on some discussion about the way data is organized for markers/patches.

Dan Sebald <sebald>
Wed 07 Sep 2016 03:57:13 PM UTC, comment #1: 

Confirmed.  With gnuplot 5.0.3 it throws the error line you quote, and then a bunch of binary gibberish.

Rik <rik5>
Group administrator
Wed 07 Sep 2016 03:49:03 PM UTC, original submission:  

Running "demo light 11" with any version of gnuplot results in errors like the following


multiplot> splot "-" using 1:2:3:4 title "" with pm3d , "-" binary format='%float64' record=4 using ($1):($2):($3) title "" with lines linewidth 0.500000 dashtype solid lc rgb "#-38 , "-" binary format='%float64' record=4 using ($1):($2):($3) title "" with lines linewidth 0.500000 dashtype solid lc rgb "
                                                                                                                                                                                         ^
           line 3751: unexpected or unrecognized token


I guess that the primary error is the 'lc rgb "#-38', notice not only the value but the lack of ending double quote.

Mike Miller <mtmiller>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-13 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-09-07 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code