フィルターのクリア

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 Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by