필터 지우기
필터 지우기

Blank histogram plot window

조회 수: 7 (최근 30일)
Kevin
Kevin 2012년 6월 26일
Hello,
I have a matrix full of data. I am interested in plotting a histogram of one column of said data. The number of rows in the data is 195,104. This minimum and maximum of the data series are -8.8317e+181 and Infinity, respectively.
Whenever I attempt to plot a histogram of the results, the plot window appears to be empty. Is there a way to properly plot this data? I am not necessarily interested in the outlier values, but more so in the range of -20 to 20. I have tried to limit the x-axis to this range, but the plot sill appears to be empty.
Thank you,
Kevin
  댓글 수: 1
Image Analyst
Image Analyst 2012년 6월 27일
It could be that there were lots of outliers - more than any valid values so the y range is huge, compressing all your histogram bars vertically. You may have needed to set ylim() also, in addition to xlim(). But actually, I tlawren's answer better.

댓글을 달려면 로그인하십시오.

채택된 답변

tlawren
tlawren 2012년 6월 26일
If you are not interested in outliers (data outside of [-20,20]), then set all outliers to NaN's. Something like the following should work.
M(abs(M) > 20) = NaN;
hist(M(:,col));
where M is your data matrix and col is the column you want to plot.
Inf's will cause empty histograms.
  댓글 수: 2
Kevin
Kevin 2012년 6월 26일
Sorry, what does M represent in this case?
tlawren
tlawren 2012년 6월 26일
M is your data matrix.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by