bugGNU Octave - Bugs: bug #49341, demo legend 14 produce error with...


bug #49341: demo legend 14 produce error with gnuplot

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Fri 14 Oct 2016 09:12:39 AM UTC  
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Avinoam Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


( Jump to the original submission)

Sun 16 Oct 2016 07:26:54 PM UTC, comment #9: 

I tweaked the hggroup patch slightly

diff -r 078c0c4d205d scripts/plot/util/private/__gnuplot_draw_axes__.m
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m        Sun Oct 16 02:23:54 2016 -0500
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m        Sun Oct 16 12:20:34 2016 -0700
@@ -613,7 +613,7 @@ function __gnuplot_draw_axes__ (h, plot_

       case "line"
         if (strcmp (get (obj.parent, "type"), "hggroup"))
-          hg = get (obj.parent, 'children');
+          hg = get (obj.parent, "children");
           if (hg(1) == h_obj && ! isempty (get (obj.parent, "displayname")))
             data_idx += 1;
             is_image_data(data_idx) = false;
@@ -646,7 +646,7 @@ function __gnuplot_draw_axes__ (h, plot_
               withclause{data_idx} = sprintf ("with %s linestyle %d",
                                               errbars, sidx(1));
-              # Place phantom stemseries data for legend
+              ## Place phantom stemseries data for legend
               data{data_idx} = nan (2,1);
               usingclause{data_idx} = sprintf ("record=1 using ($1):($2)");
               hgobj = get (obj.parent);
@@ -1196,9 +1196,9 @@ function __gnuplot_draw_axes__ (h, plot_

       case "surface"
         view_map = true;
-        tspec = "title \"\"";
+        tspec = 'title ""';
         if (! isempty (obj.displayname))
-          # Place phantom line data for approximate legend symbol
+          ## Place phantom line data for approximate legend symbol
           data_idx += 1;
           is_image_data(data_idx) = false;
           parametric(data_idx) = false;

to follow some Octave coding guidelines.

It was applied here http://hg.savannah.gnu.org/hgweb/octave/rev/5ab3c91fc4bb.

Fixed, closing report.

Rik <rik5>
Project Administrator
Sun 16 Oct 2016 10:38:29 AM UTC, comment #8: 

Applying this patch fixed the error in legend 14, as well in other demos

Avinoam Kalma <avinoam>
Project Member
Sun 16 Oct 2016 07:33:16 AM UTC, comment #7: 

Attached is a fix for the legend entry of some more hggroup objects.  I've done what I can as far as almost-correct legend symbols.  One of gnuplot's limitations is in the area of keys and key entries.  I wish it was done differently however many years ago now.  In order to construct a key with both lines and points, someone devised a new style 'linespoints': sounds good, but it is so restrictive once other styles are introduced, e.g., error bars and boxes, etc.  Then try remember the names.  It would have been much nicer if one could specify "plot <mydata> with lines ... and points ..." such that all of those items appear in the key symbol.

Anyway, try the following:

demo legend 17
demo legend 18
demo legend
demo errorbar

The stem series of legend 17 demo illustrates how a circle and line can be in the key IF the two are the same color.  But linespoints can't have different colors for lines and for points, so those two have to be done separately--hence cannont be in the same key symbol.

(file #38738)

Dan Sebald <sebald>
Sat 15 Oct 2016 04:34:39 PM UTC, comment #6: 

Forgot attachment...

(file #38736)

Dan Sebald <sebald>
Sat 15 Oct 2016 04:33:06 PM UTC, comment #5: 

OK, that's me.

Attached is a change to demo 17 which adds a second subplot with another hggroup, stems.  (The error bars hggroup is covered well by the errorbar.m demos.)  I think those are all the hggroup object collections.

The patch doesn't fix anything as far as bugs, but it brings out a couple issues in both OpenGL and gnuplot toolkits.  For OpenGL, the legend placement doesn't seem quite right in subplots and there is an axes border for only one of the subplots.  For gnuplot, the legends are wrong.

By the way, for stems the proper legend graphic is simply the stem marker, is that correct?  There is no other line in the legend like might be done for error bars?

Dan Sebald <sebald>
Sat 15 Oct 2016 09:51:52 AM UTC, comment #4: 

@Dan: I pushed your patch for legend demo 23 here (http://hg.savannah.gnu.org/hgweb/octave/rev/37b7b86f62f2).

The name change to autopos_tag took place on the development branch.  I have no problems running legend demos 26, 27, 28.  You might need to clean out cruft with 'make distclean' and then re-run configure and make.

Rik <rik5>
Project Administrator
Sat 15 Oct 2016 07:58:00 AM UTC, comment #3: 

OK, I see this.  There are multiple hggroup regression problems here.  I will find a fix for that on the development branch.

On the stable branch there are a couple of general problems with legend demos that should be fixed beyond the above.  Attached is a fix for a typo in demo 23.

Also, Rik could you have a look at demos 26, 27 and 28:

octave:23> demo legend 26
legend example 26:
x = 0:10;
y1 = rand (size (x));
y2 = rand (size (x));
[ax, h1, h2] = plotyy (x, y1, x, y2);
title ("plotyy legend test #1: Blue and Green labels");
legend ([h1, h2], {"Blue", "Green"}, "location", "south");

legend example 26: failed
get: unknown axes property autopos_tag

I see there is extensive use of property 'autopos_tag' in the C++ file "libinterp/corefcn/graphics.cc.  Is this 'autopos_tag' one of the hidden variables that was changes to _autopos_tag_?

(file #38734)

Dan Sebald <sebald>
Fri 14 Oct 2016 02:08:37 PM UTC, comment #2: 

Confirmed.  I added a dependency on bug #49260 which is what the original cset was trying to fix.

Rik <rik5>
Project Administrator
Fri 14 Oct 2016 11:20:47 AM UTC, comment #1: 

The problem is in line 711 of _gnuplot_draw_axis_, and it is only in the dev branch, because it is caused by
http://hg.savannah.gnu.org/hgweb/octave/rev/54332b6ddeb6 which wasn't applied to the stable branch.

Avinoam Kalma <avinoam>
Project Member
Fri 14 Oct 2016 09:12:39 AM UTC, original submission:  

>> demo legend 14
legend example 14:
x = linspace (0, 10);
plot (x, x);
hold on;
stem (x, x.^2, "g");
title ("First created object gets first label");
legend ("linear");
hold off;

error: get: unknown hggroup property format
error: called from
    __gnuplot_draw_axes__ at line 711 column 13
    __gnuplot_draw_figure__ at line 172 column 17
    __gnuplot_drawnow__ at line 86 column 5

It is marked as regression because in in 4.2-rc2 there is n such problem

Avinoam Kalma <avinoam>
Project Member


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

Attach Files:


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by sebald (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by avinoam (Submitted the item)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam

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

    Only project members can vote.




    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-16 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-10-16 sebald Attached File- => Added octave-gnuplot_hggroup_legend_bug49341-djs2016oct16.patch, #38738
    2016-10-15 sebald Attached File- => Added octave-legend_demo_17_bug49341-djs2016oct15.patch, #38736
    2016-10-15 sebald Attached File- => Added octave-legend_demo_23_bug49341-djs2016oct15.patch, #38734
    2016-10-14 rik5 StatusNone => Confirmed
    2016-10-14 rik5 Dependencies- => Depends on bugs #49260
    2016-10-14 avinoam Operating SystemMicrosoft Windows => Any
    2016-10-14 avinoam Carbon-Copy- => Added a.kalma@gmail.com
        Carbon-Copy- => Added daniel.sebald@ieee.org

    Back to the top

    Powered by Savane 3.5