필터 지우기
필터 지우기

Plotting three histograms as a curved line on the same graph

조회 수: 1 (최근 30일)
Vivi
Vivi 2012년 7월 10일
I have three large 200,000*1 vectors (z1,z2 and z3) with contains data and I am looking to plot all three as a histogram (but I would like a curved line which can be jagged) on the same graph. I have looked through the website and I altered a code that was used in another answer:
>> x=-10:0.01:10;
[n1, xout1] = hist(z1,x);
bar(xout1,n1,'r'); grid; hold
[n2, xout2] = hist(z2,x);
bar(xout2,n2,'g'); grid; hold
[n3, xout3] = hist(z3,x);
bar(xout3,n3,'g')
The problem was that the graph histograms are solid colours so I cannot see past the histogram that overlaps the other two histograms. I don't mind having slightly jagged edges on my curve, I don't expect it to be perfectly 'smooth'. Does anyone know how I can make my graphs 'transparent'?

채택된 답변

John Petersen
John Petersen 2012년 7월 10일
편집: John Petersen 2012년 7월 10일
plot(xout1,n1,xout2,n2,xout3,n3);
For transparent hist
h=findobj(gca,'Type','patch');
set(h,'FaceColor','white');

추가 답변 (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