bugGNU Octave - Bugs: bug #54551, Wrong text clipping limits

 
 

bug #54551: Wrong text clipping limits

Submitter:  None
Submitted:  Wed 22 Aug 2018 03:47:58 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Andy Potvin Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 28 Aug 2018 09:17:54 AM UTC, comment #7: 

Thanks Rik, the .F was a leftover from when I tried to use std::numeric_limits<float> to not arbitrarily choose constants (1e6) as I finally did.

Pantxo Diribarne <pantxo>
Group Member
Tue 28 Aug 2018 12:44:18 AM UTC, comment #6: 

@Pantxo: I pushed your changeset here https://hg.savannah.gnu.org/hgweb/octave/rev/2c42ed37cfc2.  The one change I made was to make the float constants (100.0F) in to double constants (100.0) since the rest of the math is using doubles.  Marking as fixed and closing report.

@Andy: All the Octave programmers are volunteers so there is no one person dedicated to the GUI Button functions.  If you see something and can file a report that's the best strategy.

Rik <rik5>
Group administrator
Fri 24 Aug 2018 09:47:04 AM UTC, comment #5: 

I attached a patch that fixes the overall clipping limits (near and far planes in ortho projection) to 100 times the z axes depth.
I am not so proud about it since I arbitrarily fixed some constants here so that 3D views are not affected, and criticism is very welcome.

(file #44847)

Pantxo Diribarne <pantxo>
Group Member
Thu 23 Aug 2018 10:18:38 AM UTC, comment #4: 

@Andy: reply on savannah web interface so that the comments are listed.

>> Sure


So I am retitling the report,changing "Item group" to "Inaccurate result", "Category" to "Plotting with OpenGL" and "OS" to "Any" since the bug is also present on linux.

Pantxo Diribarne <pantxo>
Group Member
Wed 22 Aug 2018 08:51:22 PM UTC, comment #3: 

@Andy: I played with your example from comment #2 and there seems to be a critical value of zlim above which Octave behaves correctly:


plot (1:10)
ht = text (5, 5, 3,'text', 'Clipping','off')
## zlim = [0 1];
zlim ([0 2]) ## Above 2 or so the text appears
set (ht, 'Clipping','on') ## The text disappears correctly
zlim ([0 3]) ## The text reappears correctly


Can I re-title this report to something like "Wrong text clipping limits"?

As for the fact that text objects are not taken into account when computing axes limits, I guess that this behavior has been copied from Matlab's (don't know if it is documented anywhere in ML doc).

Pantxo Diribarne <pantxo>
Group Member
Wed 22 Aug 2018 05:07:44 PM UTC, comment #2: 

Thanks Dmitri for the SUPER-quick reply!

So it's NOT related to the 3-D patch.  And it's a known behavior/bug/feature.  OK.[FN1]

But see the following:
plot(1:10)
ax = gca;
set(ax,'DefaultTextClipping','off')
text(5,5,3,'text')
get(ax,'Zlim')

In MATLAB (again R2012a) you can see the text.  In Octave you can't.  That's an Octave bug. I.e. "Octave fails to show text when Clipping is off"


[FN1] My work around was just to set the limits manually.  FYI MATLAB (R2012a) behavior of my example is to show the text even though it sets an auto ZLim=[-3 -1] - so I guess that would be  MATLAB bug (as long as text clipping is off.

Andy Potvin <afpotvin>
Wed 22 Aug 2018 04:08:43 PM UTC, comment #1: 

I am not sure it is a bug, rather than a feature.
Text is not data. In 2-d it works the same:


plot (1:10)
text(-1,-1, "Some Text")
text(-10,-10, "More Text")


Autoscale would ignore those text strings.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 22 Aug 2018 03:47:58 PM UTC, original submission:  

Run the attached M-file to see Octave choose axes limits poorly.  I think the bug has something to do with using 3-D patches.

Also, I attach my Octave command line output.  Note that I also get a weird warning about "allowing norm to match units value normalized" - WTF is that?

Finally, you may recognize me as a former MathWorks developer.  I'm  running into lots of bugs trying to make a (sudoku puzzle) GUI work in Octave.  It works just fine in MATLAB.[FN1]  Anyway, I don't have a lot of time to chase
down Octave bad behavior. [FN2]  If you put me in touch directly with the developer of various ButtonDownFcn's, ButtonMotionFcn's and KeyPressFcn's I can point the person to LOTS of bugs that I don't have time to reduce to a few lines of code for a bug report.

Thanks and Best regards,
Andy Potvin
-email is unavailable-
(626) 226-8436

[FN1] Truth be told, I've found and had to work around a few stupid MATLAB bugs too.

[FN2] It took me MANY hours to produce the bug report here because I had to reduce my multi-thousand-line GUI code to the two offending  line at the core of the bug report.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44847:  large_znear.patch added by pantxo (1KiB - text/x-patch)
file #44822:  ob_lim.m added by None (483B - text/plain)
file #44823:  ob_lim_report.txt added by None (1KiB - text/plain)
file #44824:  ob_lim_command_output.txt added by None (5KiB - 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 pantxo (Posted a comment)
  • -email is unavailable- added by afpotvin (Posted a comment)
  • -email is unavailable- added by dasergatskov (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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-28 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-08-24 pantxo Attached File- Added large_znear.patch, #44847
        StatusNone Patch Submitted
    2018-08-23 pantxo CategoryPlotting Plotting with OpenGL
        Item GroupPerformance Inaccurate Result
        Release4.4.0 dev
        Operating SystemMicrosoft Windows Any
        Summarypoor auto axes limits chosen with 3-D patches Wrong text clipping limits
    2018-08-22 None Attached File- Added ob_lim.m, #44822
        Attached File- Added ob_lim_report.txt, #44823
        Attached File- Added ob_lim_command_output.txt, #44824

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code