Why does hist, histogram and how the shape of my data is affect how my results are displayed?

2 次查看(过去 30 天)
I have these 3 plots:
and depending if the sizes are Nx10 or 10Nx1 it displays it differently. On top of that it acts differently depending if its a single vector or if its organized in columns and rows. What are the differences between them and how MATLAB choosing how to display each one?
  1 个评论
Image Analyst
Image Analyst 2018-7-23
histogram() treats vectors and matrices the same way. What functions are you using, and what version are you using (list the release on the right).

请先登录,再进行评论。

回答(1 个)

yeungor
yeungor 2018-7-23
Well, you described two situations and two different functions and gave three plots, so I am somewhat confused.
I would say that having an m-by-n matrix input would be interpreted as n different experiments where in each experiment, m datapoints were collected. So each different color is for each of the n experiments and each of the 10 different groupings is a different bin. Note that hist always has 10 bins if unspecified, so I'm guessing you used hist for the second plot.
The 3rd plot appears to be generated by histogram and it treats all the data as from the same experiment, so it has no reason to choose different colors. However, I don't know how you got the evenly spaced dark lines, would you be able to append code to your question?
My last guess is that since the first plot has 10 bins you used hist on the vectorized data.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by