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