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!