Change the grid lines' LineWidth

How can I change the grid lines' LineWidth??

2 commentaires

Oleg Komarov
Oleg Komarov le 23 Fév 2012
No way to control it separately from the axes.
Rafi
Rafi le 28 Jan 2024
I want to change only the horizontal and vertical central line, how do you do it?

Connectez-vous pour commenter.

Réponses (4)

Jan
Jan le 23 Fév 2012

1 vote

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

3 commentaires

owr
owr le 23 Fév 2012
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 le 23 Fév 2012
is it possible to change length of ticks with TickLength and use them as grids?
Oleg Komarov
Oleg Komarov le 23 Fév 2012
You'll get black straight lines.

Connectez-vous pour commenter.

Toshia M
Toshia M le 17 Mar 2023
Modifié(e) : Toshia M le 17 Mar 2023

1 vote

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. le 29 Mai 2020

0 votes

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

0 votes

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

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Question posée :

le 23 Fév 2012

Commenté :

le 28 Jan 2024

Community Treasure Hunt

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

Start Hunting!

Translated by