images

13.1    Logarithmic plots

13.2    Plotting functions on two axes

13.3    Plotting surfaces

13.4    Plotting vector fields

13.5    Working with images

13.6    Rotating composite objects in three dimensions

This chapter is meant to be a first reference and source of examples for creating some of the more complex graphical visualizations that MATLAB enables. The scope ranges from simple plotting commands to manipulation of aggregate graphical objects in three dimensions.

Log plots. Section 12.1 describes the facilities for making various log and semi-log plots. The key MATLAB commands are semilogy, semilogx, loglog, and logspace.

Plotting functions on two axes. It is sometimes helpful to plot two functions of the same independent variable on one graph, even though the functions have different units. The solution, described in Section 12.2, is to have different vertical axes on the left and right of the graph. This is accomplished using the plotyy command.

Plotting surfaces in three dimensions. A function of two variables, f(x, y), can be visualized as a surface over the xy–plane. Section 13.3 describes using the surf, surfl, mesh, and meshgrid commands used to create surfaces in three dimensions. Two-dimensional pseudocolor plots, using pcolor, and contour plots, using contour, are visualization alternatives.

Plotting vector fields. A vector-valued function of two or three variables ...

Get Learning to Program with MATLAB: Building GUI Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.