caxis equivalent for slice plot

1 ビュー (過去 30 日間)
Nick K
Nick K 2020 年 12 月 30 日
コメント済み: Ameer Hamza 2020 年 12 月 31 日
I have a plot that uses the slice command.
Is there a way to rescale the colormap of the resulting slice as would usully be done throiugh caxis([lower upper])?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 12 月 30 日
編集済み: Ameer Hamza 2020 年 12 月 30 日
caxis() also works for slice(). See the difference between two figures
[X,Y,Z] = meshgrid(-2:.2:2);
V = X.*exp(-X.^2-Y.^2-Z.^2);
xslice = [-1.2,0.8,2];
yslice = [];
zslice = 0;
figure()
slice(X,Y,Z,V,xslice,yslice,zslice)
figure()
slice(X,Y,Z,V,xslice,yslice,zslice)
caxis([-2 2])
  2 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 12 月 31 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Find more on Colormaps 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!

Translated by