From b0bbb16868aaaec22b5364602679a3cafb246273 Mon Sep 17 00:00:00 2001 From: schtandard Date: Thu, 30 May 2024 23:46:44 +0200 Subject: [PATCH 1/3] Avoid missing minor ticks at axis end --- tex/generic/pgfplots/pgfplotsticks.code.tex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tex/generic/pgfplots/pgfplotsticks.code.tex b/tex/generic/pgfplots/pgfplotsticks.code.tex index 1e8fb50f2..630e1bada 100644 --- a/tex/generic/pgfplots/pgfplotsticks.code.tex +++ b/tex/generic/pgfplots/pgfplotsticks.code.tex @@ -1038,7 +1038,7 @@ % SEE BELOW for the 'minor #1tick' feature -- it has a % separate loop. \foreach \pgfplots@i in {1,...,\pgfplots@minor@tick@num} {% - % XXX : bug 165 [minor ticks] minor tick drawn after the last xtick + % XXX : bug 165 [minor ticks] minor tick drawn after the last xtick % seems to be here. Does that harm? \ifpgfplots@islinear \pgfmathmultiply@{\pgfplots@i}{\pgfplots@minor@tick@dist}% @@ -2309,7 +2309,10 @@ % \if0\pgfplots@tick@returnval@ready \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\H}}% - \advance\MAX by0.5\H % avoid rounding inaccuracies: + % No minor ticks will be drawn past the last tick, so we + % need to add one H to make sure it is past the axis limit. + % Add an extra H / 2 to avoid rounding inaccuracies. + \advance\MAX by1.5\H \xdef\pgfplots@glob@TMPa{\pgf@sys@tonumber{\MIN},\pgf@sys@tonumber{\MINH},...,\pgf@sys@tonumber{\MAX}}% \fi %\message{final H=\the\H; returning \pgfplots@glob@TMPa.}% From 974c670bcce61a7376de003355fdc3c1913cf8aa Mon Sep 17 00:00:00 2001 From: schtandard Date: Thu, 30 May 2024 23:51:44 +0200 Subject: [PATCH 2/3] Clean up comment --- tex/generic/pgfplots/pgfplotsticks.code.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tex/generic/pgfplots/pgfplotsticks.code.tex b/tex/generic/pgfplots/pgfplotsticks.code.tex index 630e1bada..73fd090c4 100644 --- a/tex/generic/pgfplots/pgfplotsticks.code.tex +++ b/tex/generic/pgfplots/pgfplotsticks.code.tex @@ -1033,13 +1033,15 @@ \fi % X-Axis ticks bottom and top \ifpgfplots@needsminorloop + % Do not add minor ticks past the last xtick. + % When auto-generating tick positions, an extra tick past the axis + % limit is ensured by \pgfplots@assign@default@tick@foraxis@compute + % so that no minor ticks are omitted in that case. \ifnum\pgfplots@ticknum=\c@pgfplots@ticknum@last\relax \else % SEE BELOW for the 'minor #1tick' feature -- it has a % separate loop. \foreach \pgfplots@i in {1,...,\pgfplots@minor@tick@num} {% - % XXX : bug 165 [minor ticks] minor tick drawn after the last xtick - % seems to be here. Does that harm? \ifpgfplots@islinear \pgfmathmultiply@{\pgfplots@i}{\pgfplots@minor@tick@dist}% \else From 6d49e0c60882e677febdaf15e0194e7950759161 Mon Sep 17 00:00:00 2001 From: schtandard Date: Thu, 30 May 2024 23:55:25 +0200 Subject: [PATCH 3/3] Fix whitespace inconsistencies --- tex/generic/pgfplots/pgfplotsticks.code.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tex/generic/pgfplots/pgfplotsticks.code.tex b/tex/generic/pgfplots/pgfplotsticks.code.tex index 73fd090c4..6956e9ed4 100644 --- a/tex/generic/pgfplots/pgfplotsticks.code.tex +++ b/tex/generic/pgfplots/pgfplotsticks.code.tex @@ -2311,9 +2311,9 @@ % \if0\pgfplots@tick@returnval@ready \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\H}}% - % No minor ticks will be drawn past the last tick, so we - % need to add one H to make sure it is past the axis limit. - % Add an extra H / 2 to avoid rounding inaccuracies. + % No minor ticks will be drawn past the last tick, so we + % need to add one H to make sure it is past the axis limit. + % Add an extra H / 2 to avoid rounding inaccuracies. \advance\MAX by1.5\H \xdef\pgfplots@glob@TMPa{\pgf@sys@tonumber{\MIN},\pgf@sys@tonumber{\MINH},...,\pgf@sys@tonumber{\MAX}}% \fi