bugGNU Octave - Bugs: bug #60187, Invalid warning from text.m about...

 
 

bug #60187: Invalid warning from text.m about character matrices

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sat 06 Mar 2021 10:18:44 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  3 - Low Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 08 Mar 2021 05:05:04 AM UTC, comment #5: 

Verified the patch.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Sun 07 Mar 2021 11:02:36 AM UTC, comment #4: 

Looks good to me.
I pushed you patch here:
https://hg.savannah.gnu.org/hgweb/octave/rev/f26f9dbfb2c5

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sun 07 Mar 2021 10:07:08 AM UTC, comment #3: 

See also patch #9985 (comment #15) where I tracked it down.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 07 Mar 2021 10:05:09 AM UTC, comment #2: 

It's actually a bit of a deceiving warning / bug.
It is emitted by strcmpi(), called in __plt_get_axis_arg__.m . While strcmpi's warning is legitimate it is irrelevant in its context.

After a bit of thinking over I concluded that the best fix is to simply silence he warning in __plt_get_axis_arg__.m .

cset attached.

(file #51018)

Philip Nienhuis <philipnienhuis>
Group Member
Sun 07 Mar 2021 02:03:26 AM UTC, comment #1: 

Confirmed on Linux.  Changing the OS to "Any".

This isn't a big deal so I lowered the Severity to Minor.

Rik <rik5>
Group administrator
Sat 06 Mar 2021 10:18:44 PM UTC, original submission:  

(some more spin-off from patch #9985)


>> help text
'text' is a variable

-- text (X, Y, STRING)
-- text (X, Y, Z, STRING)
-- text (..., PROP, VAL, ...)
-- text (HAX, ...)
-- H = text (...)
     Create a text object with text STRING at position X, Y, (Z) on the current axes.

     Multiple locations can be specified if X, Y, (Z) are vectors. Multiple strings can be specified with a character matrix or a cell array of strings.


Now do the following:

>> plot (sin ([0:10]))

>> tt = repmat ('abc', 3, 1)
tt =
abc
abc
abc

>> text (5, 0.5, tt)
warning: multi-row character matrix converted to a string, only the first row is used
warning: called from
    __plt_get_axis_arg__ at line 52 column 12
    text at line 93 column 27


and then the above warning:

  • is at variance with text's own help text which explicitly mentions 'character matrix'
  • 'only the first row is used' is at variance with the attached pic where all three rows of character matrix 'tt' show up.


Provisionally OS set to 'Windows' but I expect to see it on other platforms as well.

Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #51018:  bug_60187.cset added by philipnienhuis (1KiB - application/octet-stream)
file #51015:  text.m_bug.png added by philipnienhuis (27KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by philipnienhuis (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
    2021-03-08 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-03-07 mmuetzel StatusPatch Submitted Ready For Test
    2021-03-07 philipnienhuis Attached File- Added bug_60187.cset, #51018
        StatusNone Patch Submitted
    2021-03-07 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Operating SystemMicrosoft Windows Any
    2021-03-06 philipnienhuis Attached File- Added text.m_bug.png, #51015

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code