bugGNU Octave - Bugs: bug #54690, surface/patch markers not clipped...

 
 

bug #54690: surface/patch markers not clipped to axes with OpenGL toolkits

Submitter:  None
Submitted:  Wed 19 Sep 2018 01:48:19 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  pantxo
Originator Name:  aj 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 25 Sep 2018 06:56:05 PM UTC, comment #12: 

Thanks Pantxo.  The patch works for me with the test code from comment #3.  Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Tue 25 Sep 2018 05:34:24 PM UTC, comment #11: 

Yes indeed, the method is private so there is no ABI compatibility argument here. I pushed it here:

http://hg.savannah.gnu.org/hgweb/octave/rev/c1cd5561d1dc


Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 04:12:30 PM UTC, comment #10: 

Fixing this problem on default seems like the right thing to do.  But isn't clip_code a private function?  If so, then I don't think it will cause a backward compatibility problem if it changes.

John W. Eaton <jwe>
Group administrator
Tue 25 Sep 2018 03:57:17 PM UTC, comment #9: 

@jwe: yes, I'll change "uint8_t clip_ok (0x40)" to "uint8_t = 0x40" and push the patch to default (clip_code's return value changes so it is not ABI compatible with Octave 4.4)

Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 03:52:44 PM UTC, comment #8: 

Although valid, using "uint8_t clip_ok (0x40)" instead of "uint8_t = 0x40" looks a little strange.

Is this change intended for stable or default?  Either way, I think it's OK to push.

John W. Eaton <jwe>
Group administrator
Tue 25 Sep 2018 03:30:20 PM UTC, comment #7: 

I attached the updated patch in which I changed octave_uint8 to uint8_t for clip codes.

(file #45094)

Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 02:18:32 PM UTC, comment #6: 

@jwe: indeed uint8_t should be enough. I'll update the patch and change this in draw_line also.

Pantxo Diribarne <pantxo>
Group Member
Tue 25 Sep 2018 01:33:27 PM UTC, comment #5: 

Do we really need to use an octave_uint8 object here?  It appears to me that uint8_t would be fine and should be preferred unless we need the special saturation semantics of integers that are used in the scripting language.

John W. Eaton <jwe>
Group administrator
Mon 24 Sep 2018 05:12:05 PM UTC, comment #4: 

The attached simple patch fixes the issue for me.

(file #45086)

Pantxo Diribarne <pantxo>
Group Member
Mon 24 Sep 2018 04:29:58 PM UTC, comment #3: 

@Rik: Matlab also renders markers if their coordinates are exactly on  the limit (see e.g. datetick_02.png in https://josoansi.de/octave_plot_compare/compare_plot_demos_02.html), so Octave behaves as Matlab for line objects.
The problem here is specific to surface and patch objects for which markers are never clipped. Changing the title again.

The simple test case is


clf
patch ("marker", "o", "markerfacecolor", "r", "clipping", "on")
xlim ([.05 .95])


There is already some logic for clipping but it simply doesn't work.

Pantxo Diribarne <pantxo>
Group Member
Mon 24 Sep 2018 04:12:57 PM UTC, comment #2: 

I re-titled the bug report to reflect Pantxo's comment #1.  I've changed the item group to Matlab Compatibility.  A simple example is


plot (1:10, 'o', 'markersize', 20)


The last circle at (10,10) extends outside the axes.

If you pan the plot then as soon as the point (10,10) exits the axes then the entire marker is clipped.  It would be interesting to test whether Matlab shows part of the circle that still exists in the axes even when the point containting the marker has been moved outside the axes.

Rik <rik5>
Group administrator
Thu 20 Sep 2018 09:38:52 AM UTC, comment #1: 

Confirmed. The probleme is that patch and surface markers clipping is currently not handles in gl-render.cc

Pantxo Diribarne <pantxo>
Group Member
Wed 19 Sep 2018 01:48:19 PM UTC, original submission:  

If Qt or FLTK is used as the graphics toolkit, scatter() draws points that are outside of the limits of the plot axes. Gnuplot doesn't seem to have this problem.

Example script and resulting figures with different graphics toolkits have been attached.

If you look at the Qt or FLTK results, the points at (8,-0.2) and (6,21) are visible. They are not visible in the Gnuplot result.

Tested with Octave 4.4.1 on Arch Linux x86-64.
-- FLTK package version is 1.3.4.2-3
-- Qt5-base package version is 5.11.1-3
-- Qt4 package version is 4.8.7-25
-- Gnuplot version is 5.2 patchlevel 4

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45094:  clip2.patch added by pantxo (3KiB - text/x-patch)
file #45086:  clip.patch added by pantxo (2KiB - text/x-patch)
file #45047:  plot_limits_bug.m added by None (187B - text/x-objcsrc)
file #45048:  plot_limits_gnuplot.png added by None (40KiB - image/png)
file #45049:  plot_limits_qt.png added by None (40KiB - image/png)
file #45050:  plot_limits_fltk.png added by None (24KiB - 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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  •  

    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 19 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-25 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Release4.4.1 dev
    2018-09-25 pantxo StatusPatch Submitted Ready For Test
    2018-09-25 pantxo Attached File- Added clip2.patch, #45094
    2018-09-24 pantxo Attached File- Added clip.patch, #45086
        StatusConfirmed Patch Submitted
    2018-09-24 pantxo Summarymarkers not clipped to axes with OpenGL toolkits surface/patch markers not clipped to axes with OpenGL toolkits
    2018-09-24 rik5 Item GroupInaccurate Result Matlab Compatibility
        Summaryscatter() plot extends over figure/axis limits if Qt or FLTK is used markers not clipped to axes with OpenGL toolkits
    2018-09-20 pantxo StatusNone Confirmed
        Assigned toNone pantxo
    2018-09-19 mtmiller Carbon-CopyRemoved 80942 -
    2018-09-19 mtmiller CategoryPlotting Plotting with OpenGL
        Item GroupNone Inaccurate Result
    2018-09-19 None Attached File- Added plot_limits_bug.m, #45047
        Attached File- Added plot_limits_gnuplot.png, #45048
        Attached File- Added plot_limits_qt.png, #45049
        Attached File- Added plot_limits_fltk.png, #45050

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code