"Highlight" a vertical gridline on a figure

조회 수: 1 (최근 30일)
Robert Demyanovich
Robert Demyanovich 2021년 6월 10일
답변: Steven Lord 2021년 6월 10일
I have a figure where the range of x values starts at a negative value and goes to a positive value. I would like to "highlight" the vertical grid line at an x axis value of zero. By highlight I mean increase the width of that gridline or maybe even change the color. Changing the line from solid to dash might also be a good idea.
  댓글 수: 2
KSSV
KSSV 2021년 6월 10일
You can draw the lines using function line
KSSV
KSSV 2021년 6월 10일
You can read about grid here further: https://in.mathworks.com/help/matlab/ref/grid.html

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
Steven Lord 2021년 6월 10일
There are a couple possible ways to do this. Off the top of my head the one I'd probably use is to set the YAxisLocation property of the axes to 'origin'. See the pictures in the documentation of that property on this documentation page. You could also create a line using the xline function.

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by