How to change the middle line width in barh plot?

1 次查看(过去 30 天)
Hi,
I tried to change the middle line width in barh plot
using set(gca,'linewidth',3), this modifies the x and y-axis.
Any and all help is much appreciated!
figure
Y1 = 1:4;
Y2 = 5:8;
data = rand(4);
barh(Y1,(abs(data(:,1))),'r');
hold on
barh(Y2,(abs(data(:,2))),'g');
hold on
barh(Y1,(-(abs(data(:,3)))),'r')
hold on
barh(Y2,(-(abs(data(:,4)))),'g')
set(gca,'linewidth',3)
box off
  2 个评论
Star Strider
Star Strider 2018-2-12
What is ‘the middle line’?
Please give an example of what you want the barh plot to look like.
Bruno
Bruno 2018-2-12
Hi, I want to increase the width of the middle line in the barh plot

请先登录,再进行评论。

采纳的回答

KL
KL 2018-2-12
You don't need to change the axis line thickness but simply plot a vertical line like,
plot([0 0],[0 10],'k','linewidth',3)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by