Customizing graph plot area

조회 수: 6 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by