Changing the interpolation behavior in patch for 'FaceAlpha'.

3 views (last 30 days)
Hi,
I am trying to use the patch function to create a region with varying transparency in a 2D figure. However, setting 'FaceAlpha' to 'interp' only allows for a linear interpolation between vertexes. Is there any way to change the interpolation to another function? For example, a quadratic or cubic change in the transparency values.
Thank you.

Accepted Answer

Raunak Gupta
Raunak Gupta on 22 Nov 2019
Hi,
For interpolating with a different function I suggest providing ‘FaceVertexAlphaData’ in way that it captures the nature of the function, that is if quadratic interpolation is needed for vertices you may declare the FaceVertexAlphaData in a quadratic way. For example if 3 vertices are there then [1,4,9] will give same behavior as required. Currently for FaceAlpha’ any other interpolation method is not present except flat and interp.
Hope it helps.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!