TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I achieve something similar to the "dropped spines" example below using pgfplots?

from matplotlib.sourceforge.com

share|improve this question
up vote 7 down vote accepted

I don't think pgfplots has an option for this out of the box, but you can relatively easily achieve this using the various styles that control axis lines, tick marks and tick labels:


\begin{axis}[clip=false, % don't clip the graph at the "virtual edge" of the plot
ymin=-1, ymax=1,
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))};

enter image description here

share|improve this answer
Excellent, thank you! – 0sh Feb 15 '11 at 10:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.