How do I fill a patch object with a pattern, such as diagonal lines or a texture map, in MATLAB R2020b?

18 views (last 30 days)
I would like to fill a patch object using the FILL function with a pattern rather than colors. For example, I would like to fill it with diagonal lines, a grid, texture map, or some other pattern.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Dec 2020
Edited: MathWorks Support Team on 17 Dec 2020
The ability to fill a patch object with a pattern or texture mapping using the FILL function is not available in MATLAB R2020b.
To work around this issue, you can create a surface object using the SURF function rather than a PATCH object and apply a texturemap to the surface object. An example demonstrating how to do this using the surface CData and FaceColor properties is given in the following article:
Also, you may use the files at the following link at the MATLAB Central file exchange:
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.

More Answers (0)

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!