[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63610] patch() creates incorrect color interp
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #63610] patch() creates incorrect color interpolation. Finite Element applications rely on that graphics. |
Date: |
Tue, 3 Jan 2023 03:47:03 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?63610>
Summary: patch() creates incorrect color interpolation.
Finite Element applications rely on that graphics.
Project: GNU Octave
Submitter: None
Submitted: Tue 03 Jan 2023 08:47:01 AM UTC
Category: Plotting
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Christoph Richter
Originator Email: c.h.richter@hs-osnabrueck.de
Open/Closed: Open
Release: 7.3.0
Discussion Lock: Any
Operating System: Microsoft Windows
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 03 Jan 2023 08:47:01 AM UTC By: Anonymous
The command patch() does not yield the correct graphics when using interp
option to interpolate the shading color of the polygon.
https://octave.sourceforge.io/octave/function/patch.html
Applications like Finite Elements vitally rely on correct color
interpolation.
Expected behavior of patch(): Color interpolation following the colorbar that
attends the graphics (command colorbar). The color
sequence itself is defined with colormap().
Current behavior (Octave 7.3): E. g., color interpolation appears to
interpolate linearly between the colors at the vertices of the polygon.
So with vertex 1 having red color (RGB 1 0 0) and vertex 2 having blue color
(RGB 0 0 1) the interpolation takes place between the two RGB
triples. This behavior disregards that an intermediate value may require
green, depending on the colorbar/colormap.
The above example describes interpolation along an edge of the polygon as a
vehicle. Interpolation inside the polygon yiels the same
described deviations from the expected result.
I attach an example m-file. This can be run in Octave and Matlab to see the
difference. Matlab yields the expected result.
I also attach the resulting graphics as obtained with each, Octave and
Matlab.
Comparing the attached images, the issue is NOT about the discrete
interpolation of Matlab and the continuous interpolation of Octave.
The issue is: E. g. left, vertical edge: Matlab goes from blue *via green* to
orange. Octave goes from blue to orange but along the path it
blends the vertex colors.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 03 Jan 2023 08:47:01 AM UTC Name: testpatch.m Size: 325B By:
None
The jpgs can be reproduced with the m-file.
<http://savannah.gnu.org/bugs/download.php?file_id=54177>
-------------------------------------------------------
Date: Tue 03 Jan 2023 08:47:01 AM UTC Name: GNUOctaveBug_OctaveFigure.jpg
Size: 14KiB By: None
The jpgs can be reproduced with the m-file.
<http://savannah.gnu.org/bugs/download.php?file_id=54178>
-------------------------------------------------------
Date: Tue 03 Jan 2023 08:47:01 AM UTC Name: GNUOctaveBug_MatlabFigure.jpg
Size: 17KiB By: None
The jpgs can be reproduced with the m-file.
<http://savannah.gnu.org/bugs/download.php?file_id=54179>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63610>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63610] patch() creates incorrect color interpolation. Finite Element applications rely on that graphics.,
anonymous <=