6

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.

4
  • pgfplots supports discontinuities. Are the examples in the manual suitable for you?
    – percusse
    Feb 23 '14 at 13:48
  • @percusse the support in pgfplots is limited to a discontinuity from an axis min or max 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. Feb 23 '14 at 16:53
  • 3
    @PaulGessler Yes, but discontinuities are meant for shifting the attention without distorting the axis scale. Otherwise you don't know what you are seeing. So shifting the data below to the empty area might be an option. Otherwise this slash business is confusing at the least.
    – percusse
    Feb 23 '14 at 17:22
  • Dear @percusse, in the real case, only two of six data points of a line are above the regular range and there is no space to shift due to the four data points, so I can not shift. I know this slash business is confusing, however something like in the first picture at page tex.stackexchange.com/questions/46422/axis-break-in-pgfplots may present the data better. Additionally, there are 15 figures and they are automatically generated from a pgfplotstable. I do not know how to customize the plot for one of the 15 instances.
    – Kadir
    Feb 24 '14 at 7:46