Horizontal histogram

How to plot a Matlab histogram with horizontal bars?

Set the 'Orientation' setting of the histogram command to 'horizontal'.

histogram(data, 'Orientation','horizontal');

Example

data = randn(1,1000);

subplot(1,2,1)

histogram(data);

title('Normal vertical histogram');

subplot(1,2,2)

histogram(data, 'Orientation','horizontal');

title('Horizontal histogram');