To print multiple bar graphs in a single window in Matlab, you can make use of the subplot
function to create multiple axes in a single figure. Here's an example code snippet which generates two bar graphs side by side in a single window:
main.m199 chars15 lines
In the above code, subplot(1, 2, 1)
creates an axis in the first column of a 1 row and 2 column grid, and subplot(1, 2, 2)
creates another axis in the second column of the same grid. Finally, bar
function is used to create a bar graph in each of the two axes.
gistlibby LogSnag