Plotの背景(軸外)の色を変えたい

76 views (last 30 days)
Yu
Yu on 12 Oct 2021
Answered: Kojiro Saito on 13 Oct 2021
こんにちは。
一つのライブスクリプト内で、複数のscatter3とpcshowを利用して、figureを表示させています。
pcshowの全背景が黒であるためか、それにひっぱられてscatter3の最外枠の背景も黒になってしまいます。
軸内はColorで色指定できているのですが、その外側をどう制御すればよいかわかりません。
ご存知のかたがいらっしゃいましたら、教えていただけますと嬉しいです。
% Scatter3
s1 = scatter3(Longitude_target2,Latitude_target2,Depth_target2,10,SI_target2);
cb = colorbar;
cb.Color = 'w';
colormap jet;
caxis([-70 -10]);
set(gca,'color','w')
% pcshow
pcshow(ptCloud.Location,ClusterLabel)

Accepted Answer

Kojiro Saito
Kojiro Saito on 13 Oct 2021
バージョンR2021bからpcshow の機能改善で背景色を'BackgroundColor'で変更できるようになりました。
R2021bなら以下のようにして背景色を白に変更できます。
numFaces = 600;
[x,y,z] = sphere(numFaces);
pcshow([x(:), y(:), z(:)], 'BackgroundColor', 'white');
また、それ以前のバージョン(例えばR2021a)ですと、Figure 上でマウス右クリックで「背景色」→「カスタム」をクリックして、白色を指定することで変更できます。

More Answers (0)

Categories

Find more on 2 次元および 3 次元プロット in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!