"Highlight" a vertical gridline on a figure

1 Ansicht (letzte 30 Tage)
Robert Demyanovich
Robert Demyanovich am 10 Jun. 2021
Beantwortet: Steven Lord am 10 Jun. 2021
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 Kommentare
KSSV
KSSV am 10 Jun. 2021
You can draw the lines using function line
KSSV
KSSV am 10 Jun. 2021
You can read about grid here further: https://in.mathworks.com/help/matlab/ref/grid.html

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Steven Lord
Steven Lord am 10 Jun. 2021
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.

Community Treasure Hunt

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

Start Hunting!

Translated by