How to plot a Bar Graph without a uniform spacing on the horizontal axis
4 次查看(过去 30 天)
显示 更早的评论
Hello, suppose I have a bar graph where I am testing some data with How can I have these four values spaced equally on the horizotnal axis?
0 个评论
采纳的回答
KSSV
2021-5-10
编辑:KSSV
2021-5-10
You can plot the values by index and show the respective values uisng text.
Example:
x = [5 10 100 1000] ;
y = rand(size(x)) ;
bar(y)
text(1:length(x),y,num2str(x'),'vert','bottom','horiz','center');
Or, use xticklabels and show the values at the x-axes.
Example:
x = [5 10 100 1000] ;
y = rand(size(x)) ;
bar(y)
xticklabels(x)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!