summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex137
1 files changed, 28 insertions, 109 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
index 24292d1354c..2e6f13df3e0 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
@@ -71,6 +71,7 @@
\let\pgfplots@prepare@axis@API=\pgfplots@prepare@axis@API@polar
\def\axisdefaultheight{\axisdefaultwidth}%
\let\pgfplots@initsizes=\pgfplots@initsizes@polar
+ \let\pgfplots@BB@for@plotbox@get@unit@scales@for@limits=\pgfplots@BB@for@plotbox@get@unit@scales@for@limits@polar
\let\pgfplots@limits@ready=\pgfplots@limits@ready@polar
\let\pgfplots@assign@default@tick@foraxis@normalizetickdist=\pgfplots@assign@default@tick@foraxis@normalizetickdist@polar
\let\pgfplots@show@ticklabel@=\pgfplots@show@ticklabel@@polar
@@ -476,6 +477,8 @@
\fi
}%
+\let\pgfplots@initsizes@original=\pgfplots@initsizes
+
\def\pgfplots@initsizes@polar{%
% I copy-pasted most of this code, up to just one position where
% I introduced the modified scaling for polar axes
@@ -493,119 +496,35 @@
\def\b@pgfplots@polar@limit@around@zero{1}%
\fi
%
- \pgfplots@xmin@reg=\pgfplots@xmin pt %
- \pgfplots@xmax@reg=\pgfplots@xmax pt %
- %
- %
- \pgfplots@ymin@reg=\pgfplots@ymin pt %
- \pgfplots@ymax@reg=\pgfplots@ymax pt %
- \ifpgfplots@threedim
- \pgfplots@zmin@reg=\pgfplots@zmin pt %
- \pgfplots@zmax@reg=\pgfplots@zmax pt %
- \fi
- %
- %
- %-----------------------------------------
- % PROCESS THE 'width' and 'height' options
- %-----------------------------------------
- %
- %
- \pgfkeysgetvalue{/pgfplots/view/az}{\pgfplots@view@az}%
- \pgfkeysgetvalue{/pgfplots/view/el}{\pgfplots@view@el}%
- \ifpgfplots@threedim
- \def\pgfplots@tmpZscale{1pt}%
- \else
- \def\pgfplots@tmpZscale{0pt}%
- \let\pgfplots@view@el=\pgfutil@empty
- \let\pgfplots@view@az=\pgfutil@empty
- \fi
- \ifx\pgfplots@view@az\pgfutil@empty
- %\let\pgfplots@rectangle@width=\pgfutil@empty
- %\let\pgfplots@rectangle@height=\pgfutil@empty
- \def\pgfplots@view@dir@threedim@x{0}%
- \def\pgfplots@view@dir@threedim@y{0}%
- \def\pgfplots@view@dir@threedim@z{1}%
- %
- % FIXME HERE COMES THE polar MODIFICATION
- %--------------------------------------------------
- % \pgfpointdiff
- % {\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}
- % {\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymax}}%
- %--------------------------------------------------
- % instead of scaling from (min) (max), we only need the UPPER
- % bound -- in both, x and y directions (since we have a cycle.
- % Furthermore, we need it twice since we are interested in the
- % diameter, not the radius.
- \global\pgf@x=\pgfplots@ymax pt % radius
- \global\multiply\pgf@x by2 % diameter
- \global\pgf@y=\pgf@x % same for y
- %
- % only used temporarily in this macro to compute the correct
- % length for unit vectors:
- \edef\pgfplots@initsizes@axisdiag@x{\the\pgf@x}%
- \edef\pgfplots@initsizes@axisdiag@y{\the\pgf@y}%
- %
- \ifx\pgfplots@x\pgfutil@empty
- \ifx\pgfplots@width\pgfutil@empty
- \pgfplots@error{INTERNAL LOGIC ERROR! WIDTH NOT SET}%
- \fi
- \pgfplots@initsizes@getXscale\pgfplots@initsizes@axisdiag@x\into\pgfplots@tmpXscale
- %\ifpgfplots@scale@only@axis
- % \let\pgfplots@rectangle@width=\pgfplots@width
- %\fi
- \else
- \def\pgfplots@tmpXscale{1}%
- \fi
- %
- \ifx\pgfplots@y\pgfutil@empty
- \ifx\pgfplots@height\pgfutil@empty
- \pgfplots@error{INTERNAL LOGIC ERROR! HEIGHT NOT SET}%
- \fi
- \pgfplots@initsizes@getYscale\pgfplots@initsizes@axisdiag@y\into\pgfplots@tmpYscale
- %\ifpgfplots@scale@only@axis
- % \let\pgfplots@rectangle@height=\pgfplots@height
- %\fi
- \else
- \def\pgfplots@tmpYscale{1}%
- \fi
+ \pgfplots@initsizes@original
+}%
+
+\def\pgfplots@BB@for@plotbox@get@unit@scales@for@limits@polar#1#2#3{%
+ % #1 is the angle ... and that does not need to be squeezed into
+ % the box.
+ %
+ % use only y (the radius).
+ \if1\b@pgfplots@plotbox@yisunit
+ % we do not need to compute max-min as for standard axes (because the inner part
+ % characterized by ymin does not enter the scaling).
%
- \edef\pgfplots@tmpXscale{\pgfplots@tmpXscale pt}%
- \edef\pgfplots@tmpYscale{\pgfplots@tmpYscale pt}%
+ % However, we have to keep in mind that our range is TWICE as
+ % large because [0,ymax] is just a radius, and we have to
+ % scale for the diameter.
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{2}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
%
- \pgfplots@initsizes@setunitvector{x}{0}{\pgfplots@tmpXscale}{\pgfplots@tmp@xisaxisparallel}%
- \pgfplots@initsizes@setunitvector{y}{1}{\pgfplots@tmpYscale}{\pgfplots@tmp@yisaxisparallel}%
- \pgfplots@initsizes@setunitvector{z}{2}{\pgfplots@tmpZscale}{\pgfplots@loc@TMPc}%
- \else
- % 3D case is currently always initialised by `view':
- \let\pgfplots@x=\pgfutil@empty
- \let\pgfplots@y=\pgfutil@empty
- \let\pgfplots@z=\pgfutil@empty
- \pgfplotssetaxesfromazel{\pgfplots@view@az}{\pgfplots@view@el}{\pgfplots@tmp@xisaxisparallel}%
- \if1\pgfplots@tmp@xisaxisparallel%
- \def\pgfplots@tmp@yisaxisparallel{1}%
- \fi
- \fi
-%\message{Pgfplots debug: initialised unit vectors to x=(\the\pgf@xx,\the\pgf@xy), y=(\the\pgf@yx,\the\pgf@yy), z=(\the\pgf@zx,\the\pgf@zy). }%
- %
- \let\pgfplotsmathfloatviewdepthxyz@=\pgfplotsmathfloatviewdepthxyz@infigure
- \let\pgfplotsmathviewdepthxyz@=\pgfplotsmathviewdepthxyz@infigure
- %
- \pgfplotsmath@ifzero{\pgfplots@x@veclength}{\pgfplots@hide@xtrue\pgfplots@shownothingof@xtrue}{}%
- \pgfplotsmath@ifzero{\pgfplots@y@veclength}{\pgfplots@hide@ytrue\pgfplots@shownothingof@ytrue}{}%
- \ifpgfplots@threedim
- \pgfplotsmath@ifzero{\pgfplots@z@veclength}{\pgfplots@hide@ztrue\pgfplots@shownothingof@ztrue}{}%
+ \let\pgfmathresult=\pgfplots@ymax
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{\pgfmathresult}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{op}{multiply}{{\pgfmathresult}{\pgfplots@loc@TMPa}}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{tofixed}{\pgfmathresult}%
\else
- \if1\pgfplots@tmp@xisaxisparallel%
- \if1\pgfplots@tmp@yisaxisparallel%
- % Optimize for axis-parallel case!
- % puh. Did not make any measureable difference!? Ok...
- \let\pgfplotsqpointxy=\pgfplotsqpointxy@orthogonal
- \fi
- \fi
+ \def\pgfmathresult{2}% not 1: the factor 2 is for 2*radius
\fi
- %
- % FIXME : unit vector ratio / axis equal
-}
+ \let#1=\pgfmathresult
+ \let#2=\pgfmathresult
+ \def#3{1}% FIXME : z ?
+}%
\def\pgfplots@handle@invalid@range@defaultlimits@polar{%
\def\pgfplots@loc@TMPa{0}%