How to remove the horizontal line at 0
조회 수: 37 (최근 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/509027/image.jpeg)
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!