bugGNU Octave - Bugs: bug #37337, Legend not working for hggroup...


bug #37337: Legend not working for hggroup objects with linestyles

Submitted by:  Rik <rik5>
Submitted on:  Wed 12 Sep 2012 06:11:44 PM UTC  
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

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


Sat 09 Nov 2013 06:39:24 PM UTC, comment #4:

Fixed by this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/5fbab07c419f). Closing report.

Rik <rik5>
Project Administrator
Sat 09 Nov 2013 04:57:55 PM UTC, comment #3:

This bug is related to bug 36480 and can be fixed with this patch

Stefan Mahr <dac922>
Sat 15 Sep 2012 05:52:42 PM UTC, comment #2:

Thanks for looking at this. The problem is not the color of the lines, which is picked up, but the marker style ('*' or 'x' or 'd') which isn't in the legend.

Here is some more sample code:

This draws two plots and places a legend on the graph. The line object drawn with the plot command correctly has the marker 'X' in the legend. The hggroup drawn with errorbar doesn't have the 'O' marker in the legend. I've attached a png of the output.

(file #26558)

Rik <rik5>
Project Administrator
Sat 15 Sep 2012 04:30:31 PM UTC, comment #1:

it seems to work on latest dev source.
See attached copy of gnuplot print on cygwin

(file #26557)

marco atzeri <matzeri>
Wed 12 Sep 2012 06:11:44 PM UTC, original submission:

The legend command is not working for certain plots that have hggroup objects. Although it is picking up the correct color, it is not picking up the marker style correctly.

Example code:

The issue is in legend.m when it picks out which objects to annotate. It is moving down below the hggroup object into the individual line objects which make up the errorbars. These lines don't have a marker property because that is something only the hggroup has.

I think this may be a general issue. In example 16 from legend.m there is a bar chart created which uses hggroups and patch objects underneath those. If I change the patch object color directly and update the legend then the color is changed, despite the fact that the hggroup color remains what it previously was set to.

Rik <rik5>
Project Administrator


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

Attach File(s):

Attached Files
file #26558:  plot.png added by rik5 (17KiB - image/png)
file #26557:  errorbar.png added by matzeri (17KiB - image/png)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by dac922 (Posted a comment)
  • -unavailable- added by matzeri (Updated the item)
  • -unavailable- added by rik5 (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 09 Nov 2013 06:39:24 PM UTCrik5StatusNone=>Fixed
    Tue 08 Oct 2013 12:33:13 AM UTCrik5Dependencies-=>bugs #36480 is dependent
    Sat 15 Sep 2012 05:52:42 PM UTCrik5Attached File-=>Added plot.png, #26558
    Sat 15 Sep 2012 04:30:31 PM UTCmatzeriAttached File-=>Added errorbar.png, #26557

    Back to the top

    Powered by Savane 3.1-cleanup1