Como fazer diferentes escalonamentos de eixos em diferentes partes do gráfico, como, por exemplo, mostrado nesta figura. Tenho um gráfico parecido, mas não gosto que os pontos do início fiquem muito próximos do eixo Y devido ao fato das coordenadas X serem pequenas, como posso consertar?
\pgfplotsset{compat=newest}
\begin{figure} [H]
\centering
{
\begin{tikzpicture}
\begin{axis}
[ scale only axis, % The height and width argument only apply to the actual axis
height=8cm,
width=15cm,
enlargelimits=true,
axis lines = middle, % привычные оси со стрелочками с пересечением в нуле
% возможные значения: box, left, middle, center, right, none
xlabel = {$f$, кГц}, % подпись оси x
ylabel = {$K(f)$}, % подпись оси y
xlabel style={below right},
ylabel style={above left},
grid=major, % м.б. еще both - и там и там
grid style={dotted, cyan},
]
\addplot coordinates {
(0.02,0.8)
(0.1,0.8)
(0.2,0.75)
(0.5,0.7)
(1,0.6)
(2,0.4)
(5,0.25)
(10,0.15)
(15,0.1)
(20,0.07)
(50,0.034)
(100,0.016)
(200,0.008)
};
\end{axis}
\end{tikzpicture}
}
\caption{График }
\end{figure}
Responder1
Bem-vindo ao TeX.SX! Você pode querer tentar semilogxaxis
em vez de axis
qual escalará o log doxeixo:
\documentclass[border=10pt]{standalone}
\usepackage[T2A]{fontenc}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[
scale only axis, % The height and width argument only apply to the actual axis
height=8cm,
width=15cm,
axis lines=left, % привычные оси со стрелочками с пересечением в нуле
% возможные значения: box, left, middle, center, right, none
axis line shift=10pt,
xlabel={$f$, кГц}, % подпись оси x
ylabel={$K(f)$}, % подпись оси y
grid=major, % м.б. еще both - и там и там
grid style={dotted, cyan},
log ticks with fixed point,
xtick={0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200},
]
\addplot coordinates {
(0.02,0.8)
(0.1,0.8)
(0.2,0.75)
(0.5,0.7)
(1,0.6)
(2,0.4)
(5,0.25)
(10,0.15)
(15,0.1)
(20,0.07)
(50,0.034)
(100,0.016)
(200,0.008)
};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}