bugGNU Octave - Bugs: bug #60691, Legend unaware of new...

 
 

bug #60691: Legend unaware of new "scatter" graphics object

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Fri 28 May 2021 08:56:31 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
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
   

Jump to the original submission

Tue 01 Jun 2021 11:15:03 PM UTC, comment #10: 

I'm okay just letting gnuplot functionality wither.

Rik <rik5>
Group administrator
Tue 01 Jun 2021 08:24:00 PM UTC, comment #9: 


>> Should we re-instate the logic that adds the legend for hggroups tagged "__scatter__"?


If you care enough (I don't) that is probably the simplest route, just like we did for legend.m: when using gnuplot we could fallback to the old code path, using hggroup objects, then the old legend code would probably be happy again.

Pantxo Diribarne <pantxo>
Group Member
Tue 01 Jun 2021 06:52:43 PM UTC, comment #8: 

I opened bug #60720 for the issue with multi-line titles with gnuplot because this seems to be unrelated to scatter and to legend.

For the regression here: Should we re-instate the logic that adds the legend for hggroups tagged "__scatter__"?
Or is it ok to let gnuplot slowly die?

Markus Mützel <mmuetzel>
Group administrator
Sun 30 May 2021 03:22:25 PM UTC, comment #7: 

Yeah. Looks like multiline titles broke...


close all
graphics_toolkit gnuplot
title({'test1', 'test2'})


Markus Mützel <mmuetzel>
Group administrator
Sun 30 May 2021 03:13:45 PM UTC, comment #6: 

For me, running the demos for scatter using the gnuplot toolkit  leads to warnings (errors?) like

gnuplot> size and color of markers determined by algorithm" font ":Bold,11" textcolor rgb "
         ^
         line 0: invalid command


So it seems like not only `legend` but also `scatter` is broken.

Pantxo Diribarne <pantxo>
Group Member
Sun 30 May 2021 02:22:30 PM UTC, comment #5: 

Works correctly for me now with the qt graphics toolkit.
But legends for scatter objects seem to be broken with the gnuplot toolkit now:

close all
graphics_toolkit gnuplot
demo scatter 1
legend


Markus Mützel <mmuetzel>
Group administrator
Sun 30 May 2021 12:15:13 PM UTC, comment #4: 

I pushed a patch in which I chose to use scatter objects also for the legend icon:

http://hg.savannah.gnu.org/hgweb/octave/rev/6375e8ed2838

Marking ready for test.

Pantxo Diribarne <pantxo>
Group Member
Fri 28 May 2021 11:30:56 PM UTC, comment #3: 

Attached is a quick patch.  "scatter" objects used to be of type hggroup with a tag of "__scatter__".  The first fix was just to recognize "scatter" as a valid type of graphics object.

However, the patch isn't perfect because there needs to be a translation of properties from the scatter plot to the patch object used to draw the icon in the legend.  In particular, "markeredgecolor" property on the patch object probably needs to be the "cdata" property from the "scatter" object if "markeredgecolor" is a string like "flat".

(file #51496)

Rik <rik5>
Group administrator
Fri 28 May 2021 10:10:41 PM UTC, comment #2: 

You are right, "scatter" objects were introduced in 7.0.

Pantxo Diribarne <pantxo>
Group Member
Fri 28 May 2021 10:08:42 PM UTC, comment #1: 

I changed the Release field to "dev" rather than "6.2.0" as this still appears to work on stable.

Rik <rik5>
Group administrator
Fri 28 May 2021 08:56:31 PM UTC, original submission:  

As the title says, the legend function should be updated to allow scatter entries:


>> x = randn (100, 1);
>> y = randn (100, 1);
>> scatter (x, y);
>> legend ();
error: legend: no valid object to label
error: called from
    legend>parse_opts at line 778 column 7
    legend at line 210 column 8


Pantxo Diribarne <pantxo>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #51496:  bug60691.v1.cset added by rik5 (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (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
    2021-08-01 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-05-30 pantxo StatusConfirmed Ready For Test
    2021-05-28 rik5 Attached File- Added bug60691.v1.cset, #51496
    2021-05-28 rik5 Release6.2.0 dev

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code