how to plot x-axis only
조회 수: 22 (최근 30일)
이전 댓글 표시
hello, everyone, i wonder how to plot a gragh like this:
![QQ图片20190527221922.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/221203/QQ%E5%9B%BE%E7%89%8720190527221922.png)
with x-aixs only and two directions
댓글 수: 0
채택된 답변
Star Strider
2019년 5월 27일
This comes close:
figure
xlim([-4.2 4.2])
plot((rand(1,20)-0.5)*3, zeros(1,20), '+r')
text(min(xlim), 0.025, '\leftarrow', 'HorizontalAlignment','left', 'VerticalAlignment','middle', 'FontSize',18)
text(max(xlim), 0.025, '\rightarrow', 'HorizontalAlignment','right', 'VerticalAlignment','middle', 'FontSize',18)
set(gca, 'XAxisLocation','origin', 'YColor','none')
Experiment to get the result you want.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!