thick values i log scale

3 ビュー (過去 30 日間)
SYML2nd
SYML2nd 2020 年 1 月 3 日
回答済み: Kavya Vuriti 2020 年 2 月 19 日
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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by