How can I set zlabel log scale on 3d plot

6 ビュー (過去 30 日間)
수연
수연 2024 年 3 月 6 日
回答済み: Chunru 2024 年 3 月 6 日
set(gca,'xscale','log');
set(gca,'yscale','log');
set(gca,'zscale','log')
When I use the code, xlabel doesn't change with log scale.
I've used loglog, semilog but it doesn't work.
  1 件のコメント
VBBV
VBBV 2024 年 3 月 6 日
use the command
grid on
after plotting 3D function. Sometimes it is not visible clearly
I've used loglog, semilog but it doesn't work.
These are meant for 2D plots only

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

回答 (1 件)

Chunru
Chunru 2024 年 3 月 6 日
[X,Y,Z] = peaks(50);
X = X - min(X(:)) + 1; % make it +ve for log
Y = Y - min(Y(:)) + 1;
Z = Z - min(Z(:)) + 1;
surf(X, Y, Z)
set(gca,'xscale','log');
set(gca,'yscale','log');
set(gca,'zscale','log')

カテゴリ

Help Center および File ExchangeLog Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by