bugGNU Octave - Bugs: bug #50227, annotation does not know color...

 
 

bug #50227: annotation does not know color property (but it claims to know it)

Submitter:  Hartmut <hardy>
Submitted:  Sat 04 Feb 2017 10:13:08 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
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

Thu 09 Feb 2017 07:00:06 PM UTC, comment #9: 

I made a few small modifications.

1. For comments that stand alone on a line, the prefix is '##'.


## FIXME: ...


2. I changed the warning message to emphasize that it is using the 2-input form of warning, and to use the parser's string concatenation functionality rather than the sprintf functionality of warning, and to use double quotes in the message presented to users which required single quotes for the programmer.


+      case "edgecolor"
+        ## FIXME: Remove "edgecolor" in Octave 4.8
+        warning ("Octave:deprecated-property",
+                 ['annotation: Property "edgecolor" for ' typ ' annotations'...
+                  ' is deprecated and will be removed from a future version'...
+                  ' of Octave.  Use "color" instead.']);
+        set (hre, "edgecolor", get (h, prop));


Checked in here http://hg.savannah.gnu.org/hgweb/octave/rev/5f7c675b3954.

Thanks Markus, closing report.

Rik <rik5>
Group administrator
Tue 07 Feb 2017 07:16:34 PM UTC, comment #8: 

You are right, Pantxo. It would have been a little abrupt to remove that property without deprecation anyway.

The attached patch deprecates "edgecolor" and advices the user to use the new property "color" instead.

Let's see when TMW are going to change the name back...

Markus Mützel <mmuetzel>
Group administrator
Tue 07 Feb 2017 06:25:25 PM UTC, comment #7: 

Sorry I answered too late but I think "edgecolor" actually used to be the name of the property. There are leftover of this in the current ML doc:

>> Example: annotation('rectangle',[.5 .5 .1 .1],'EdgeColor','r') creates a rectangle annotation with a red outline.


and this example runs fine in ML 2015b.

So I think we should deprecate the edgecolor property before removing it.

Pantxo Diribarne <pantxo>
Group Member
Tue 07 Feb 2017 06:06:33 PM UTC, comment #6: 

Attached is a patch that renames the rectangle and ellipse property "edgecolor" to "color" and adds a text for rectangle properties.

(file #39692)

Markus Mützel <mmuetzel>
Group administrator
Sun 05 Feb 2017 05:05:49 PM UTC, comment #5: 

Ok, so I changed the Category back to plotting.

Pantxo Diribarne <pantxo>
Group Member
Sun 05 Feb 2017 02:47:43 PM UTC, comment #4: 

To me this sound like a "typo" in the properties. Shouldn't we just rename the "edgecolor" property into a "color" property?

This mismatch is also present in the "ellipse" annotation object. All other annotation objects seem fine (they have a "color" property).

Hartmut <hardy>
Sun 05 Feb 2017 02:28:28 PM UTC, comment #3: 

This is also a Matlab incompatibility. [1] states that a rectangle annotation does not have an "EdgeColor" property but it has a "Color" property.

[1]: http://de.mathworks.com/help/matlab/ref/annotationrectangle-properties.html

Markus Mützel <mmuetzel>
Group administrator
Sun 05 Feb 2017 09:04:00 AM UTC, comment #2: 

... end of the previous post:


h = annotation ("rectangle");
set (h)


Changing the category to "Documentation"

Pantxo Diribarne <pantxo>
Group Member
Sun 05 Feb 2017 09:02:51 AM UTC, comment #1: 

Hi,

Indeed, the documentation should read "*edge*color". You can see the actual properties of the objects using the "set" function:


h = annotation ("rectangle");
set (h)
-vebratim-

Changin category to "Documentation"

Pantxo Diribarne <pantxo>
Group Member
Sat 04 Feb 2017 10:13:08 PM UTC, original submission:  

This happens in Octave 4.2.0:

graphics_toolkit qt % fltk and gnuplot behave the same
clear, close all
plot(1:10)
annotation("rectangle", [0.4 0.4 0.2 0.2], "color", "red");


The result is an error message:

error: set: unknown hggroup property color


But the help text of annotation does mention the color property:

     "rectangle"
          Construct a rectangle.  POS specifies the "position" property
          of the annotation.

          You may use "facecolor", "color", "linestyle", and "linewidth"
          properties to customize the rectangle background color and
          edge appearance.


And Matlab is supposed to know this option as well, see http://de.mathworks.com/help/matlab/ref/annotation.html#busqlwm

Hartmut <hardy>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39692:  bug50227_annotation_rectangle_color.patch added by mmuetzel (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 rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by hardy (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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-09 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-02-07 mmuetzel Attached File- Added bug50227_annotation_rectangle_color_v2.patch, #39693
    2017-02-07 mmuetzel Attached File- Added bug50227_annotation_rectangle_color.patch, #39692
        StatusConfirmed Patch Submitted
        Release4.2.0 dev
    2017-02-05 pantxo CategoryDocumentation Plotting
        Item GroupDocumentation Matlab Compatibility
    2017-02-05 pantxo CategoryPlotting Documentation
        Item GroupIncorrect Result Documentation
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code