bugGNU Octave - Bugs: bug #62873, text in contourf is not well...


bug #62873: text in contourf is not well readable

Submitter:  None
Submitted:  Sun 07 Aug 2022 06:05:50 PM UTC
Category:  Plotting Severity:  2 - Minor
Priority:  3 - Low Item Group:  Other
Status:  Confirmed Assigned to:  None
Originator Name:  Emapier Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 7.2.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Sun 16 Oct 2022 06:57:54 PM UTC, comment #7: 

@Philip: See point 4 in comment #3 and reference therein. Suuport for rendering text strings with rotation angle different than 0, 90, 180, 270° is new in Octave 7. Previously text with any other rotation angle were rendered unrotated. They were thus more legible but with a wrong rotation.

Pantxo Diribarne <pantxo>
Project Member
Sat 15 Oct 2022 09:56:26 PM UTC, comment #6: 

In Octave-6.4.0, the line
does nothing (at least on my box, Windows 10 w Octave-6.4.0). Was text rotation implemented in 6.4.0? I guess not.
In Octave-8.0.0, the text is rotated and less well readable then - a bit "jagged".
With larger font sizes the text gets much better readable.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 15 Oct 2022 06:43:18 PM UTC, comment #5: 

noting the comment below about this being a new issue with octave 7 vs 6.4.0, could someone with 6.4.0 handy do a comparison on those test plots?

Nicholas Jankowski <nrjank>
Project Member
Wed 07 Sep 2022 09:30:22 PM UTC, comment #4: 

I realized that also simple text in any axes is not well readable. This happen when the property rotation is different from zero.

axis([0 5 0 5])

if you run the code up to here everything is fine.
As soon as u add also this line of code


the text is not well readable

Tue 09 Aug 2022 10:14:13 AM UTC, comment #3: 

There seems to be multiple issues at play for which we may want to create separate bug reports (if they don't already exist):

  • Font size is too small: this is not only true for contour labels but for any text in figure windows. This is not the case in printout and is a know issue (see bug #45600)
  • Octave could choose integer contour levels when appropriate (??) as ML does. That would reduce the extent of labels. May need a separate bug report to define what the appropriate algorithm would be.
  • Octave could break contour lines around labels. Since the length of line breaks (and the angle of labels) should also adapt when the figure is stretched/compressed this looks like a big project which also deserves it own bug report.
  • One that was not mentioned but I think is noteworthy: rotated labels are not quite legible onscreen or in raster printout with `opengl` renderer (`painter` is OK). This is due to the very simplistic approach chosen for displaying rotated text (see comment 15 in bug #33118).
Pantxo Diribarne <pantxo>
Project Member
Mon 08 Aug 2022 08:56:56 PM UTC, comment #2: 

The benchmark you made is still fine.
I noticed that:
-saving the image as png makes the label more readable
-saving in svg format guarantees that the labels are well readable.

However the actual graph in plot window is not. This issue occur to me since octave 7 release. In Octave 6.4 I did not have such an issue.

Mon 08 Aug 2022 05:55:41 PM UTC, comment #1: 

comparing results from octave and matlab using a test case:

[x,y,z] = peaks;
[C,h] = contour(x,y,z,[-8:2:8]);

produces the attached image comparing Octave 7.2.0 and Matlab 2022a.

Octave's is definitely less legible. note that matlab breaks the lines behind the numbers, and the font size defaults larger. the brighter colormap probably helps contrast a bit as well.

Also, note that without specifying the levels with the [-8:2:8], octave did not choose integer spaced levels making the labels much longer text strings. (2nd image attached)

Nicholas Jankowski <nrjank>
Project Member
Sun 07 Aug 2022 06:05:50 PM UTC, original submission:  

Plotting a contourf and adding text on isolinee withe clable results in unreadable/ bad readable values.



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

Attach Files:

Attached Files
file #53660:  rotatedText.png added by None (269KiB - image/png)
file #53547:  bad_clabel_text@printscreen.png added by None (130KiB - image/png)
file #53548:  bad_clabel_text@savepng.png added by None (202KiB - image/png)
file #53545:  clabel_comparison.png added by nrjank (71KiB - image/png - example clevel images)
file #53546:  clevel_nolevelsspecified.png added by nrjank (138KiB - image/png - example clevel images)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by nrjank (Updated 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 project members can vote.





    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-07 None Attached File- Added rotatedText.png, #53660
    2022-08-09 pantxo Operating SystemMicrosoft Windows Any
    2022-08-08 None Attached File- Added bad_clabel_text@printscreen.png, #53547
        Attached File- Added bad_clabel_text@savepng.png, #53548
    2022-08-08 nrjank Attached File- Added clabel_comparison.png, #53545
        Attached File- Added clevel_nolevelsspecified.png, #53546
        Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Item GroupNone Other
        StatusNone Confirmed
        Release7.1.0 7.2.0
    2022-08-07 mmuetzel Dependencies- bugs #62874 is dependent

    Back to the top

    Powered by Savane 3.9