Change the grid lines' LineWidth

How can I change the grid lines' LineWidth??

댓글 수: 2

Oleg Komarov
Oleg Komarov 2012년 2월 23일
No way to control it separately from the axes.
Rafi
Rafi 2024년 1월 28일
I want to change only the horizontal and vertical central line, how do you do it?

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

답변 (4개)

Jan
Jan 2012년 2월 23일

1 개 추천

You can disable the grid and draw the lines manually using the positions of the ticks.

댓글 수: 3

owr
owr 2012년 2월 23일
Done this myself as well - not pretty but it does the trick. If performance becomes an issue it may help if you use lower level graph primitives like "line"
G A
G A 2012년 2월 23일
is it possible to change length of ticks with TickLength and use them as grids?
Oleg Komarov
Oleg Komarov 2012년 2월 23일
You'll get black straight lines.

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

Toshia M
Toshia M 2023년 3월 17일
편집: Toshia M 2023년 3월 17일

1 개 추천

There is a new feature in R2023a for changing the grid line width. For more information, see this solution: https://www.mathworks.com/matlabcentral/answers/157863-change-grid-line-width
Andre B.
Andre B. 2020년 5월 29일

0 개 추천

You can use 'GridAlpha' (initially set to 0.15). It has a similar effect as changing the LineWidth.
Jürgen Stein
Jürgen Stein 2020년 11월 27일

0 개 추천

set(gca,'LineWidth',LineWidth)
...will set both the axes outline and grid line width.

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

태그

질문:

2012년 2월 23일

댓글:

2024년 1월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by