thick values i log scale

5 次查看(过去 30 天)
SYML2nd
SYML2nd 2020-1-3
Hi all,
I would like to obtain (using the loglog in order to plot the graph) a thick line on the abscissa thick with the value represented as shown in the figure attached. In other words I would like to show the thick value in power of ten, showing the extremes also if they are value like 500, I would like to show them in the form 5*10^2.
I post this after a research, I have already seen this https://it.mathworks.com/matlabcentral/answers/359447-how-changing-the-loglog-scale-x-and-y-axis , . I aapplied it using the following, but I would like to show all the value in power of ten.
loglog(x, y)
xlabel ('Frequency (Hz)')
ylabel ('tke amplitude (m^2/s)')
xlim([10^-1,200])
ylim([10^-3,2])
grid on
tickpos = [10^-1 10^0 10^1 10^2 2*10^2];
set(gca, 'XTick', tickpos)
And I have already seen this https://it.mathworks.com/matlabcentral/answers/27951-format-axes-tick-labels-in-log-scale but I cannot show correclty value like 5*10^2.
Can you help me?

回答(1 个)

Kavya Vuriti
Kavya Vuriti 2020-2-19
Hi,
You could try modifying your code as shown below:
loglog(x, y)
xlabel ('Frequency (Hz)')
ylabel ('tke amplitude (m^2/s)')
xlim([10^-1,200])
ylim([10^-3,2])
grid on
xticks([10^-1 10^0 10^1 10^2 2*10^2]);
xticklabels({'10^-1', '10^0', '10^1', '10^2', '2*10^2'});
This would give plot as shown below:

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by