bugGNU Octave - Bugs: bug #45508, multi-line text boxes with...


bug #45508: multi-line text boxes with subscripts truncated at bottom

Submitter:  Hartmut <hardy>
Submitted:  Thu 09 Jul 2015 07:00:27 PM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 12 Jul 2016 09:54:12 AM UTC, comment #8: 

@Harmut: there probably won't be a 4.0.4 version, Octave maintainers are in the early stages for 4.2 release. If ever a 4.0.4 come to be necessary, then I'll backport the patch to stable.

Pantxo Diribarne <pantxo>
Group Member
Mon 11 Jul 2016 09:12:42 PM UTC, comment #7: 

Can this patch also be applied to the "stable" branch of the repository? (Will there be any Octave 4.0.4 release at all?)

Sorry for being a bit late with this request. But I just now realised that this patch didn't improve this matter in Octave 4.0.1 and 4.0.3. And fixing this code typo shouldn't destabilize the "stable" code branch at all.

Hartmut <hardy>
Mon 31 Aug 2015 09:42:02 PM UTC, comment #6: 

Many thanks Harmut for the tests I pushed the patch here:


Closing report.

Pantxo Diribarne <pantxo>
Group Member
Mon 31 Aug 2015 07:08:59 PM UTC, comment #5: 

I will attach 4 screenshots what Matlab does in this case: The code from the original post (=Plot1), and from comment #1 (=Plot2) in Matlab R2013b (=ML2013b) and Matlab R2014b (=ML2014b).

I think Matlab also does what Pantxo called "multi-line text boxes don't have fixed baseline-to-baseline distances".

This makes the proposed patch even Matlab compatible in my understanding.

Hartmut <hardy>
Fri 28 Aug 2015 03:25:10 PM UTC, comment #4: 

Yes I think the patch fixes a typo so I'll push it.
Though, the fact that multi-line text boxes don't have fixed baseline-to-baseline distances is odd, I admit, and I would like to see see what Matlab or other engines (Matplotlib?) do.

Pantxo Diribarne <pantxo>
Group Member
Mon 24 Aug 2015 08:19:43 PM UTC, comment #3: 

Thanks for the patch, Pantxo.

I've tested it on my Linux machine, and also for me it fixes both the mentioned test cases of this bug report.

I don't know if this new behavior is "Matlab compatible". But it is definitly much better than before.

Hartmut <hardy>
Sun 23 Aug 2015 07:20:35 PM UTC, comment #2: 

I attached a very simple patch that seams to fix both issues:

  • the last line in the example from comment #1 is displayed properly
  • characters don't overlap in the example from comment #2.

(file #34706)

Pantxo Diribarne <pantxo>
Group Member
Thu 09 Jul 2015 08:35:21 PM UTC, comment #1: 


I can confirm the bug.
Also, when there is at least one string (among 3,4, ... lines) that contains subscripts, only the distance between the first and second line is increased to take into account the needed additional spacing.
This leads to potential overlapping between lines. See e.g:

my_text = {'line_1','line_2', 'line_3'};
my_text = {'line 1','line 2', 'line_3'};
my_text = {'line_{1_{1}}','line_2', 'XXXXXXXXXXXXXXX'};
my_text = {'line 1','line_{2_{2}}', 'XXXXXXXXXXXXXXX'};

Pantxo Diribarne <pantxo>
Group Member
Thu 09 Jul 2015 07:00:27 PM UTC, original submission:  

Here is a little script to show the behavior:

clear, close all;
%graphics_toolkit gnuplot  % works fine
%graphics_toolkit fltk % truncates the text at bottom
graphics_toolkit qt  % truncates the text at bottom
my_text = {'first line','second line: Text_{below}'};

With the qt plotting toolkit the subscripted text "below" is truncated and not properly shown.

Some additional notes:

  • This only happens with multi-line text boxes, single line text boxes seem to be fine.

  • This only happens with the qt and the fltk graphics toolkit. With gnuplot it's fine.

  • This happes on Linux as well as on Windows (4.0.0 release version each).
Hartmut <hardy>


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

Attach Files:

Attached Files
file #34781:  Plot2_ML2014b.jpg added by hardy (119KiB - image/jpeg)
file #34780:  Plot2_ML2013b.jpg added by hardy (154KiB - image/jpeg)
file #34779:  Plot1_ML2014b.jpg added by hardy (114KiB - image/jpeg)
file #34778:  Plot1_ML2013b.jpg added by hardy (134KiB - image/jpeg)
file #34706:  ft_subscriptbox.patch added by pantxo (905B - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-31 pantxo StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2015-08-31 hardy Attached File- Added Plot1_ML2013b.jpg, #34778
        Attached File- Added Plot1_ML2014b.jpg, #34779
        Attached File- Added Plot2_ML2013b.jpg, #34780
        Attached File- Added Plot2_ML2014b.jpg, #34781
    2015-08-23 pantxo Attached File- Added ft_subscriptbox.patch, #34706
        StatusConfirmed Patch Submitted
    2015-07-09 pantxo StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code