# How to jam the axis of a pgfplots plot?

I need to have some kind of jump on the axis of the plot in pgfplots package. Something similar to the following figure where some part of the scales are jammed.

It would be interesting to have even different scales for the top and botoom traces (exactly like the figure).

Any idea is appreciated.

-

You can simply use two axes that you position relative to each other.

Here's an example where I've defined a new key axis break gap that can be used to set the gap between the axes:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplotstable}
\tikzset{
axis break gap/.initial=1mm
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
name=bottom axis,
domain = 0:pi,
scale only axis,
width=8cm, height=4cm,
axis x line*=bottom
]
\end{axis}
\begin{axis}[
at=(bottom axis.north),
anchor=south, yshift=\pgfkeysvalueof{/tikz/axis break gap},
domain = 0:pi,
scale only axis,
width=8cm, height=4cm,
axis x line*=top,
xticklabel=\empty,
after end axis/.code={
\draw (rel axis cs:0,0) +(-2mm,-1mm) -- +(2mm,1mm)
++(0pt,-\pgfkeysvalueof{/tikz/axis break gap})
+(-2mm,-1mm) -- +(2mm,1mm)
(rel axis cs:1,0) +(-2mm,-1mm) -- +(2mm,1mm)
++(0pt,-\pgfkeysvalueof{/tikz/axis break gap})
+(-2mm,-1mm) -- +(2mm,1mm);
}
]