个性化阅读
专注于IT技术分析

MATLAB函数barh()

此函数创建水平条形图, 其中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函数barh()

赞(0)
未经允许不得转载:srcmini » MATLAB函数barh()

评论 抢沙发

评论前必须登录!