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 ExchangeLine 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