bugGNU Octave - Bugs: bug #33463, legend broken for scatter plots

 
 

bug #33463: legend broken for scatter plots

Submitter:  Ben Abbott <bpabbott>
Submitted:  Thu 02 Jun 2011 12:17:21 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * 3.4.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 16 Mar 2014 06:46:44 PM UTC, comment #8: 

Only 3 years after the initial report, I've pushed a patch for legend and scatter objects (http://hg.savannah.gnu.org/hgweb/octave/rev/3a1a4d587c4e).

Rik <rik5>
Group administrator
Wed 12 Sep 2012 05:26:38 PM UTC, comment #7: 

Still present in the development code.  Re-titling this report to reflect the remaining open issue.  See comment #1 for example code to reproduce the problem.

Rik <rik5>
Group administrator
Mon 13 Aug 2012 02:50:26 PM UTC, comment #6: 

David, See comment #3.  This issue has been fixed on the development branch.  Unless you build from sources, it won't show up until the 3.8.0 release.

Rik <rik5>
Group administrator
Mon 13 Aug 2012 11:47:02 AM UTC, comment #5: 

David,

This list is intended for fixing bugs.  For help with Octave please use the mail-list, help@octave.org.


Ben Abbott <bpabbott>
Group Member
Mon 13 Aug 2012 10:48:51 AM UTC, comment #4: 

I plotted a figure with area. However no legend is rendered, no colour is indicated. Does anyone have any ideas?

Thank you.

t= linspace(0,10,100);
y1=0.5+abs(sin(t));
y2=1.0+abs(sin(t));

figure(1);area(t,y2,'FaceColor','b')  
hold on
area(t,y1,'FaceColor','c')
hold off;
ylabel('sin(t)'); xlabel('t');
legend("lower", "upper");
grid on;set(gca,'Layer','top');
title('Rectified Sine Wave');

David Lai <davidlai>
Sat 09 Jun 2012 12:23:30 AM UTC, comment #3: 

This issue has been partially fixed by Kostas' changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/daad312c8af0).  A single patch object now correctly displays a legend.  However, the first example in this bug report, scatter (), still fails.  The issue is probably connected with hggroups.  Interestingly, both bar graphs and pie charts, which also use hggroups, do work.

Rik <rik5>
Group administrator
Sat 01 Oct 2011 03:40:53 PM UTC, comment #2: 

I"ve been meaning to look at this, but haven't found the time.

Is someone is inclined, I'd start by looking at what is done for 14th demo for legend(). In this instance gnuplot does provide the proper result for patches (which are actually children of hggroups).


demo legend 14


Which produces,


legend example 14:
 clf
 rand_2x3_data1 = [0.341447, 0.171220, 0.284370; 0.039773, 0.731725, 0.779382];
 bar (rand_2x3_data1);
 ylim ([0 1.2]);
 legend ({"1st Bar", "2nd Bar", "3rd Bar"});


However, the fltk backend does not.

Ben Abbott <bpabbott>
Group Member
Sat 01 Oct 2011 03:02:49 PM UTC, comment #1: 

Simpler example code directly using patch which shows that legend is not picking up any data from the patch object.


x = [0 0 1];
y = [0 1 1];
p = patch (x, y, 'red');
legend ("patch1", "location", "southeast");


The text "patch1" is displayed in the legend but no color information.

Rik <rik5>
Group administrator
Thu 02 Jun 2011 12:17:21 PM UTC, original submission:  

The legend does not render correctly for patches. For the example below ...


color = [0; 0.5; 1];
h = scatter ([0.15, 1.15, -1.15],[2.15, 0, 1.15], 25, color);
legend (get (h, 'children'), {'a', 'b', 'c'});


For gnuplot, no legend is rendered, and for FLTK there is no symbol/line/color indicated.

I've attached a pdf illustrating the result from Matlab.

Ben Abbott <bpabbott>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #23494:  matlab.pdf added by bpabbott (86KiB - application/pdf)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-16 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-09-12 rik5 Summarylegend broken for patches legend broken for scatter plots
    2012-06-09 rik5 Carbon-Copy- Added konstantinos poulios <logari81@gmail.com>
    2012-01-08 rik5 Dependencies- bugs #35260 is dependent
    2011-11-30 rik5 Dependencies- bugs #34881 is dependent
    2011-10-01 rik5 StatusNone Confirmed
        Summarybroken legend for patches legend broken for patches
    2011-06-02 bpabbott Attached File- Added matlab.pdf, #23494

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code