![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272510/image.png)
thick values i log scale
2 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Kavya Vuriti
on 19 Feb 2020
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/272510/image.png)
0 Comments
See Also
Categories
Find more on Lighting, Transparency, and Shading 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!