12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Patch PropertiesYou can also set the intensity of the ambient and diffuse components of thelight on the patch object. See the AmbientStrength and DiffuseStrengthproperties.TagstringUser-specified object label. The Tag property provides a means to identifygraphics objects with a user-specified label. This is particularly useful whenconstructing interactive graphics programs that would otherwise need todefine object handles as global variables or pass them as arguments betweencallback routines.For example, suppose you use patch objects to create borders for a group ofuicontrol objects and want to change the color of the borders in a uicontrol’scallback routine. You can specify a Tag with the patch definition:patch(X,Y,'k','Tag','PatchBorder')Then use findobj in the uicontrol’s callback routine to obtain the handle of thepatch and set its FaceColor property.set(findobj('Tag','PatchBorder'),'FaceColor','w')Typestring (read only)Class of the graphics object. For patch objects, Type is always the string'patch'.UIContextMenu handle of a uicontextmenu objectAssociate a context menu with the patch. Assign this property the handle of auicontextmenu object created in the same figure as the patch. Use theuicontextmenu function to create the context menu. <strong>MATLAB</strong> displays thecontext menu whenever you right-click over the patch.UserDatamatrixUser-specified data. Any matrix you want to associate with the patch object.<strong>MATLAB</strong> does not use this data, but you can access it using set and get.VertexNormals matrixSurface normal vectors. This property contains the vertex normals for thepatch. <strong>MATLAB</strong> generates this data to perform lighting calculations. You cansupply your own vertex normal data, even if it does not match the coordinatedata. This can be useful to produce interesting lighting effects.2-339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!