PHD Discussions Logo

Ask, Learn and Accelerate in your PhD Research

Question Icon Post Your Answer

Question Icon

7 years ago in Matlab By Shiran Khan

Graphic patch in MATLAB

I’m using patch to create patch graphics in MATLAB. How can I apply graphics patches in MATLAB? And what are the commonly used syntaxes?

All Answers (4 Answers In All)

By Anubhav Kumar Answered 7 years ago

Open a Local Machine window
Type xhost + ashland
Add the following code sequence before the plot command.
Figure;
Set(gcf,’renderer,’zbuffer’);
[s,w] = unix(‘echo $DISPLAY’);
Set(gcf,’XDisplay’,w);

By Shiran Khan Answered 7 years ago

Thank you so much! Sir, I have some queries regarding the codes. Can you please resolve them?

By Anubhav Kumar Answered 7 years ago

Sure, just drop a mail. I will help you with the codes.

By Mayur Desai Answered 7 years ago

Hi. The popular patch syntaxes are
1. patch(X,Y,C) adds the filled two-dimensional patch to the current axes. The elements of X and Y specify the vertices of a polygon.
2. patch(X,Y,Z,C) creates a patch in three-dimensional coordinates.
patch(FV) creates a patch using structure FV, which contains the fields vertices, faces, and optionally facevertexcdata.
3. patch(…’PropertyName’,PropertyValue…) follows the X, Y, (Z), and C arguments with property name/property value pairs to specify additional patch properties.
4. patch(‘PropertyName’,PropertyValue,…) specifies all properties using property name/property value pairs.
5. handle = patch(…) returns the handle of the patch object it creates.

Your Answer