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

 
 

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

Submitter:  Rik <rik5>
Submitted:  Wed 12 Sep 2012 06:11:44 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
Sat 09 Nov 2013 04:57:55 PM UTC, comment #3: 
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:


hold on
plot (1:10, "bx")
errorbar (1:10, 0.5:0.5:5, 1, "ro")
legend ("x plot", "o errorbar")


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.



Rik <rik5>
Group 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


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:


x = 1:10;
y1 = 1:10;
y2 = 0.5*y1;
y3 = 2*y1;
errorbar (x,y1,1,"~x", x,y2, 0.5,"~o", x,y3,2,"~d")
legend ({"err1", "err2", "err3"})


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>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

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

Digest:
   bug dependencies.

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2013-11-09 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2013-10-08 rik5 Dependencies- bugs #36480 is dependent
    2012-09-15 rik5 Attached File- Added plot.png, #26558
    2012-09-15 matzeri Attached File- Added errorbar.png, #26557

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code