How to remove the horizontal line at 0
40 ビュー (過去 30 日間)
古いコメントを表示
Hi All,
- How do I get rid of the horizontal line at the zero (0) mark on the y-axis in a line plot? Please see attached image below as an example. I want the horizontal line hidden.

2. How do I superimpose a barchart on a line plot?
Thank you all.
3 件のコメント
Walter Roberson
2021 年 2 月 5 日
Please save x and y to a mat file and attach the file here for us to test.
You can get that kind of output if your x values are not in strict monotonic order.
採用された回答
David Hill
2021 年 2 月 5 日
x=1:10;
y=randi(20,1,10)-10;
b=bar(x,y);
ax=gca;%to access axes properties
hold on
plot(x,y,'r*--')
b.ShowBaseLine='off'
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!