MATLAB: How to create a horizontal AREA plot in MATLAB 7.7 (R2008b)

areahMATLAB

I see that there is a BARH function which creates a horizontal bar chart. I would like to create a horizontal AREA plot.

Best Answer

The ability to create a horizontal AREA plot is not available in MATLAB 7.7 (R2008b).
As a workaround, you can make a regular AREA plot, and then use the VIEW command to rotate the view of the axes. For example:
Y = [1, 5, 3; 3, 2, 7; 1, 5, 3; 2, 6, 1];
area(Y);
view(90,90)
Please note that if you do this and then try to use the XLABEL command, it will label the vertical axis. This is because the view has simply been rotated so that the x-axis is now aligned vertically.