bugGNU Octave - Bugs: bug #64956, contour plots should accept...

 
 

bug #64956: contour plots should accept "edgecolor" property for Matlab compatibility

Submitter:  None
Submitted:  Fri 01 Dec 2023 01:21:09 PM UTC
   
 
Category:  Plotting Severity:  2 - Minor
Priority:  4 Item Group:  Feature Request
Status:  Patch Submitted Assigned to:  None
Originator Name:  cochard Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 7.3.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Dec 2023 02:37:36 PM UTC, comment #5: 

I'm changing the item group to feature request because handling edgecolor is a new feature for contour.

If Octave already accepted edgecolor then it could be a compatibility issue if Octave did something reasonable but different from Matlab or it could just be an incorrect result if the behavior wasn't reasonable.

John W. Eaton <jwe>
Group administrator
Mon 04 Dec 2023 02:08:39 PM UTC, comment #4: 


>> Thanks a lot for the detailed answer and the clarification about edge

and face colors -- I had not thought about that.

>> I still think that 'color' is the most natural property to think about

(at least considering the current documentation of contour, both
Octave & ML) , since (1) it is what 'plot' --the main plotting
function-- uses, (2) only the lines are important when 'contour' is
used (by default at least), (3) when 'contourf' is used, the lines are
not so important, plus they are several face colors anyway.

>> So maybe this is the reason why ML still supports 'color'?


>> What would be the big deal of Octave supporting it as well, at least

until ML suppresses it?  There could be a warning message like
"'color' might be suppressed in the future, use 'edgecolor' instead".

>> At least it might be nice to also point to 'edgecolor' instead of just

the message "error: set: unknown hggroup property Color".

@OP: Please answer directly on the savannah web interface, mail answers are not supported.

One of the main reasons why Octave doesn't support most undocumented ML "features" is as I said : we may well be working to introduce a "feature" that will disappear in the next ML version (it has happened to me as a contributor for some root figure properties, I won't do the same mistake twice!). In short the "big deal" is the finite, small,  number of developers and the very large number of missing documented features that those dev could work on. 

Now if you think the doc is unclear, you are very welcome to propose a modification that would make it more in line with how things really work.



Pantxo Diribarne <pantxo>
Group Member
Sun 03 Dec 2023 07:45:15 PM UTC, comment #3: 

I attached a patch.

(file #55396)

Pantxo Diribarne <pantxo>
Group Member
Sun 03 Dec 2023 03:48:35 AM UTC, comment #2: 

Changing title to reflect comment #1 and changing item group to Matlab Compatibility.

Rik <rik5>
Group administrator
Fri 01 Dec 2023 08:02:48 PM UTC, comment #1: 

According to ML doc, "linecolor", which Octave uses, is now discouraged in favor of "edgecolor". So, rather than adding the undocumented property "color" (probably a relic of old ML syntax that they well could forbid without warning in a future version), Octave should introduce the official "edgecolor" property in order to make ML code, written against documented properties, run fine in Octave as well.

As for the difference between `plot` and `contour`: The `plot` function produces line objects, and the "color" property makes sense because it directly refers to the color of the main object, the line. On the other hand, the `contour(f)` functions essentially produce groups of patch objects, which have both edge and face colors, hence the distinction.



Pantxo Diribarne <pantxo>
Group Member
Fri 01 Dec 2023 01:21:09 PM UTC, original submission:  

I am aware of https://savannah.gnu.org/bugs/?41096, which says that

   'color' isn't a supported property of a contour group.

and that 'linecolor' can be used, but I still find annoying that something works in matlab but not in octave.

Everything below is with matlab 9.11.0.1809720 (R2021b) Update 1 and octave 7.3.0.

The 4 following intructions work OK in both


plot((1:2), (1:2), 'Color', 'Red');
plot((1:2), (1:2), 'color', 'Red');
plot((1:2), (1:2), 'Color', 'red');
plot((1:2), (1:2), 'color', 'red');


Also, using


peaks(100);


the 4 following intructions work OK in matlab but fail in octave


contour(z, [4, 4], 'Color', 'Red')
contour(z, [4, 4], 'color', 'Red')
contour(z, [4, 4], 'Color', 'red')
contour(z, [4, 4], 'color', 'red')


giving the error

error: set: unknown hggroup property Color

At least I'd say that the documentation ('help contour') is not explicit enough, an excerpt being:

     The appearance of contour lines can be defined with a line style
     STYLE in the same manner as ‘plot’. 

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55396:  bug64956.patch added by pantxo (3KiB - 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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -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 group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-04 jwe Item GroupMatlab Compatibility Feature Request
    2023-12-03 pantxo Attached File- Added bug64956.patch, #55396
        StatusConfirmed Patch Submitted
    2023-12-03 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 4
        Item GroupDocumentation Matlab Compatibility
        StatusNone Confirmed
        Operating SystemGNU/Linux Any
        Summary'color' isn't a supported property of a contour group but... it should. Or doc should be more explicit contour plots should accept "edgecolor" property for Matlab compatibility

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code