axis off sets background color back to white despite set(gca....
조회 수: 36 (최근 30일)
이전 댓글 표시
set(gca,'color',[0 0 0]);
set(gca,'color','black');
set(gcf,'inverthardcopy','off');
daspect([1 1 1])
axis off % this sets background back to default !!!!!!!...:( why?
set(gca,'color',[0 0 0]);
댓글 수: 0
답변 (2개)
Biraj Khanal
2022년 1월 26일
편집: Biraj Khanal
2022년 1월 26일
The axis off does not set your 'background color' to default. It removes the axes from the figure making it practically hide it. This is why you see the default background. Just turn the axis on to see the axis of which you set the color to black.
댓글 수: 0
Star Strider
2022년 1월 26일
If the desired result is simply to make the axes invisible, perhaps using the Axes Properties XColor, YColor, and ZColor values to 'none' will work. Also see the documentation section on NumericRuler Properties.
.
댓글 수: 2
Star Strider
2022년 2월 3일
Like this?
x = 1:10;
y = rand(1,10);
figure
plot(x, y, '-r', 'LineWidth',2)
Ax = gca;
Ax.Color = 'k';
Ax.XColor = 'none';
Ax.YColor = 'none';
Add other function calls to change other properties, as necessary.
.
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!