Blank histogram plot window

8 次查看(过去 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