The goal of data visualization should not be to make pretty pictures, but rather to deliver comprehension of the phenomena behind the data into the mind of the beholder as simply, efficiently, and accurately as possible, without introducing any new false understandings.
The following three books by Edward Tufte are HIGHLY recommended:
Data visualization can be classified according to the dimensionality of the data to be displayed, as well as the dimensionality of the domain over which the data is defined. It can also make a difference whether the data is continuous or discrete, e.g. categorical.
A typical line plot shows one dimension of data as a function of a one-dimensional domain. Matlab's plot3 displays a line plot in 3-D, which is three dimensions of data ( x, y, and z ) over a 1-D domain ( distance along the trajectory. )
A weather map shows 1-D of data ( temperature ) over a 2-D domain
A wind map shows 2-D of data ( speed & direction or x & y ) over a 2-D domain.
This plot shows two dimensions of data ( height & mineral concentraiotns ) over a 2-D domain:
The following is effectively a contour plot in 3D, where the "contours" become surfaces, in this case showing the shapes of the bones and skin:
Some complex visualizations can display many dimensions of data over a 2, 3, or more dimensional domain, often by combining multiple plots and/or plot types on a single figure:.
The following images were captured from a visualization of a distillation tower developed for a CAVE VR system:
Commands and Techniques Common to All Plot Types
Generate data in Matlab or load in a data file generated externally
Use the colon operator as needed to extract subsets of data, e.g. columns.
Cropping a plot - Data values of "NAN" ( Not a number ) are not plotted.
Plotting from the Workspace
Right-click on one or more data items and select a plot type from the pull-down menu
When selecting multiple data items, the order of selection is important.
The commands generated are displayed in the command window - Use help or doc to learn more about them, and copy them into scripts as necessary.
Plotting using plotting commands
Any of the plot commands can be issued in the command window or from a script.
Porting plots to other documents, e.g. to include in a written report
From plot window, select "File, Save As", and select a file type compatible with your other program, e.g. jpeg
Most plotting commands will use row and column numbers to label the axes if no alternative data is provided.
There is generally a variation that allows you to provide your own data for labeling the axes.
Example: pcolor( x, y, data ) instead of pcolor( data ), where "data" is a 2-D matrix and "x" and "y" are vectors equal in length to the number of columns and rows respectively in the data matrix.
Note: Colors can either be represented as integers ranging from 0 to 255 or floating point numbers ranging from 0.0 to 1.0, and Matlab can sometimes use either one, so it is sometimes necessary to convert from one data type to the other. ( E.g. im2double converts an image file from unsigned 8-bit ints ( uint8 ) to doubles.
Subimage: There is a problem trying to display multiple images with subplot if the images use colormaps, because a single figure can only use one colormap. You can get around the problem by using subimage, ( withtin subplot ), which converts the images to true color, eliminating problems with colormap conflicts.
Multiple plots on a common set of axes
plotyy - Creates 2 y axes, one along the left edge and one along the right
hold - Toggles whether the current plot is held for future plotting commands. ( Used for plotting multiple plots of different types on a single set of axes, such as a line plot and a bar chart for example. ) Can also be used as "hold on" and "hold off".
"plot" can also plot multiple lines on the same set of axes, as can many other plotting commands.
figure - Create a new figure, make a particular figure active, or bring up the current figure.
Given as a text string of special characters. For example, "plot( x, y, 'ro' );" plots the x y data using a red line ( 'r' ) and circles as data markers ( 'o' ).
Shading flat - every polygon is a solid color, with no lines at polygon borders.
Shading faceted - As flat, with black line borders.
Shading interp - Each polygon has a range of color values, smoothly varying from one corner to the next.
( Pcolor ignores the last row and column of data with flat or faceted shading, but uses the values with interpolated shading. )
"view(az,el)" will set the viewpoint for a 3-D graphs as the azimuth ( polar angle in the x-y plane ) and elevation ( angle above the x-y plane ) given.