MATLAB: Changing the interpolation behavior in patch for ‘FaceAlpha’.

patch

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.

Best Answer

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.