#62 Boxed axis not closed correctly

closed-fixed
nobody
None
5
2013-02-02
2013-02-01
Jake
No

The path used for drawing the axes in a boxed axis is not closed correctly. There is an error in the conditional in the \pgfplots@drawaxis@outerlines@cycledpath file: It's supposed to check whether there are any axis discontinuities, and if there aren't, it inserts a "--cycle" into the path. What it does instead, though, is to *only* insert the "--cycle" if there are both x and y axis discontinuities.

Here's the fixed function:

\def\pgfplots@drawaxis@outerlines@cycledpath{%
\draw[
/pgfplots/every outer x axis line, % using these outer styles is only useful in conjunction with 'separate axis lines=true'
/pgfplots/every outer y axis line]
\pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra
\ifpgfplots@hide@y
{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymax}}\endpgfextra }
\else
decorate [ydiscont,decoration={pre length=\ydisstart, post length=\ydisend}]
% { -- (\pgfplots@xmin, \pgfplots@ymax) }
{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymax}}\endpgfextra }
\fi
\ifpgfplots@hide@x
%{ (\pgfplots@xmax, \pgfplots@ymax) }
{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymax}}\endpgfextra }
\else
decorate [xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}]
%{ -- (\pgfplots@xmax, \pgfplots@ymax) }
{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymax}}\endpgfextra }
\fi
\ifpgfplots@hide@y
%{ (\pgfplots@xmax, \pgfplots@ymin) }
{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymin}}\endpgfextra }
\else
decorate [ydiscont,decoration={pre length=\ydisend, post length=\ydisstart}]
%{ -- (\pgfplots@xmax, \pgfplots@ymin) }
{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymin}}\endpgfextra }
\fi
\ifpgfplots@hide@x
%{ (\pgfplots@xmin, \pgfplots@ymin) }
{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra }
\else
decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}]
%{ -- (\pgfplots@xmin, \pgfplots@ymin) }
{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra }
\fi
% make sure that we do not have any of the axis discontinuities
% here - they should not be closed.
\if0\pgfplots@xaxisdiscontnum
\else
\if0\pgfplots@yaxisdiscontnum
\else
-- cycle
\fi
\fi
;%
}%

Discussion

  • Fixed. Thanks for the report and the good analysis!

     
    • status: open --> closed-fixed