bugGNU Octave - Bugs: bug #54067, text function alternate syntax...


bug #54067: text function alternate syntax with 'Position' and 'String' options no longer works

Submitter:  None
Submitted:  Tue 05 Jun 2018 07:39:46 PM UTC
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Adam James Sargeant Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.4.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 12 Jun 2018 05:32:24 PM UTC, comment #5: 

@Mike: I didn't catch the reference at the top, but was looking through the Name/Value pairs section where it is not listed.

I added some extra code to catch a 'String' property/value pair in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/1580ceab7f2c).  This will be part of the 4.4.1 bug fix release.

Rik <rik5>
Group administrator
Tue 12 Jun 2018 03:55:16 PM UTC, comment #4: 

Sure it does.

> You can specify text properties with any of the input argument combinations in the previous syntaxes. If you specify the Position and String properties as name-value pairs, then you do not need to specify the x, y, z, and txt inputs.

I think this was explicitly supported in previous versions of Octave by passing in the property-value pairs after the positional parameters, so the 'String' property would override an empty positional parameter. But with the fix for bug #51751, that was reversed because of a different desired ordering behavior, and now we have this regression.

Mike Miller <mtmiller>
Group Member
Tue 12 Jun 2018 03:41:17 PM UTC, comment #3: 

Can the original reporter verify with Matlab that the proposed syntax is correct?  The documentation (http://www.mathworks.com/help/matlab/ref/text.html) does not say that 'String' is one of the Name/Value pairs that can be passed to the text() function.  Of course, Octave could choose to accept a wider range of inputs, but this report is proof that there can be problems with that approach.

Rik <rik5>
Group administrator
Tue 05 Jun 2018 08:04:43 PM UTC, comment #2: 

And this change in behavior was probably introduced by the fix for bug #51751, which changed the order of arguments passed to the internal text function such that the positional string argument is sent in last. This means if the positional argument is not present, the empty string will override the 'String' property value.

Since text is an m-file function it should be pretty easy for someone interested in fixing this to test and submit a working solution to the problem.

Mike Miller <mtmiller>
Group Member
Tue 05 Jun 2018 07:56:51 PM UTC, comment #1: 

Confirmed here. The alternate syntax of calling the text function with explicitly labeled 'String' and 'Position' options instead of the traditional form of the function isn't working in Octave 4.4. Specifically, the 'Position' property is set correctly, but the 'String' property is set to empty.

Setting severity to minor because the original syntax still works correctly, for example

text (0.1 * x(4), 0.8 * F(4), str1, 'FontSize', 16);

Mike Miller <mtmiller>
Group Member
Tue 05 Jun 2018 07:39:46 PM UTC, original submission:  

In Octave 4.2.2 the two lines of code

str1 = cat(2, 'k =  ', num2str(k,'%5.1f'), ' N/m');
text('String',str1,'Position',[0.1*x(4) 0.8*F(4)],'FontSize',16);


k = 17.7 N/m

in the graph (please see attached m file).

In Octave 4.4.0 the same two lines of code do nothing.



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

Attach Files:

Attached Files
file #44306:  hooke.m added by None (1KiB - text/plain)


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 mtmiller (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
    2018-06-12 rik5 CategoryPlotting Octave Function
        StatusConfirmed Fixed
        Open/ClosedOpen Closed
        Operating SystemMicrosoft Windows Any
    2018-06-05 mtmiller Severity3 - Normal 2 - Minor
        Item GroupOther Regression
        StatusNone Confirmed
        Summarytext string not appearing in graph text function alternate syntax with 'Position' and 'String' options no longer works
    2018-06-05 None Attached File- Added hooke.m, #44306

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code