Академический Документы
Профессиональный Документы
Культура Документы
Plotting Functions
On this page
Description
plot
plot3
loglog
semilogx
Graph w ith a logarithmic scale for the x-axis and a linear scale for the y-axis
semilogy
Graph w ith a logarithmic scale for the y-axis and a linear scale for the x-axis
plotyy
www.mathworks.in/help/matlab/creating_plots/using-high-level-plotting-functions.html
1/7
06/12/2013
You can plot multiple graphs in one call to plotusing x-y pairs. MATLAB automatically cycles through a predefined list of
colors (determined by the axes ColorOrderproperty) to allow discrimination betw een sets of data. Plotting three curves as
a function of tproduces
y = sin(t);
y2 = sin(t-0.25);
y3 = sin(t-0.5);
plot(t,y,t,y2,t,y3)
2/7
06/12/2013
3/7
06/12/2013
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
produce a graph w ith
A red dashed line w ith square markers
A line w idth of tw o points
The edge of the marker colored black
The face of the marker colored green
The size of the marker set to 10 points
www.mathworks.in/help/matlab/creating_plots/using-high-level-plotting-functions.html
4/7
06/12/2013
5/7
06/12/2013
plot(x,y,'-r',x,y,'ok')
www.mathworks.in/help/matlab/creating_plots/using-high-level-plotting-functions.html
6/7
06/12/2013
To set the default line color to dark gray, use the statement
set(0,'DefaultAxesColorOrder',[0.4,0.4,0.4])
See ColorSpecfor information on how to specify color as a three-element vector of RGB values.
Now the plot function uses the line styles and colors you have defined as defaults. For example, these statements create a
multiline plot.
x = 0:pi/10:2*pi;
y1 = sin(x);
y2 = sin(x-pi/2);
y3 = sin(x-pi);
plot(x,y1,x,y2,x,y3)
The default values persist until you quit MATLAB. To remove default values during your MATLAB session, use the reserved
w ord remove.
set(0,'DefaultAxesLineStyleOrder','remove')
set(0,'DefaultAxesColorOrder','remove')
See Setting Default Property Values for more information.
www.mathworks.in/help/matlab/creating_plots/using-high-level-plotting-functions.html
7/7