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

47 vues (au cours des 30 derniers jours)
Yu
Yu le 12 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)

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur ライティング、透明度、およびシェーディング dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!