MATLAB for Visualization
Posted on Dec 03, 2012 in Computer Science
Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.
-
To display a new graph on on top of an old one, you can use command
hold on. In this way, you can create multiple plots in a same window. Thoughplotcan already do multiple plot, commandhold oncan be very useful when you want to add some new points or curves to an existing graph (e.g. a histogram). -
Function
subplotdisplays multiple plots in the same window, which is similar to settingspar(mfrow=c(2,2))orpar(mfcol=c(2,3))in R. -
Function
histandhistcproduces histograms. -
Function
starisproduces step graph. -
Function
plotplots2-Dgraph while functionsurfplots3-Dgraphs. Functionsurfis usually used in conjugate with functionmeshgridwhich can create a matrix of points over which the surface is to be plotted. You can also usendgridinstead ofmeshgridto generate a matrix of points. However,ndgridis usually higher dimensions and the usage is a little different frommeshgrid, so you have to be careful if you wan to use it. -
After plotting figures using
plot, you can usetitleto add titles for the figures,axisto set configurations for the axies, andxlabelandylabelto set labels for the x and y axes. You can also usesetto set all configurations for the plots. To do this, you have to first get the handle of the elements in the plots that you want to modify, and then applyseton it. -
inpolygoncan check whether given points are inside a polygon or not. -
spyvisualizes sparse matrices. -
imagecan not only display images but also make mosaic plot (sometimes called heat plot or level plot) of a matrices. For example, to show the mosaic plot of matrixx, you can useimage(x,'CDataMap','CDataMapping','scaled').