此函數創建一個水平條形圖,x 中的值用於標記每個條形,y 中的值用於確定條形的水平長度。
用法
barh(y) // It creates a horizontal bar graph with one bar for each element in y. If y is an m-by-n matrix, then barh creates m groups of n bars.
barh(x,y)// It draws the bars along the vertical axis at the locations specified by x.示例
World population by continents
cont=char ('Asia','Europe','Africa',...'N.America','S.America');
pop=[333.2;696;694;437;307];
barh(pop)
for i=1:5,
	gtext(cont(i,:));
end
xlabel('Population in millions');
Title (World population (1992)','fontsize', 18)輸出:
相關用法
- MATLAB meshz()用法及代碼示例
 - MATLAB contour()用法及代碼示例
 - MATLAB loglog()用法及代碼示例
 - MATLAB ribbon()用法及代碼示例
 - MATLAB comet()用法及代碼示例
 - MATLAB Stairs()用法及代碼示例
 - MATLAB pcolor()用法及代碼示例
 - MATLAB Bar()用法及代碼示例
 - MATLAB contour3()用法及代碼示例
 - MATLAB area()用法及代碼示例
 - MATLAB stem3()用法及代碼示例
 - MATLAB waterfall()用法及代碼示例
 - MATLAB quiver()用法及代碼示例
 - MATLAB slice()用法及代碼示例
 - MATLAB Semilogy()用法及代碼示例
 - MATLAB plotyy()用法及代碼示例
 - MATLAB fill3()用法及代碼示例
 - MATLAB fill()用法及代碼示例
 - MATLAB cylinder()用法及代碼示例
 - MATLAB ellipsoid()用法及代碼示例
 
注:本文由純淨天空篩選整理自 MATLAB barh()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
