thick values i log scale

1 visualización (últimos 30 días)
SYML2nd
SYML2nd el 3 de En. de 2020
Respondida: Kavya Vuriti el 19 de Feb. de 2020
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?

Respuestas (1)

Kavya Vuriti
Kavya Vuriti el 19 de Feb. de 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:

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by