With the axis enviroment in TikZ, how can I make the "shortened" horisontal axis? TIA.

Asked
Active
Viewed 157 times
0
mf67
- 666
1 Answers
4
You can use the axis x discontinuity option (as also suggested in the comments):
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
thick,
axis lines=left,
axis x discontinuity=crunch,
ticks=none,
xmin=0.8,
xmax=2.2,
ymin=-0.2,
ymax=1,
]
\addplot[thick,domain=1:2] {ln(x)};
\end{axis}
\end{tikzpicture}
\end{document}

axis x discontinuity=crunchdo exactly what the OP for? – Torbjørn T. Apr 23 '22 at 16:03