필터 지우기
필터 지우기

Display selected bars above a given limit on the histogram

조회 수: 3 (최근 30일)
kewin galuszka
kewin galuszka 2022년 5월 25일
댓글: ILoveMATLAB 2022년 5월 25일
I have a histogram with 100 bars, the highest bars have about 100 numbers of proporties, but i have a small bars at the end with about 5 numbers of appearances too. How can i display selected bars above for example 10 number of appearances?
I would to make 100 bars for my signal, but select bars which has above X number of appearances.
  댓글 수: 3
dpb
dpb 2022년 5월 25일
Display how?
Describe what you think you'd like the resulting plot to be -- slimply the same plot w/o the small bars or a new bar graph with only the taller bars at all -- if so, how are they to be labeled? There will be some number fewer than the original; the x axis values won't match to a bin number and if you use the same edges vector with 'NumberCounts' option, the width/location of the bars will be the same, just with gaps.
kewin galuszka
kewin galuszka 2022년 5월 25일
I wanted to display only "high" bars. On the righ side, there are really low bars, i have to zoom to see something.
But i used a xlim and it is ok for me.

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

채택된 답변

ILoveMATLAB
ILoveMATLAB 2022년 5월 25일
First use histcounts to get the edges and bins
[N,edges] = histcounts(X)
Remove the edges and bins you dont care about
tfKeep = N>10
N = N(tfKeep)
edges = edges(tfKeep)
Plot histogram
histogram('BinEdges',edges,'BinCounts',N)
I have not validated this code, but it should be correct.
  댓글 수: 2
kewin galuszka
kewin galuszka 2022년 5월 25일
Thanks, it is ok :)
ILoveMATLAB
ILoveMATLAB 2022년 5월 25일
Your welcome. Please accept the awswer if it anwsers your question.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by