Open pgf-tikz-bot opened 4 years ago
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/234/#d557 Author: manuelkuehner Timestamp: 2020-02-04 12:22:13.100000
Origin of this topic is my answer at https://tex.stackexchange.com/questions/526852.
Any chance to get some attention on this bug?
diff --git a/tex/generic/pgfplots/pgfplots.code.tex b/tex/generic/pgfplots/pgfplots.code.tex
index 0b4486b..b81ef66 100644
--- a/tex/generic/pgfplots/pgfplots.code.tex
+++ b/tex/generic/pgfplots/pgfplots.code.tex
@@ -5267,9 +5267,18 @@
%{ (\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 }
+ \if0\pgfplots@xaxisdiscontnum\relax
+ \else
+ decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}]
+ %{ -- (\pgfplots@xmin, \pgfplots@ymin) }
+ { \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra }
+ \if0\pgfplots@yaxisdiscontnum
+ \else
+ decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}]
+ %{ -- (\pgfplots@xmin, \pgfplots@ymin) }
+ { \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra }
+ \fi
+ \fi
\fi
% make sure that we do not have any of the axis discontinuities
% here - they should not be closed.
```tex \documentclass{article} \usepackage{pgfplots} \usepackage{xpatch} \makeatletter \def\patch{% \xpatchcmd\pgfplots@drawaxis@outerlines@cycledpath{% decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] %{ -- (\pgfplots@xmin, \pgfplots@ymin) } { \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra } }{% \if0\pgfplots@xaxisdiscontnum\relax \else decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] %{ -- (\pgfplots@xmin, \pgfplots@ymin) } { \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra } \if0\pgfplots@yaxisdiscontnum \else decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] %{ -- (\pgfplots@xmin, \pgfplots@ymin) } { \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}\endpgfextra } \fi \fi }{}{\PatchFailed} } \makeatother \def\test{ \begin{tikzpicture} \begin{axis}[ width = 20mm, height = 20mm, xmin = -1.2, xmax = 2.2, ymin = -1.3, ymax = 4.3, axis line style = {rounded corners=5mm}, scale only axis, ticks = none ] \end{axis} \end{tikzpicture} } \begin{document} Before \test % \patch After \test \end{document} ```
Briefly, this is the same difference between
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[rounded corners=3mm]
\draw (0,0) -- ++(1,0) -- ++(0, 1) -- ++(-1,0) -- ++(0, -1) -- cycle;
\draw[xshift=1.2cm] (0,0) -- ++(1,0) -- ++(0, 1) -- ++(-1,0) -- cycle;
\end{tikzpicture}
\end{document}
I recalled a similar problem was caught elsewhere. Rectangle
path operation takes care of cycle
, but the code here uses decorate
option...
TODO: check if lines 5267--5268 need similar patch https://github.com/pgf-tikz/pgfplots/blob/a1fe88f619859de5f798ab4c095aeea40f6fad59/tex/generic/pgfplots/pgfplots.code.tex#L5266-L5284
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/234/ Author: manuelkuehner Timestamp: 2020-02-04 12:21:10.720000
https://sourceforge.net/p/pgfplots/bugs/234/attachment/InkedScreenshot%202020-02-04%2020.19.49_LI.jpg
This creates a additional line, see screenshot.