I would like to produce a plot like the following in matlab.

Or may be something like this

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use bar(…) or hist(…) to get the results you want. Consider the following code with results shown below:
If your data is different sizes and you want to do histograms you could choose bins yourself to force hist(…) results to be the same size then plot the results stacked up in a matrix, as in:
With the following results: