bugGNU Octave - Bugs: bug #36156, text (x, y, "Default")...


bug #36156: text (x, y, "Default") -> text object with empty string

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Thu 12 Apr 2012 12:04:30 PM UTC  
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue 19 Mar 2013 08:57:16 PM UTC, comment #6:

I fixed the bug here (http://hg.savannah.gnu.org/hgweb/octave/rev/100a7bd2590e). There is one exception to the fix if "default" is the first row of a multi-row char matrix. Someone else can take up that case if it ever proves worthwhile.

Rik <rik5>
Project Administrator
Fri 15 Mar 2013 03:31:11 AM UTC, comment #5:

OK. The result is a bit long, so it is

(file #27605)

Michael Godfrey <godfrey>
Project Member
Fri 15 Mar 2013 02:28:11 AM UTC, comment #4:

Actually, I want to figure out a bit more about how Matlab is doing things.

Is Matlab case insensitive about 'default' and 'factory'? I kind of doubt it.

Second, I'm wondering if Matlab strips off the cell array around single strings.

Rik <rik5>
Project Administrator
Thu 14 Mar 2013 08:15:06 PM UTC, comment #3:

So it looks like, perhaps, '\default' is implemented and that text() automatically changes "default" to "\default" before calling set ('string', value).

Rik <rik5>
Project Administrator
Thu 14 Mar 2013 07:19:40 PM UTC, comment #2:


I ran the script,

I've attached plots. Only the last includes the backslash, but is also gives the warning below.

(file #27604)

Ben Abbott <bpabbott>
Project Member
Thu 14 Mar 2013 03:45:41 PM UTC, comment #1:

Ben, check Matlab's own documentation (http://www.mathworks.com/help/matlab/creating_plots/setting-default-property-values.html)

-- CLIP --
Reserved Words

Setting a property value to default, remove, or factory produces the effects described in the previous sections. To set a property to one of these words (e.g., a text or uicontrol String property set to the word default), you must precede the word with the backslash character:

h = uicontrol('Style','edit','String','\default');

-- END CLIP --

Is the correct solution to implement backslash escaping for Octave?

What does Matlab do for

Rik <rik5>
Project Administrator
Thu 12 Apr 2012 12:04:30 PM UTC, original submission:

The command below produces text object with an empty "string" property.

If I add ....

... the string property remains empty. In fact, it should set the value to an empty string, since that is the default value.

Looks like the problem is with graphics.cc (graphics_object::set_value_or_default). Specifically lines 2078-2086.

From Matlab ...

Produces a text object with string = "default". However, after ...

The string property is reset to its default value (an empty string). The "text" function is built-in for Matlab. Perhaps that was done to fix this problem?

Ben Abbott <bpabbott>
Project Member


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

Attach File(s):

Attached Files
file #27605:  xxx added by godfrey (968B - application/octet-stream)
file #27604:  rik.ps added by bpabbott (13KiB - application/postscript)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by godfrey (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by bpabbott (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Mar 2013 08:57:16 PM UTCrik5StatusNone=>Fixed
    Fri 15 Mar 2013 03:31:11 AM UTCgodfreyAttached File-=>Added xxx, #27605
    Thu 14 Mar 2013 07:19:40 PM UTCbpabbottAttached File-=>Added rik.ps, #27604

    Back to the top

    Powered by Savane 3.1-cleanup1