Semilog in 3d scatter graph

7 views (last 30 days)
Vittorio Faustinella
Vittorio Faustinella on 17 Feb 2022
Answered: Voss on 17 Feb 2022
Hi everyone, to plot some results I have written these:
load('file.mat');
for i=1:100
k(i)=s(i).k;
epsilon_s(i)=s(i).epsilon_s;
lambda(i)=s(i).lambda_noisy;
end
figure (1)
scatter3(k,lambda,epsilon_s, 'MarkerEdgeColor', 'k','MarkerFaceColor', [0 0.447 0.7]);
xlabel k , ylabel lambda , zlabel epsilon
How can I set the x-axis to logarithmic scale?
Thanks

Accepted Answer

David Hill
David Hill on 17 Feb 2022
set(gca,'xscale','log')

More Answers (1)

Voss
Voss on 17 Feb 2022
You can do set(gca(),'XScale','log') after you create your scatter plot:
% Using random data
figure (1)
scatter3(rand(1,100),rand(1,100),rand(1,100), 'MarkerEdgeColor', 'k','MarkerFaceColor', [0 0.447 0.7]);
set(gca(),'XScale','log')
xlabel k , ylabel lambda , zlabel epsilon

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!