I have multiple plots (about 15 different figures) that have the same axes (i.e., same ymin
and ymax
values and same xticks
). One of the plots has very large values. I don't want to either increase ymax
nor use log scale for the y-axis. I want to display the y values greater than ymax
by adding a discontinuity on the y-axis.
Here is an MWE:
\documentclass[preview=true]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{preview}
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=100, log ticks with fixed point,
]
\addplot table {
1 10
2 20
4 25
};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=100, log ticks with fixed point,
]
\addplot table {
1 50
2 100
4 200
};
\end{axis}
\end{tikzpicture}
\end{preview}
\end{document}
What I need:
I have added the short lines on the axes and the plot are to denote the discontinuity. The numbers 100 and 200 on the y-axis may not be a good idea; this kind of presentation may be a source of misunderstanding. It may be better to display y values as labels near data points as follows:
The input data of plots comes from a pgfplotstable
.
pgfplots
supports discontinuities. Are the examples in the manual suitable for you?pgfplots
is limited to a discontinuity from an axismin
ormax
back to zero only; additionally the plot cannot cross the discontinuity with the current functionality. I think this case will need to be handled manually.