I'm trying to do Multiple axis discontinuities with pgfplots, and so based on Axis break in pgfplots, I produced this MWE:
\documentclass{article}
\usepackage{calc} %\widthof
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usetikzlibrary{pgfplots.groupplots}
\usepackage{adjustbox}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{groupplot}[
group style={
group name=my fancy plots,
group size=2 by 1,
yticklabels at=edge left,
%xticklabels at=edge bottom,
%vertical sep=0pt,
horizontal sep=0pt,
},
% width=8.5cm,
height=6cm,
ymin=-6, ymax=6
]
\nextgroupplot[
xmin=0,xmax=5,
xtick={0,5,10},
axis y line=left,
%axis x discontinuity=parallel, % disc. is at start, so avoid for first
axis x line=bottom,
x axis line style=-, % switch off the axis arrow tips,
%width=4.5cm, % don't set width,
x=0.1cm, % set x scale (for width)
]
\addplot {x*0};
\nextgroupplot[
xmin=45,xmax=80,
axis y line=none,
xtick={60,80},
axis x discontinuity=parallel,
axis x line=bottom,
%width=2.0cm, % don't set width,
x=0.1cm, % set x scale (for width)
]
\addplot {0*x};
\end{groupplot}
\end{tikzpicture}
\end{center}
\end{document}
Turns out, what I get is this:
... that is, the function is plotted only in the first "sub"plot, but not in the second one?!
Where am I going wrong, and how can I get the function to plot in its entirety?
-5
to5
. You have to setdomain=0:80
.