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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

plotNow add axis labels and annotate the point −pi/4, sin(−pi/4).10.80.60.40.20−0.2−0.4−0.6−0.8−1−pi −pi/2 0 pi/2 piAdding Titles, Axis Labels, and Annotations<strong>MATLAB</strong> enables you to add axis labels and titles. For example, using thegraph from the previous example, add an x- and y-axis label,xlabel('−\pi \leq \Theta \leq \pi')ylabel('sin(\Theta)')title('Plot of sin(\Theta)')text(−pi/4,sin(−pi/4),'\leftarrow sin(−\pi\div4)',...'HorizontalAlignment','left')Now change the line color to red by first finding the handle of the line objectcreated by plot and then setting its Color property. In the same statement, setthe LineWidth property to 2 points.set(findobj(gca,'Type','line','Color',[0 0 1]),...'Color','red',...‘LineWidth',2)2-356

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

Saved successfully!

Ooh no, something went wrong!