How to make Xaxis (y=0) black in grid
36 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a plot with grid and I would like to have just the Xaxis, y=0, darker so that it is more evident in the graph. How can I do it?
Many thanks
0 commentaires
Réponse acceptée
Hikaru
le 18 Août 2014
Not sure if this is exactly what you want to do, but instead of making it darker, why not making it thicker?
x = [1, 2, 3, 4, 5];
y = [0, 0, 0, 0, 0];
plot(x,y,'k', 'LineWidth', 3) % 'k' for black, and you can adjust the linewidth accordingly.
Plus de réponses (1)
Dishant Arora
le 18 Août 2014
You can change axis color by changing the xcolor or ycolor property of axis:
h = gca;
set(h , 'ycolor' , [1,1,1]);
set(h , 'ygrid' , 'on'); % Set only Y - Grids to property on, you'll not see X - Grid
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!