Customizing graph plot area

5 ビュー (過去 30 日間)
Abdullah Alhebshi
Abdullah Alhebshi 2021 年 11 月 5 日
コメント済み: Abdullah Alhebshi 2021 年 11 月 6 日
I want to make the plot area different color and thicker gridlines
Smething like this

採用された回答

TADA
TADA 2021 年 11 月 6 日
編集済み: TADA 2021 年 11 月 6 日
You can find all the properties of axes in the documentation
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
  1 件のコメント
Abdullah Alhebshi
Abdullah Alhebshi 2021 年 11 月 6 日
Thank you so much, but how about the minor gridlines ? is it possible to change the thickness too ?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by