Customizing graph plot area
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Abdullah Alhebshi
le 5 Nov 2021
Commenté : Abdullah Alhebshi
le 6 Nov 2021
I want to make the plot area different color and thicker gridlines
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/791094/image.png)
Smething like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/791099/image.jpeg)
0 commentaires
Réponse acceptée
TADA
le 6 Nov 2021
Modifié(e) : TADA
le 6 Nov 2021
changing the background color ia easy:
set(gca, 'Color', [0.1, 0.1, 0.1])
I cant find a line width property for the gridlines, you can change their line style or color. And if you absolutely must have thick gridlines, you can simply plot them yourself.
plot(1:10);
x = xticks(gca);
y = yticks(gca);
xMinMax = xlim(gca);
yMinMax = ylim(gca);
hold on;
plot([x(:)'; x(:)'], repmat(yMinMax(:), 1, numel(x)), 'k-', 'LineWidth', 1);
plot(repmat(xMinMax(:), 1, numel(y)), [y(:)'; y(:)'], 'k-', 'LineWidth', 1);
Off point, i wouldn't want tomake thick gridlines, because that would make it harder to read your plot,unless you are
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots 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!