0% found this document useful (0 votes)
3 views2 pages

How To Graphics On Matlab

Uploaded by

angel-palau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

How To Graphics On Matlab

Uploaded by

angel-palau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Summary: How MATLAB Graphics Work

Different types of visualizations and graphics objects have different


properties, which you can access, use, and modify. You can create a
handle to the graphics object by assigning the output of a plotting
function to a variable.

Create a handle to the figure object before f = figure;


plotting if you know in advance you want to
modify the figure.

Create a handle to the graphics objects when p = plot(x,y);


you create the plot.

Access and modify properties of a graphics


p.LineStyle =
object using dot notation.
":";

p.XData(end+1)
= 1;
Modify the data properties to add data to a
p.YData(end+1)
plot, like for creating animations.
= 2;

b = bar(mat);
If a graphics object is an array, access the
bar2 = b(2);
elements using standard array indexing.

set(b,FaceAlpha
Use the set function to modify a property for =.5)
all elements in an array of graphics objects.

ax = gca;
Get the current axes.

MATLAB shows relevant name suggestions as you type, including the


names of properties of a graphics object. You can scroll through the list
to find the property you need, or you can continue typing to show more
refined suggestions.

All graphics objects are part of a hierarchy. Most graphics objects consist
of a figure window, containing one or more axes, which contain any
number of plot objects. You can get the current figure and axes by
using gcf and gca. To move between levels of the hierarchy, use
the Children and Parent properties.

You might also like