patchGNU Octave - Patches: patch #10043, [octave forge] (statistics) Add...

 
 

patch #10043: [octave forge] (statistics) Add function gscatter

Submitter:  None
Submitted:  Wed 10 Mar 2021 07:28:05 PM UTC
   
 
Category:  Forge : new function Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  philipnienhuis Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 27 Mar 2021 11:40:17 AM UTC, comment #7: 
Philip Nienhuis <philipnienhuis>
Group Member
Mon 22 Mar 2021 09:22:31 PM UTC, comment #6: 

OK, it should be all OK now.

(file #51118)

Anonymous
Sun 21 Mar 2021 07:38:41 PM UTC, comment #5: 

L.222 of gscatter.m still has 'legend ( ... , "best")' which hasn't been implemented and therefore provokes a warning.
Could you please fix this?
I'd suggest something along the lines of
warning ("off", <warning-id>, "local")
as

  • the warning will be automatically neutralized as soon as "best" has been implemented in the running Octave version
  • it ensures backward compatibility with Octave releases where it hasn't been implemented.


I'm unsure about the warning id, probably around L.400 in legend.m

Philip Nienhuis <philipnienhuis>
Group Member
Tue 16 Mar 2021 06:45:24 PM UTC, comment #4: 

New revision. Now it uses line objects instead of multiple scatter plots. The default marker is still '.', however this displays a tiny point in Octave, while in MATLAB it should display a filled circle.

(file #51077)

Anonymous
Sat 13 Mar 2021 05:49:51 PM UTC, comment #3: 

Yeah the first warning is sometimes a PITA, I wonder what purpose it has. I see it in various other occasions as well.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 13 Mar 2021 04:57:13 PM UTC, comment #2: 

OK, I'll look into it.
The warnings when running the demo in Octave 6.2 are OK: the first one is for loading data from path (which is where the fisheriris  data should be), while the second one is about a non-essential, but mildly useful, option, which is currently not available in Octave.

Anonymous
Sat 13 Mar 2021 03:51:49 PM UTC, comment #1: 

Thank you this contribution.

Running the demo in Octave-6.2.0, I get:

>> demo gscatter
gscatter example 1:
 load fisheriris;
 X = meas(:,3:4);
 cidcs = kmeans (X, 3, "Replicates", 5);
 gscatter (X(:,1), X(:,2), cidcs, [.75 .75 0; 0 .75 .75; .75 0 .75], "os^");
 title ("Fisher's iris data");

warning: load: 'C:\Programs\Octave\octave-6.2.0-w64-64\mingw64\share\octave\packages\statistics-1.4.2\fisheriris.mat' found by searching load path
warning: called from
    __demo__ at line 3 column 2
    demo at line 154 column 7

warning: legend: 'best' not yet implemented for location specifier, using 'northeast' instead


The plot looks otherwise nice.

In octave-7.0.0 there's a warning that is a tad different:

gscatter example 1: failed
legend: no valid object to label


and the plot looks a bit incomplete.

Would you please look into these?

Could you please also supply a complete cset, i.e., with changes to Index.in and NEWS? not strictly required but it makes processing patches a bit easier here.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 10 Mar 2021 07:28:05 PM UTC, original submission:  

This patch adds function 'gscatter', which is nothing more than a wrapper for 'scatter' to be used with grouped data.

There is an explanatory demonstration in the patch.

Major differences with MATLAB:

  • it returns an array of graphics handle to scatter plots, instead of an array of Line objects.
  • by default MATLAB uses the input variable name as label for the axis (e.g. gscatter(X, Y, g) shows a plot with the axes named 'X' and 'Y'), I tried something similar but it does not work, it returns an empty string.
  • the default symbol for the scatter plot is '.' which is a filled circle in MATLAB and a small point in Octave (a small point which cannot be resized apparently).


To be effectively used with 'kmeans' and 'silhouette'.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #51118:  gscatter.diff added by None (9KiB - text/x-patch - warning suppression)
file #51077:  gscatter.diff added by None (9KiB - text/x-patch - plot with line objects +index.in +news)
file #51039:  gscatter.diff added by None (8KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (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 logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-27 philipnienhuis StatusNone Done
        Assigned toNone philipnienhuis
        Open/ClosedOpen Closed
    2021-03-22 None Attached File- Added gscatter.diff, #51118
    2021-03-16 None Attached File- Added gscatter.diff, #51077
    2021-03-10 None Attached File- Added gscatter.diff, #51039

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code