Matlab中是否存在浮动条形图? [英] Do floating bar graphs exist in matlab?

查看:124
本文介绍了Matlab中是否存在浮动条形图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个简单的条形图,该条形图看起来基本上类似于以下可怕的ASCII渲染:

I'm trying to make a simple bar graph that would essentially look like the following horrible ASCII rendering:

Y
| ----------
|     ---
|         -----
| --
| -------
|______________ X
  5  6  7  8 9

这可能吗?我还没有找到一种方法.

Is this possible? I haven't found a way to do it.

推荐答案

如果您确切了解图形中所需条形的坐标以及每条条形线的宽度,则可以执行以下操作:

If you know exactly the coordinates of the desired bars in the graph, and the width of each bar line, you can do somthing like that:

a=[5 10; 5 23; 7 13; 6 18];      % each pair is a start point of bar 
L=0.1;                           %Bar width

for i=1:size(a,1)
    plot([a(i,1) a(i,1)+L], [a(i,2) a(i,2)])
    hold on
    ylim([ 9 24])
end

a中放置坐标,而L是钢筋长度.

where in a you put the coordinates, and L is the bar length.

这篇关于Matlab中是否存在浮动条形图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆