我怎样才能实现类似于下面的“掉落的脊椎”的例子pgf图?
答案1
我认为 pgfplots 没有现成的选项,但你可以使用控制轴线、刻度线和刻度标签的各种样式相对轻松地实现这一点:
\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[clip=false, % don't clip the graph at the "virtual edge" of the plot
ymin=-1, ymax=1,
xmin=-3.141,xmax=3.141,
ticklabel shift=0.5cm, % shift all tick labels 0.5cm outwards
%
axis y line*=left, % only one y axis on the left, * switches off the arrow tip
y axis line style={xshift=-0.5cm}, % shift y axis 0.5 cm to the left
ytick style={xshift=-0.5cm}, % shift y axis tick marks 0.5 cm to the left
%
axis x line*=bottom,
x axis line style={yshift=-0.5cm},
xtick style={yshift=-0.5cm},
]
\addplot +[domain={-pi:pi},no marks,smooth,thick] {sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{document}