summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-30 00:13:50 +0000
committerKarl Berry <karl@freefriends.org>2012-08-30 00:13:50 +0000
commit8231318d57cff4a8f9fcd70d387a3f00f4513428 (patch)
treee99336aabe9de04bad055bcf07814a1a00474a38
parentc16497900d7216f5269a43b9c18ae469820d3cd2 (diff)
pgfplots 1.6.1 (29aug12)
git-svn-id: svn://tug.org/texlive/trunk@27550 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample.pdfbin54789 -> 54782 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pgfplots/README19
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/ChangeLog138
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/Makefile9
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/README167
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdfbin336792 -> 341542 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.pdfbin11648 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.tex7
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.pdfbin26619 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.tex144
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.pdfbin36542 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.pdfbin19353 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.tex23
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.pdfbin19353 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.tex23
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.pdfbin30296 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.tex25
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.pdfbin19353 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.tex23
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.pdfbin36541 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/cartesian_phase_diagram.pdfbin5931 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/figures/pgfplots-surface-cutoff.pngbin0 -> 105068 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/gallery/Makefile7
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/gallery/extractexamples.pl18
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/gibbs_phase_diagram.pdfbin7716 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.basic.reference.tex37
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.figlist6
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.patchplots.tex36
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.smithchart.tex112
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.makefile19
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdfbin6332178 -> 6506090 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.preamble.tex4
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex131
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.3dplots.tex214
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axis-addplot.tex295
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex168
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.coordfiltering.tex4
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.layers.tex215
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.linefitting.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.markers-meta.tex27
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.miscellaneous.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.numberformatting.tex6
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.preliminaryoptions.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.scaling.tex398
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex4
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.symbolic-transformations.tex22
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.technicalinternals.tex66
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex4
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.resources.tex20
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplots.tex44
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdfbin36006 -> 34530 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdfbin639677 -> 649259 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex67
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdfbin440215 -> 396500 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.tex362
-rw-r--r--Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample.pdfbin35816 -> 34353 bytes
-rw-r--r--Master/texmf-dist/scripts/lua/pgfplots/pgfplots.lua30
-rw-r--r--Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.tar.bz2bin807536 -> 807328 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2bin349298 -> 633037 bytes
-rw-r--r--Master/texmf-dist/tex/context/third/pgfplots/t-pgfplots.tex9
-rw-r--r--Master/texmf-dist/tex/context/third/pgfplots/t-pgfplotstable.tex15
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.surfshading.code.tex23
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex3
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex137
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.smithchart.code.tex165
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.ternary.code.tex32
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex9
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex50
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorelayers.code.tex212
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorescopes.code.tex603
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex17
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex3
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex41
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex136
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex2555
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex3332
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex1197
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex340
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex205
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex85
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def47
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/sys/pgfplotssysgeneric.code.tex56
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.code.tex368
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.data.code.tex291
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex423
-rw-r--r--Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex8
-rw-r--r--Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty4
-rw-r--r--Master/texmf-dist/tex/latex/pgfplots/pgfplotstable.sty2
121 files changed, 9649 insertions, 3997 deletions
diff --git a/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample.pdf b/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample.pdf
index 7dcbbee7b15..016374eeb6c 100644
--- a/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample.pdf
+++ b/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pgfplots/README b/Master/texmf-dist/doc/generic/pgfplots/README
index 84b0ac72773..dc10b5637af 100644
--- a/Master/texmf-dist/doc/generic/pgfplots/README
+++ b/Master/texmf-dist/doc/generic/pgfplots/README
@@ -46,6 +46,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
HISTORY:
+1.6.1:
+- fixed incompatibility lualatex,shader=interp, and german package (introduced in 1.6)
+
+1.6:
+- added support for layered graphics (main use case: multiple axes and layers)
+- added support for second colormap in mesh plots (mesh/interior colormap name)
+- added support for scopes inside of axes
+- contour plots: added ability to provide list of discrete labels (mesh/levels)
+- empty lines are interpreted as interruptions in data plots (was undocumented since 1.4)
+- added more scaling options to 'scale mode=scale uniformly' (affects axis equal in 3d
+ and \addplot3 graphics)
+- fixed wrong implementation of 'axis equal' and 'unit vector ratio' in 3d
+ (backwards compatible for 2d, but not for 3d - the 3d implementation was plain wrong)
+- fixed incompatibility of lualatex and shader=interp
+- fixed bugs/added features around \addplot3 graphics
+- fixed bug: colorbar did not support ymode=log
+- fixed a couple of minor bugs
+- fixed bounding box computation for clip=false,axis lines=none
+
1.5.1:
- more operations for FPU library (==, !=,<=,>=,?)
- fixed bug in usage of decorations in \addplot
diff --git a/Master/texmf-dist/doc/latex/pgfplots/ChangeLog b/Master/texmf-dist/doc/latex/pgfplots/ChangeLog
index 89b6d6e0e7b..66b35538d12 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/ChangeLog
+++ b/Master/texmf-dist/doc/latex/pgfplots/ChangeLog
@@ -1,3 +1,141 @@
+2012-08-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - RELEASED 1.6.1
+
+2012-08-23 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed incompatibility lualatex, shader=interp, and german package
+
+2012-08-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - RELEASED 1.6 on sourceforge (only)
+
+2012-08-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed support for scopes inside of axes
+
+2012-07-15 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed (re)scaling of view normal
+
+2012-07-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: 'nan' values in error bar values caused compilation errors.
+ Now, error bars for unbounded coordinates are skipped.
+
+2012-06-24 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - spent a considerably amount of attention to 'axis equal' in 3d:
+ it works correctly now and the underlying scaling algorithm is much more powerful.
+ This is backwards compatible with 2d axis equal (but not 3d as this was
+ plain wrong)
+
+2012-06-16 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - provided a suitable legend for quiver plots
+
+2012-06-10 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added docs for tikz/mark phase
+
+2012-06-09 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: restrict y to domain did not work for log axes
+
+2012-05-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: extreme differences between point meta and point meta min/max
+ caused number range problems. The point meta data is now clipped to [0,1000]
+
+2012-05-06 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: create on use for error bar columns did not work
+ - fixed bug: view dir was rescaled incorrectly
+ this is a regression; it was not in 1.5.1
+ - added feature 'hist/density' (thanks to Juernjakob Dugge for this contribution!)
+
+2012-05-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed 'scale mode=scale uniformly': intermediate results needed to be computed by FPU
+ - fixed bug: 'colorbar style={ymode=log}' was not processed properly
+
+2012-04-27 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - 'scale mode=scale uniformly' now also respects user-provided data
+ limits (including \addplot3 graphics).
+ - fixed bug: reversed axes + explicitly provided x,y,z vectors did not
+ work properly in 3d (also affected \addplot3 graphics)
+
+--- the following lines are from a feature branch.
+2011-10-02 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - the 'clip=plots individually' has been renamed to 'clip mode=global|individual'
+ and 'clip mode=global' is the new default. It is, however, not
+ completely implemented for custom drawing commands
+
+2011-10-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug in recent version: the 'cell picture' was always active
+ - added support for 'set layers' inside of a pgfplots axis
+ - 'axis on top', together with 'activate layers', will now implicitly call 'set layers=axis on top'
+
+2011-09-18 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - rewrote layer support to be more compatible with pgf and added
+ systematic support for layers, including a useful default configuration
+
+2011-09-14 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added feature 'cell picture=true|false|if necessary'
+
+2011-09-04 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added feature 'clip=plots individually'
+
+2012-04-21 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: explicitly provided unit vectors + '* dir=reverse' did not work
+ - improved smith charts docs + provided more styles
+
+2012-04-04 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: lualatex and shader=interp have been incompatible.
+ I implemented proper binary encoding in lua.
+
+2012-04-02 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: 'linear regression/variance' key did only work if 'linear
+ regression/variance src' was active as well. Now, it works also without.
+
+2012-04-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added 'contour/levels' key.
+
+2012-03-04 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - table package: improved and documented ways to suppress head rows
+
+2012-02-04 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: compatibility to PGF 2.00 was broken
+
+2012-01-22 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: fixed combination of transparency + shading in shader=interp
+
+2012-01-01 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added support for 'mesh/interior colormap name,shader=interp'
+ it uses shader=faceted interp
+
+2011-10-03 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug in 'mesh/interior colormap name': the data scaling trafo
+ was not respected correctly
+ - fixed bug in 'mesh/interior colormap name': z buffer reversals have not
+ been respected.
+
+2011-10-02 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - added 'mesh/interior colormap thresh'
+
+2011-09-28 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - renamed 'mesh/background colormap name' to 'mesh/interior colormap name'
+
+2011-09-28 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: there was a case were 'shader=faceted interp' was
+ unnecessarily converted to triangles
+
+2011-09-27 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: the view direction was not scaled properly.
+
+2011-09-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - worked on 'mesh/background colormap name'. It works partially for
+ 'disabledatascaling', although it reveals that the view direction is
+ imprecise.
+
+2011-09-26 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - fixed bug: 'patch to triangle' for rectangles produced inconsistently
+ oriented triangles
+
+2011-09-25 Christian Feuersaenger <ludewich@users.sourceforge.net>
+ - implemented draft for 'mesh/background colormap name'.
+ I think it works, but it might be useless because the sampling methods do
+ not produce proper normal vectors.
+
+--- the following lines are from a feature branch.
+
2011-12-29 Christian Feuersaenger <ludewich@users.sourceforge.net>
- RELEASED VERSION 1.5.1
diff --git a/Master/texmf-dist/doc/latex/pgfplots/Makefile b/Master/texmf-dist/doc/latex/pgfplots/Makefile
index 23e3e471e83..4f61e6ecb76 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/Makefile
+++ b/Master/texmf-dist/doc/latex/pgfplots/Makefile
@@ -9,11 +9,16 @@ todo: pgfplotstodo.pdf
pgfplots: pgfplots.pdf
pgfplotstable: pgfplotstable.pdf
+# was:
+# export TEXMFCNF=.:
+# but it seems as if that is ignored for some reason
+TEXMFCNF_FOR_MEMLIMITS=export TEXMFCNF=~/texmf/mytexcnf:
+
include pgfplots.makefile
%.pdf: FORCE
mkdir -p gnuplot
- @export TEXMFCNF=.: && $(PDFLATEX) $(@:.pdf=.tex)
+ @$(TEXMFCNF_FOR_MEMLIMITS) && $(PDFLATEX) $(@:.pdf=.tex)
@bibtex $(@:.pdf=) || exit 0
@makeindex $(@:.pdf=) || exit 0
@echo ""
@@ -22,7 +27,7 @@ include pgfplots.makefile
pgfplots.pdf: $(ALL_FIGURES)
pgfplots.makefile:
- @export TEXMFCNF=.: && $(PDFLATEX) pgfplots
+ @$(TEXMFCNF_FOR_MEMLIMITS) && $(PDFLATEX) pgfplots
clean:
rm -f *.aux *.ind *.idx *.toc *.out *.log *.ilg *.dvi pgfplots.makefile pgfplots.pdf pgfplotstable.pdf *.djs *.bbl *.blg figures/expensiveexample*
diff --git a/Master/texmf-dist/doc/latex/pgfplots/README b/Master/texmf-dist/doc/latex/pgfplots/README
new file mode 100644
index 00000000000..dc10b5637af
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgfplots/README
@@ -0,0 +1,167 @@
+pgfplots - Create normal/logarithmic plots in two and three dimensions for LaTeX/TeX/ConTeXt.
+
+pgfplotstable - Loads, rounds, formats and postprocesses numerical tables.
+
+PGFPlots draws high--quality function plots in normal or logarithmic scaling
+with a user-friendly interface directly in TeX. The user supplies axis labels,
+legend entries and the plot coordinates for one or more plots and PGFPlots
+applies axis scaling, computes any logarithms and axis ticks and draws the
+plots. It supports line plots, scatter plots, piecewise constant plots, bar
+plots, area plots, mesh-- and surface plots, patch plots, contour plots, quiver
+plots, histogram plots, polar axes, ternary diagrams, smith charts and some
+more.
+
+Pgfplots is based on Till Tantau's package PGF/TikZ (pgf).
+
+Pgfplotstable displays numerical tables rounded to desired precision in various
+display formats, for example scientific format, fixed point format or integer,
+using TeX's math facilities for pretty printing. Furthermore, it provides
+methods for table postprocessing.
+
+Please take a look at
+ doc/latex/pgfplots/pgfplots.pdf
+and
+ doc/latex/pgfplots/pgfplotstable.pdf.
+
+
+REMARK
+The virus killer Avira Antivir reports the virus HTML/Malicious PDF.Gen in pgfplots.pdf.
+This is a FALSE ALARM caused by the pgfplots library for interactive,
+clickable plots (based on javascript). It is virus-free.
+
+Copyright 2007-2011 by Christian Feuersaenger.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+HISTORY:
+1.6.1:
+- fixed incompatibility lualatex,shader=interp, and german package (introduced in 1.6)
+
+1.6:
+- added support for layered graphics (main use case: multiple axes and layers)
+- added support for second colormap in mesh plots (mesh/interior colormap name)
+- added support for scopes inside of axes
+- contour plots: added ability to provide list of discrete labels (mesh/levels)
+- empty lines are interpreted as interruptions in data plots (was undocumented since 1.4)
+- added more scaling options to 'scale mode=scale uniformly' (affects axis equal in 3d
+ and \addplot3 graphics)
+- fixed wrong implementation of 'axis equal' and 'unit vector ratio' in 3d
+ (backwards compatible for 2d, but not for 3d - the 3d implementation was plain wrong)
+- fixed incompatibility of lualatex and shader=interp
+- fixed bugs/added features around \addplot3 graphics
+- fixed bug: colorbar did not support ymode=log
+- fixed a couple of minor bugs
+- fixed bounding box computation for clip=false,axis lines=none
+
+1.5.1:
+- more operations for FPU library (==, !=,<=,>=,?)
+- fixed bug in usage of decorations in \addplot
+- bugfix for contour prepared format=matlab
+- added 'const plot mark mid' and 'jump mark mid' plot handlers
+- nodes on a plot (\addplot ... node[pos=<fraction>] {};)
+- 'trim axis group left' and 'trim axis group right'
+- bugfixes for polar axes and log+stacked plots
+- added style 'log ticks with fixed point'
+- introduced patched tikz paths to simplify circles and ellipses within an axis
+- patchplots lib: patch type=polygon
+- some more bugfixes
+
+1.5:
+ - Contour plots,
+ - Histograms,
+ - Quiver plots,
+ - patch plots (library)
+ - Triangle Meshes
+ - Bilinear Elements
+ - Quadratic Triangles
+ - Biquadratic Quadrilaterals
+ - Coons Patches
+ - Discrete colorbars,
+ - Table sorting,
+ - Linear regression,
+ - Ternary diagrams,
+ - Tieline Plots
+ - Smith Charts
+ - Polar axes,
+ - Empty lines in input files result in interrupted plots,
+ - PDF user defined coordinate mouse popups
+ - CMYK colormaps and shadings,
+ - new markers and cycle lists
+ - access to axis limits,
+ - \addplot3 graphics: pgfplots draws an appropriate axis for a three-dimensional(!) external png graphics
+ - 3D axes: support to provide explicit unit vectors:
+ - explicit unit vectors
+ - explicit unit vectors which are uniformly rescaled to match width/height
+ - 3D axes: improved support for unit vector ratios
+ - improvements of the groupplot styles
+ - preliminary support for (2d) bar plots in 3d axes
+ - new shader 'faceted interp'
+ - table package:
+ - 'every nth row' style
+ - 'comment chars' key to define comment characters in input files
+ - 'skip first n' style
+ - lots of smaller bugfixes (see ChangeLog for details)
+
+
+1.4.1:
+- improved compatibility to gnuplot 4.4
+
+1.4:
+Version 1.4 contains several new features, mostly work on details.
+It fixes many bugs and provides the following improvements:
+- detached legends
+- detached colorbars
+- ybar (and similar plots) can now be mixed with other plot types
+ like line plots.
+- improved legend formatting
+- added 'restrict x to domain*' which cups coordinates outside of a specified domain (same for y and z)
+- Added support for linear regression
+- Inline tables,
+- Lots of bug fixes
+
+The next version will make a greater step when it is stable.
+
+
+1.3.1:
+Version 1.3.1 is a bugfix release containing
+- improved parametric plots with gnuplot
+- improved normalsize, small and footnotesize scale styles and added tiny
+- a lot of bugfixes
+
+1.3:
+- improvements for two dimensional visualization, among them
+ - axis equal,
+ - color bars,
+ - nodes near coords,
+ - jumps in plots,
+ - improved description positioning,
+ - reverseable axis directions,
+ - simpler alignment of adjacent axes,
+ - units and a simplified user interface,
+- new three dimensional line, scatter, mesh and surface plots,
+- a copy of the automatic pdf externalization library,
+- an improved manual enhanced with a lot of pdf cross references.
+
+1.2.2:
+- fixed a problem with the samples key,
+- provides some smaller fixes and some manual improvements.
+- added plot graphics.
+
+1.2:
+- completely rewritten math expression parser with extended data range,
+- colormaps for scatter plots
+- fine tuning for plot parameters.
+- table package has been extended and is now a fully featured table typesetting, computing and postprocessing tool.
+
diff --git a/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf b/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf
index bfa8b972ca6..29e9654abe4 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf
+++ b/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.pdf
deleted file mode 100644
index acd73c30dbc..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.tex
deleted file mode 100644
index 7465efba4b0..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_0.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-
-\documentclass{article}
-
-\begin{document}
-Hallo Welt
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.pdf
deleted file mode 100644
index 3f75f3f8085..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.tex
deleted file mode 100644
index 15b4e0d7dfa..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_1.tex
+++ /dev/null
@@ -1,144 +0,0 @@
-
-\documentclass[a4paper]{report}
-\usepackage{pgfplots}
-
-\pgfplotsset{compat=1.3}
-\begin{document}
-\begin{tikzpicture}
- \begin{axis}[
- xbar,
- width=12cm,
- height=3.5cm,
- enlarge y limits=0.5,
- xlabel={\#participants},
- xmin=0,
- symbolic y coords={no,yes},
- ytick=data,
- nodes near coords,
- nodes near coords align={horizontal},
- ]
- \addplot coordinates {(3,no) (7,yes)};
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- xbar,
- width=12cm,
- height=3.5cm,
- enlarge y limits=0.5,
- xlabel={\#participants},
- symbolic y coords={no,yes},
- ytick=data,
- nodes near coords,
- nodes near coords align={horizontal},
- ]
- \addplot coordinates {(1,no) (9,yes)};
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- xbar,
- width=12cm,
- height=3.5cm,
- enlarge y limits=0.5,
- xlabel={\#participants},
- xmin=0,
- symbolic y coords={set A,set B},
- ytick=data,
- nodes near coords,
- nodes near coords align={horizontal},
- ]
- \addplot coordinates {(6,set A) (4,set B)};
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- ybar,
- enlargelimits=0.15,
- xlabel={\# of bananas},
- ylabel={\#participants},
- ytick={0,1,2,3},
- ymin=0,
- symbolic x coords={1,2,3,4,5,more},
- nodes near coords,
- ]
- \addplot coordinates {(1,1) (2,1) (3,3) (4,2) (5,1) (more,2)};
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- ybar stacked,
- enlargelimits=0.15,
- legend style={at={(0.5,-0.20)},
- anchor=north,legend columns=-1},
- ylabel={\#participants},
- symbolic x coords={tool1, tool2, tool3, tool4, tool5, tool6, tool7},
- xtick=data,
- x tick label style={rotate=45,anchor=east},
- ]
- \addplot+[ybar] plot coordinates {(tool1,0) (tool2,2) (tool3,2) (tool4,3) (tool5,0) (tool6,2) (tool7,0)}; % never
- \addplot+[ybar] plot coordinates {(tool1,0) (tool2,0) (tool3,0) (tool4,3) (tool5,1) (tool6,1) (tool7,0)}; % rarely
- \addplot+[ybar] plot coordinates {(tool1,6) (tool2,6) (tool3,8) (tool4,2) (tool5,6) (tool6,5) (tool7,6)}; % sometimes
- \addplot+[ybar] plot coordinates {(tool1,4) (tool2,2) (tool3,0) (tool4,2) (tool5,3) (tool6,2) (tool7,4)}; % often
- \legend{never, rarely, sometimes, often}
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- ybar,
- enlargelimits=0.15,
- legend style={at={(0.5,-0.15)},
- anchor=north,legend columns=-1},
- ylabel={\#participants},
- symbolic x coords={tool8,tool9,tool10},
- xtick=data,
- nodes near coords,
- nodes near coords align={vertical},
- ]
- \addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
- \addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
- \addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
- \legend{used,understood,not understood}
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- ybar,
- enlargelimits=0.15,
- legend style={at={(0.5,-0.2)},
- anchor=north,legend columns=-1},
- ylabel={\#participants},
- symbolic x coords={excellent,good,neutral,not good,poor},
- xtick=data,
- nodes near coords,
- nodes near coords align={vertical},
- x tick label style={rotate=45,anchor=east},
- ]
- \addplot coordinates {(excellent,0) (good,8) (neutral,2) (not good,0) (poor,0)};
- \end{axis}
-\end{tikzpicture}
-
-\begin{tikzpicture}
- \begin{axis}[
- ybar,
- enlargelimits=0.15,
- legend style={at={(0.5,-0.2)},
- anchor=north,legend columns=-1},
- ylabel={\#participants},
- symbolic x coords={excellent,good,neutral,not good,poor},
- xtick=data,
- nodes near coords,
- nodes near coords align={vertical},
- x tick label style={rotate=45,anchor=east},
- ]
- \addplot coordinates { (excellent,0) (good,7) (neutral,3) (not good,0) (poor,0)};
- \end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.pdf
deleted file mode 100644
index cd081384d29..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_10.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.pdf
deleted file mode 100644
index 15c4213f18c..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_11.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.pdf
deleted file mode 100644
index 930337e8a49..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_12.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.pdf
deleted file mode 100644
index 9c05dea1f14..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_13.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.pdf
deleted file mode 100644
index fb0b471b8df..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_2.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.pdf
deleted file mode 100644
index 55d823a5648..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.tex
deleted file mode 100644
index 664ddc7df31..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_3.tex
+++ /dev/null
@@ -1,23 +0,0 @@
-
-\documentclass[10pt]{article}
-
-\usepackage{pgfplots}
-\usepgfplotslibrary{groupplots}
-
-\begin{document}
-
-\begin{tikzpicture}%
-%\begin{axis}[%
-\begin{groupplot}[%
- group style={group size=1 by 1},%
-]%
- \nextgroupplot;
- \node[name=a] at (axis cs:0.1,-1) {N};
- \addplot coordinates{(0,1) (1,2)};
-\end{groupplot}
-%\end{axis}
-
-\draw (a) circle (5pt);
-\end{tikzpicture}%
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.pdf
deleted file mode 100644
index 63d9e554d87..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.tex
deleted file mode 100644
index 664ddc7df31..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_4.tex
+++ /dev/null
@@ -1,23 +0,0 @@
-
-\documentclass[10pt]{article}
-
-\usepackage{pgfplots}
-\usepgfplotslibrary{groupplots}
-
-\begin{document}
-
-\begin{tikzpicture}%
-%\begin{axis}[%
-\begin{groupplot}[%
- group style={group size=1 by 1},%
-]%
- \nextgroupplot;
- \node[name=a] at (axis cs:0.1,-1) {N};
- \addplot coordinates{(0,1) (1,2)};
-\end{groupplot}
-%\end{axis}
-
-\draw (a) circle (5pt);
-\end{tikzpicture}%
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.pdf
deleted file mode 100644
index 4cd0f1e8034..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_5.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.pdf
deleted file mode 100644
index 9f6faa0316b..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_6.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.pdf
deleted file mode 100644
index 950e03d078a..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.tex
deleted file mode 100644
index 1567c1d6eab..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_7.tex
+++ /dev/null
@@ -1,25 +0,0 @@
-
-\documentclass{article}
-
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[axis equal]
-% FokkerDrI_layer_0.patches.dat contains:
-% # each row is one vertex; three consecutive
-% # vertices make one triangle (patch)
-% 105.577 -19.7332 2.85249
-% 88.9233 -21.1254 13.0359
-% 89.2104 -22.1547 1.46467
-% # end of facet 0
-% 105.577 -19.7332 2.85249
-% 105.577 -17.2161 12.146
-% 88.9233 -21.1254 13.0359
-% # end of facet 1
-\addplot3[patch]
- file
- {plotdata/FokkerDrI_layer_0.patches.dat};
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.pdf
deleted file mode 100644
index f341833cb5a..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.tex
deleted file mode 100644
index 664ddc7df31..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_8.tex
+++ /dev/null
@@ -1,23 +0,0 @@
-
-\documentclass[10pt]{article}
-
-\usepackage{pgfplots}
-\usepgfplotslibrary{groupplots}
-
-\begin{document}
-
-\begin{tikzpicture}%
-%\begin{axis}[%
-\begin{groupplot}[%
- group style={group size=1 by 1},%
-]%
- \nextgroupplot;
- \node[name=a] at (axis cs:0.1,-1) {N};
- \addplot coordinates{(0,1) (1,2)};
-\end{groupplot}
-%\end{axis}
-
-\draw (a) circle (5pt);
-\end{tikzpicture}%
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.pdf b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.pdf
deleted file mode 100644
index e61a15b136a..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.tex b/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.tex
deleted file mode 100644
index 3f11c01a719..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/bugtracker/minimal_9.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-
-\documentclass{article}
-\usepackage{pgfplots}
-\begin{document}
-\begin{tikzpicture}
-\begin{axis}[
- small,
- width=12cm,
- height=1.8in,
- ymin=0,
- ymax=10,
- xmin=0,
- xmax=2,
- ybar,
- ymajorgrids=true,
- yminorgrids=false,
- minor y tick num=0,
- ytick pos=left,
- xtick pos=left,
- ytick align=center,
- yticklabel={$\pgfmathprintnumber{\tick}\%$},
- xtick align=outside,
- x tick style={},
- xticklabel style={rotate=45,anchor=east,font=\scriptsize\sffamily},
- extra y tick style={tick pos=right, ticklabel pos=right, grid
-style={thick,color=black}},
- extra y ticks={6.25},
- extra y tick labels={Extra Label},
-]
-
-%\addplot plot[error bars/.cd,y dir=plus,y explicit,x dir=none] table
-%[x=Index,y expr=100*\thisrow{AvgLocked},y error=Diff]{locked_tabbed.dat};
-
-\end{axis}
-\end{tikzpicture}
-\end{document}
-
diff --git a/Master/texmf-dist/doc/latex/pgfplots/cartesian_phase_diagram.pdf b/Master/texmf-dist/doc/latex/pgfplots/cartesian_phase_diagram.pdf
deleted file mode 100644
index 1557c37bee4..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/cartesian_phase_diagram.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/figures/pgfplots-surface-cutoff.png b/Master/texmf-dist/doc/latex/pgfplots/figures/pgfplots-surface-cutoff.png
new file mode 100644
index 00000000000..08f0ba40689
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgfplots/figures/pgfplots-surface-cutoff.png
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/gallery/Makefile b/Master/texmf-dist/doc/latex/pgfplots/gallery/Makefile
index 27896014114..ce9eb1600c5 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/gallery/Makefile
+++ b/Master/texmf-dist/doc/latex/pgfplots/gallery/Makefile
@@ -4,6 +4,7 @@
# REQUIREMENTS:
# make sure TEXINPUTS contains the doc/latex/pgfplots/ tree recursively.
+# FIXME : this leads to strange sequences... sort correctly!
DOC_SRC=$(wildcard ../pgfplots.*.tex) ../pgfplotstable.tex
# DOC_SRC:=../pgfplotstable.tex
@@ -16,11 +17,11 @@ all: prepare
$(MAKE) images
prepare: $(DOC_SRC)
- ./extractexamples.pl ./example ./index.html $(DOC_SRC)
+ ./extractexamples.pl ./example ./gallery.html $(DOC_SRC)
touch $@
clean:
- rm -f ./example* prepare index.html
+ rm -f ./example* prepare gallery.html
prepared: $(PREPARED_SRC:%.tex=%.pdf)
@@ -34,6 +35,6 @@ images: $(PREPARED_SRC:%.tex=%.png)
# %.pdf: %.tex
%.pdf:
- export TEXINPUTS="$(TEXINPUTS)..:../figures:" && pdflatex -interaction batchmode -halt-on-error -shell-escape $(@:.pdf=) 2>/dev/null 1>/dev/null
+ export TEXINPUTS="$(TEXINPUTS):..:../figures:" && lualatex -interaction batchmode -halt-on-error -shell-escape $(@:.pdf=) 2>/dev/null 1>/dev/null
pdfcrop $@ $@ 2>/dev/null 1>/dev/null
@rm $(@:.pdf=.log) $(@:.pdf=.aux)
diff --git a/Master/texmf-dist/doc/latex/pgfplots/gallery/extractexamples.pl b/Master/texmf-dist/doc/latex/pgfplots/gallery/extractexamples.pl
index 5576c9ad7fb..1033b3755d6 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/gallery/extractexamples.pl
+++ b/Master/texmf-dist/doc/latex/pgfplots/gallery/extractexamples.pl
@@ -104,6 +104,10 @@ print OUTHTML
<body>
<h2>PGFPlots Gallery</h2>
<h4>The following graphics have been generated with the LaTeX Packages <a href="http://pgfplots.sourceforge.net/pgfplots.pdf">PGFPlots</a> and <a href="http://pgfplots.sourceforge.net/pgfplotstable.pdf">PGFPlotsTable</a>.</h4>
+
+They have been extracted from the reference manuals.
+
+<a href="http://pgfplots.sourceforge.net">PGFPlots Home</a>
';
for($j = 2; $j<=$#ARGV; ++$j ) {
@@ -122,7 +126,8 @@ for($j = 2; $j<=$#ARGV; ++$j ) {
if( $ARGV[$j] =~ m/pgfplotstable.tex/ ) {
$largegraphics = 1;
- $autoheaders = '
+ $autoheaders = $autoheaders.'
+\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{colortbl}
\usepackage{booktabs}
@@ -131,6 +136,13 @@ for($j = 2; $j<=$#ARGV; ++$j ) {
';
}
+ @libName = ($ARGV[$j] =~ m/pgfplots\.libs\.(.*)\.tex/ );
+ if ($#libName >=0 ) {
+ $autoheaders = $autoheaders.'
+\usepgfplotslibrary{'.$libName[0].'}
+';
+ }
+
for( $q=0; $q<=$#matches/4; $q++ ) {
$prefix = $matches[4*$q];
$prefix = "" if not defined($prefix);
@@ -165,6 +177,10 @@ for($j = 2; $j<=$#ARGV; ++$j ) {
open(OUTFILE,">",$outfile) or die( "could not open $outfile for writing");
print OUTFILE $header;
print OUTFILE $autoheaders;
+ print OUTFILE "\\usepackage{pgfplotstable}\n" if ($match =~ /pgfplotstable/);
+ print OUTFILE "\\usepackage{hyperref}\n" if ($match =~ /\\url/);
+ print OUTFILE "\\usepackage{textcomp}\n" if ($match =~ /\\textdegree/);
+ print OUTFILE "\\usepackage{listings}\n" if ($match =~ /\\lst/);
print OUTFILE $prefix;
print OUTFILE "\n\\begin{document}\n";
print OUTFILE $match;
diff --git a/Master/texmf-dist/doc/latex/pgfplots/gibbs_phase_diagram.pdf b/Master/texmf-dist/doc/latex/pgfplots/gibbs_phase_diagram.pdf
deleted file mode 100644
index 93a35341499..00000000000
--- a/Master/texmf-dist/doc/latex/pgfplots/gibbs_phase_diagram.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex
index fbb1c10f42c..c018e43613a 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots-macros.tex
@@ -113,7 +113,7 @@
\pgfkeys{/pdflinks/codeexample links=false}%
}{}%
}%
-\pgfkeys{/pgf/images/include external/.code={\href{file:#1}{\pgfimage{#1}}}} % FIXME : NOT FOR THE FINAL VERSION
+%\pgfkeys{/pgf/images/include external/.code={\href{file:#1}{\pgfimage{#1}}}} % FIXME : NOT FOR THE FINAL VERSION
\newif\ifpgfplots@example@is@expensive
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.basic.reference.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.basic.reference.tex
index 09671754622..c88713aff41 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.basic.reference.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.basic.reference.tex
@@ -223,6 +223,10 @@ The number is printed using the current number printing options, see the manual
The example above initializes an axis and executes the basic level path commands as soon as the axis is ready. The execution of multiple |\path|, |\addplot| and |\pgfplotsextra| commands is in the same sequence as they occur in the environment\footnote{Except for stacked plots where the sequence may be reverse, see the key \texttt{reverse stack plots}.}.%
\end{command}
+\begin{command}{\pgfplotspathaxisoutline}
+ Generates a path which resembles the outline of the current axis. This path is used for clip paths and the background paths (if any).
+\end{command}
+
\subsection{Specifying Basic Coordinates}
\label{sec:basic:coordinates}
@@ -266,7 +270,8 @@ The number is printed using the current number printing options, see the manual
{\pgfplotspointaxisdirectionxy{1}{1}}
{\pgfplotspointaxisdirectionxy{0}{2}}
};
- \addplot [only marks,mark=*] coordinates { (0,0) };
+ \addplot [only marks,mark=*] coordinates
+ { (0,0) };
\end{axis}
\end{tikzpicture}
\end{codeexample}
@@ -338,7 +343,7 @@ The number is printed using the current number printing options, see the manual
A direction vector needs to be \emph{added} to some coordinate in order to get a coordinate, compare the documentation for |\pgfplotspointaxisdirectionxy| and |axis direction cs|.
- The argument \meta{x direction of an axis} is processed in (almost) the same way as for |\pgfplotstransformcoordinatex|. The only difference is that \emph{directions} need no shifting transformation.
+ The argument \meta{x direction of an axis} is processed in (almost) the same way as for the macro which operates on absolute positions, |\pgfplotstransformcoordinatex|. The only difference is that \emph{directions} need no shifting transformation.
The result of this command is also available as math method |transformdirectionx| (see the documentation for |axis direction cs|).
@@ -439,3 +444,31 @@ The number is printed using the current number printing options, see the manual
\subsection{Accessing Axis Limits}
It is also possible to access axis limits during the visualization phase, i.e.\ during |\end{axis}|. Please refer to the reference documentation for |xmin| on page~\pageref{page:access:limits}.
+
+\subsection{Layer Access}
+\begin{command}{\pgfplotsonlayer\marg{layer name}}
+ A low-level command which will check if the current axis has layer support activated and, if so, calls |\pgfonlayer|\marg{layer name}.
+
+ There must be a |\endpgfplotsonlayer| to delimit the environment.
+\end{command}
+\begin{command}{\endpgfplotsonlayer}
+ The end of |\pgfplotsonlayer|.
+\end{command}
+
+\begin{command}{\pgfonlayer\marg{layer name}}
+ A low-level command of \PGF\ which will collect everything until the matching |\endpgfonlayer| into layer \meta{layer name}.
+
+ The \meta{layer name} must be active, i.e.\ it must be part of the layer names of |set layers|.
+
+ The only special case is if you call |\pgfdeclarelayer{discard}| somewhere: this special layer has a ``magical name'' which serves as |/dev/null| if it is enabled using |\pgfonlayer{discard}|: it does not need to be active and everything assigned to this layer will be thrown away if it is not part of the layer name configuration.
+
+ There must be a |\endpgfonlayer| to delimit the environment.
+\end{command}
+\begin{command}{\endpgfonlayer}
+ The end of |\pgfonlayer|.
+\end{command}
+
+
+\begin{command}{\pgfsetlayers\marg{layer list}}
+ This is a low-level command of \PGF. At the time of this writing, it is the only way to tell \PGF\ which layers it shall use for the current / next picture. It is used implicitly by |set layers|.
+\end{command}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.figlist b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.figlist
index a03fe00ac86..72fe5bfd092 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.figlist
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.figlist
@@ -31,10 +31,15 @@ figures/expensiveexamplereference_threedim_21
figures/expensiveexamplereference_threedim_22
figures/expensiveexamplereference_threedim_23
figures/expensiveexamplereference_threedim_24
+figures/expensiveexamplereference_threedim_interior_colormap_0
+figures/expensiveexamplereference_threedim_interior_colormap_1
+figures/expensiveexamplereference_threedim_interior_colormap_2
+figures/expensiveexamplereference_threedim_interior_colormap_3
figures/expensiveexamplereference_threedim_contour_0
figures/expensiveexamplereference_threedim_contour_1
figures/expensiveexamplereference_threedim_contour_2
figures/expensiveexamplereference_threedim_contour_3
+figures/expensiveexamplereference_threedim_contour_4
figures/expensiveexamplereference_threedim_25
figures/expensiveexamplereference_threedim_26
figures/expensiveexamplereference_threedim_27
@@ -61,6 +66,7 @@ figures/expensiveexamplereference_nodes_0
figures/expensiveexamplereference_nodes_1
figures/expensiveexamplereference_nodes_2
figures/expensiveexamplereference_nodes_3
+figures/expensiveexamplepatchplot_0
figures/expensiveexamplepolar_0
figures/expensiveexamplememspeed_0
figures/expensiveexamplememspeed_1
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
index aa84de1bdbd..173ee7656d4 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.intro.tex
@@ -52,7 +52,7 @@ Each environment is available for \LaTeX, Con{\TeX}t and plain \TeX:
% for dvipdfm:
%\def\pgfsysdriver{pgfsys-dvipdfm.def}
\usepackage{pgfplots}
-\pgfplotsset{compat=1.3}% <-- moves axis labels near ticklabels (respects tick label widths)
+\pgfplotsset{compat=1.6}% <-- moves axis labels near ticklabels (respects tick label widths)
\begin{document}
\begin{figure}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.patchplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.patchplots.tex
index c78c71af974..cf23448973a 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.patchplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.patchplots.tex
@@ -1,4 +1,6 @@
\subsection{Patchplots Library}
+{
+\tikzset{external/figure name/.add={}{patchplot_}}%
\label{sec:lib:patchplots}
\begin{pgfplotslibrary}{patchplots}
A library for advanced |patch| plots. It has been designed to visualize shaded isoparametric finite element meshes of higher order. Its core is an interface to the generation of smoothly shaped elements with interpolated color values (based on \texttt{.pdf} Shading Type 6 and \texttt{.pdf} Shading Type 7), with additional (limited) support for constant color filling without shadings.
@@ -176,6 +178,33 @@ coordinates {
\end{codeexample}
\noindent Similar to |triangle quadr|, the edges have the correct quadratic shape -- but the color interpolation is just \emph{bilinear}; using the color values of the corners and ignoring the rest. Again, consider using |patch refines| to improve the color interpolation.
+ Note that a function of $(x,y)$ is biquadratic if it is quadratic w.r.t.~$x$ if $y=\text{const}$ and also quadratic w.r.t.~$y$ if $x=\text{const}$. For example, $f(x,y) = x^2-y^2$ is biquadratic. Consequently, we can represent a surface plot of $f$ with just one biquadratic patch -- only the color interpolation is just bilinear. We do so using |\addplot table[z expr=|\meta{expression}|]|:
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}
+ \addplot3[patch,patch refines=3,
+ shader=faceted interp,
+ patch type=biquadratic]
+ table[z expr=x^2-y^2]
+ {
+ x y
+ -2 -2
+ 2 -2
+ 2 2
+ -2 2
+ 0 -2
+ 2 0
+ 0 2
+ -2 0
+ 0 0
+ };
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent We see that the shape's boundary is reconstructed exactly using the |biquadratic| patch. In addition, |patch refines| improves the (first order) color interpolation. Details for |patch refines| are discussed in Section~\ref{sec:lib:patchplots:refinement} abd details and limitations regarding superimposed grid lines are discussed in Section~\ref{sec:lib:patchplots:grids}.
+
+
The choice \declareandlabel{coons} expects a sequence of one or more Coons patches, made up of $n=12$ points each. A Coons patch is delimited by four cubic B\'ezier curves, with the end points attached to each other -- and the $n$ points provide the required control points for these curves in a specific ordering which is illustrated in the following example:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -263,6 +292,7 @@ table[row sep=\\] {
\subsubsection{Automatic Patch Refinement and Triangulation}
+\label{sec:lib:patchplots:refinement}
\PGFPlots\ supports automatic patch refinement for most of its |patch type|s. There are mainly two purposes for patch refinement: to increase the quality of |z buffer=sort| and/or to improve color interpolation for high--order patches.
\begin{pgfplotskey}{patch refines=\marg{levels} (initially 0)}
@@ -350,6 +380,7 @@ The following example illustrates the effect: the coarse single element on the l
\end{codeexample}
\subsubsection{Drawing Grids}
+\label{sec:lib:patchplots:grids}
The |patchplots| library supports grid (|mesh|) visualization in the same way as for two/three--dimensional |mesh|- and |surf| plots. This includes four different approaches: the first is |shader=faceted|, which uses constant fill color and |faceted color| for stroke paths (as we already saw in Section~\ref{sec:lib:patchplots:flat}). The second approach is to use |shader=faceted interp| which uses interpolated shadings for filling and issues stroke paths on top of each interpolated element. The third approach is to issue two |\addplot| commands, one with the filled |patch| plot, and one with a |patch,mesh| style which only draws (colored) grid lines on top of the previous plot. The three approaches are shown below.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -428,7 +459,7 @@ coordinates {
\end{axis}
\end{tikzpicture}
\end{codeexample}
-\noindent The approach to draw grids separately is realized by means of two |\addplot| statements; the first using |patch| as before, the second using |patch,mesh|. This configures \PGFPlots\ to visualize just the mesh. Make sure you provide `|mesh|' after `|patch|' since the latter activates filled |surf| visualization. The approach of meshes on top of patches implies to draw grid lines simply over any previous drawing operations. Thus, depth information is lost (as displayed in the first example above). Overlaying grid lines on top of the surface works in special cases (see bottom picture). An approach which always works is to provide the mesh at a fixed $z$ position as displayed in the following example:
+\noindent The approach to draw grids separately is done by means of two |\addplot| statements; the first using |patch| as before, the second using |patch,mesh|. This configures \PGFPlots\ to visualize just the mesh. Make sure you provide `|mesh|' after `|patch|' since the latter activates filled |surf| visualization. The approach of meshes on top of patches implies to draw grid lines simply over any previous drawing operations. Thus, depth information is lost (as displayed in the first example above). Overlaying grid lines on top of the surface works in special cases (see bottom picture). An approach which always works is to provide the mesh at a fixed $z$ position as displayed in the following example:
%
\begin{codeexample}[]
\begin{tikzpicture}
@@ -456,6 +487,7 @@ coordinates {
\end{codeexample}
\noindent Here, the first |\addplot3| command is the same as above, just with |shader=interp|. The second reproduces the same geometry, but uses a |z filter| to fix the $z$ coordinate (in this case to $z=1.8$). This effectively overrules all $z$ coordinates.
- Thus, grid lines can be realized either by means of flat fill color with |shader=faceted| (efficient), by means of interpolated fill colors with |shader=faceted interp| (inefficient, see above) or, for special applications, using a separate |patch,mesh| plot which is drawn on top of the patches (efficient). In any case, the mesh visualization considers the |faceted color| which can depend on |mapped color|.
+ Thus, grid lines can be drawn either by means of flat fill color with |shader=faceted| (efficient), by means of interpolated fill colors with |shader=faceted interp| (inefficient, see above) or, for special applications, using a separate |patch,mesh| plot which is drawn on top of the patches (efficient). In any case, the mesh visualization considers the |faceted color| which can depend on |mapped color|.
\end{pgfplotslibrary}
+}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.smithchart.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.smithchart.tex
index 40e536b8e0b..7e5a6e61a8e 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.smithchart.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.libs.smithchart.tex
@@ -25,13 +25,68 @@
The |\begin{smithchart}| environment draws Smith Charts. It accepts the same \meta{options} as |\begin{axis}|. In fact, it is equivalent to |\begin{axis}[|\meta{options}|,axis type=smithchart]|.
\begin{codeexample}[]
\begin{tikzpicture}
- \begin{smithchart}[title=Default Smith Chart]
+ \begin{smithchart}[title=Impedance Smith Chart]
\addplot coordinates {(0.5,0.2) (1,0.8) (2,2)};
\end{smithchart}
\end{tikzpicture}
\end{codeexample}
The example above visualizes three data points using the initial configuration of Smith Charts; the data points are interpreted as complex numbers $z = x + j y$ and are mapped using $r(z)$.
+ Here, the $x$ coordinate refers to the cycles described by the horizontal line whereas the $y$ coordinate refers to the cycles described by the tick labels on the outside.
+
+\begin{pgfplotskey}{smithchart mirrored=\mchoice{true,false} (initially false)}
+ \PGFPlots\ also supports Admittance Smith Charts. Here, the origin is on the right side of the circle:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{smithchart}[
+ smithchart mirrored,
+ title=Admittance Smith Chart]
+ \addplot coordinates {(0.5,0.2) (1,0.8) (2,2)};
+ \end{smithchart}
+\end{tikzpicture}
+\end{codeexample}
+\end{pgfplotskey}
+
+
+ Since \PGFPlots\ can draw two axes on top of each other, a combined Impedance/Admittance Smith Chart is also possible.
+\begin{codeexample}[]
+\begin{tikzpicture}[]
+% First, the Admittance chart:
+\begin{smithchart}[
+ title=Impedance and Admittance Smith Chart,
+ smithchart mirrored,
+ xticklabel shift=-19pt,
+ grid style={blue},
+ ticklabel style={blue},
+ yticklabel around circle,
+]
+\end{smithchart}
+
+% Second, overlay the impedance chart:
+\begin{smithchart}[
+ show origin,
+ grid style={red},
+ ticklabel style={red},
+ yticklabel around circle*,
+]
+\addplot+[black,mark=o,only marks,point meta=explicit symbolic,nodes near coords]
+coordinates {
+ (0.2,0.2) [(2)]
+ (1,0.2) [(1)]
+ };
+
+\addplot+[black,no marks,domain=0.2:1] {0.2};
+
+\addplot+[black,mark=o,only marks,point meta=explicit symbolic,nodes near coords]
+coordinates{
+ (0.2,0.5) [(3)]
+};
+\end{smithchart}
+\end{tikzpicture}
+\end{codeexample}
+ Since such a chart easily becomes crowded, it should be tuned manually by means of ``suitable'' appearance options (if you feel that there is a ``suitable default'', let me know).
+
+ Details for |show origin|, |yticklabel around circle|, and |yticklabel around circle*| can be found later in this section.
\end{environment}
\subsubsection{Size Control}
@@ -275,6 +330,61 @@ The tick and grid positions for |smithchart| axes are realized by means of three
\end{codeexample}
\end{stylekey}
+\begin{stylekey}{/pgfplots/yticklabel around circle}
+ This style draws Smith Chart tick labels for imaginary components (the |ytick| arguments) outside of the circle, but rotated to fit the slope of the circle.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{smithchart}[yticklabel around circle]
+ \end{smithchart}
+\end{tikzpicture}
+\end{codeexample}
+
+ The initial configuration for this style is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ yticklabel around circle/.style={
+ ytick align=center,
+ yticklabel style={
+ rotate=90,
+ sloped like y axis={%
+ execute for upside down={\tikzset{anchor=south west}},
+ %allow upside down,
+ reset nontranslations=false},
+ anchor=south east,
+ }
+ },
+}
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/pgfplots/yticklabel around circle*}
+ A variant of |yticklabel around circle| which exchanges the anchors:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{smithchart}[yticklabel around circle*]
+ \end{smithchart}
+\end{tikzpicture}
+\end{codeexample}
+ If you have two Smith Charts in the same figure, you can overlay them if the first uses |yticklabel around circle| and the second uses |yticklabel around circle*| (see the beginning of this section for an example).
+
+ The initial configuration for this style is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ yticklabel around circle*/.style={
+ ytick align=center,
+ yticklabel style={
+ rotate=90,
+ sloped like y axis={%
+ execute for upside down={\tikzset{anchor=north west}},
+ %allow upside down,
+ reset nontranslations=false},
+ anchor=north east,
+ }
+ }
+}
+\end{codeexample}
+\end{stylekey}
+
\begin{stylekey}{/pgfplots/every smithchart axis}
This style is installed for every Smith Chart. It is defined as
\begin{codeexample}[code only]
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.makefile b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.makefile
index 42acbc1be17..0349f8170b3 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.makefile
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.makefile
@@ -9,6 +9,7 @@ FORCEREMAKE:
include $(ALL_FIGURE_NAMES:%=%.dep)
%.dep:
+ mkdir -p $(dir $@)
touch $@ # will be filled later.
figures/expensiveexamplereference_addplot_0.pdf:
@@ -110,6 +111,18 @@ figures/expensiveexamplereference_threedim_23.pdf:
figures/expensiveexamplereference_threedim_24.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_24" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+figures/expensiveexamplereference_threedim_interior_colormap_0.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_interior_colormap_0" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
+figures/expensiveexamplereference_threedim_interior_colormap_1.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_interior_colormap_1" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
+figures/expensiveexamplereference_threedim_interior_colormap_2.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_interior_colormap_2" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
+figures/expensiveexamplereference_threedim_interior_colormap_3.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_interior_colormap_3" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
figures/expensiveexamplereference_threedim_contour_0.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_contour_0" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
@@ -122,6 +135,9 @@ figures/expensiveexamplereference_threedim_contour_2.pdf:
figures/expensiveexamplereference_threedim_contour_3.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_contour_3" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+figures/expensiveexamplereference_threedim_contour_4.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_contour_4" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
figures/expensiveexamplereference_threedim_25.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_threedim_25" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
@@ -200,6 +216,9 @@ figures/expensiveexamplereference_nodes_2.pdf:
figures/expensiveexamplereference_nodes_3.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplereference_nodes_3" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+figures/expensiveexamplepatchplot_0.pdf:
+ pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplepatchplot_0" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
+
figures/expensiveexamplepolar_0.pdf:
pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "figures/expensiveexamplepolar_0" "\def\tikzexternalrealjob{pgfplots}\input{pgfplots}"
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf
index 937f4c670ed..8abcdab378e 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.preamble.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.preamble.tex
index dcefd3a1da3..ec147b226ab 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.preamble.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.preamble.tex
@@ -149,7 +149,7 @@
\graphicspath{{figures/}}
-\def\preambleconfig{width=7cm,compat=1.5.1}
+\def\preambleconfig{width=7cm,compat=1.6}
\expandafter\pgfplotsset\expandafter{\preambleconfig}
@@ -223,5 +223,5 @@
\author{%
Dr.\ Christian Feuers\"anger\\
- {\footnotesize\texttt{ludewich@users.sourceforge.net}}}%
+ {\footnotesize\texttt{cfeuersaenger@users.sourceforge.net}}}%
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
index 1525e0fe6bb..a35ef1b049f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.2dplots.tex
@@ -631,6 +631,57 @@ Here, |ybar| yields |/pgfplots/ybar| because it is an argument to the axis, not
\end{pgfplotskey}
+ \begin{pgfplotskey}{hist/density=\marg{true,false} (initially false)}
+ \textit{An extension by J\"urnjakob Dugge}
+ \vskip\baselineskip
+ Enables density estimation mode. If |hist/density| is active, the resulting data points will be renormalized such that the overall ``mass'' equals~$1$.
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0,title=\texttt{hist}]
+\addplot [
+ hist,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+%
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=density}]
+\addplot [
+ hist=density,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+
+ The keys |hist/density| and |hist/cumulative| can be combined as well:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=cumulative}]
+\addplot [
+ hist=cumulative,
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+%
+\begin{tikzpicture}
+\begin{axis}[small,ymin=0, title=\texttt{hist=\{cumulative,density\}}]
+\addplot [
+ hist={cumulative,density},
+ fill=orange!75,
+ draw=orange!50!black]
+ table [y index=0] {plotdata/pgfplots.randn.dat};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \end{pgfplotskey}
+
\begin{stylekey}{/pgfplots/hist/handler (initially ybar interval)}
Allows to change the way the generated coordinates are visualized. The |hist/handler| key is a style, so use |hist/handler/.style={const plot}| to change it.
\end{stylekey}
@@ -800,13 +851,13 @@ Comb plots are very similar to bar plots except that they employ single horizont
% unexpected results here!
variable=\t,
quiver={
- u={cos(deg(t))},
- v={-sin(deg(t))},
+ u={-sin(deg(t))},
+ v={cos(deg(t))},
scale arrows=0.5},
->,blue]
- ({sin(deg(t))}, {cos(deg(t))});
+ ({cos(deg(t))}, {sin(deg(t))});
\addplot[samples=100, domain=0:2*pi]
- ({sin(deg(x))}, {cos(deg(x))});
+ ({cos(deg(x))}, {sin(deg(x))});
\end{axis}
\end{tikzpicture}
\end{codeexample}
@@ -861,9 +912,38 @@ Comb plots are very similar to bar plots except that they employ single horizont
\begin{stylekey}{/pgfplots/quiver/every arrow (initially empty)}
Allows to provide individual arrow styles.
- The style can contain any \Tikz\ drawing option. It might depend upon |mapped color| (provided |point meta| has been set).
+ The style can contain any \Tikz\ drawing option. It will be evaluated for every individual arrow and may depend upon anything which is available at visualization time.
+
+ In particular, this includes |point meta| data, typically using |\pgfplotspointmetatransformed| $\in [0,1000]$ where~$0$ corresponds to |point meta min| and~$1000$ corresponds to |point meta max|:
+\begin{codeexample}[]
+\begin{tikzpicture}
+% define some constants:
+\def\U{1}
+\def\V{2*x}
+\def\LEN{(sqrt((\U)^2 + (\V)^2)}
+
+\begin{axis}[axis equal image,
+ title=Thickness indicates ``strength''.
+]
+\addplot[blue,
+ point meta={\LEN},
+ quiver={
+ u={(\U)/\LEN}, v={(\V)/\LEN},
+ scale arrows=2,
+ every arrow/.append style={
+ line width=2pt*\pgfplotspointmetatransformed/1000
+ },
+ },
+ -stealth,samples=15,
+] {x^2};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent In the example, we have some 2d vector field stored in helper constants |\U| and |\V|. The length of each vector is stored in |\LEN| here. The |quiver| plot as such contains unit length vectors -- and the |\LEN| enters an |every arrow| style to get varying |line width|.
+
+ An |every arrow| style might also depend upon |mapped color| (provided |point meta| has been set).
- Again, if you don't need individual arrow styles, prefer using a plot style (|cycle list| or argument to |\addplot|) which is more efficient.
+ Again, if you do not need individual arrow styles, prefer using a plot style (|cycle list| or argument to |\addplot|) which is more efficient.
\end{stylekey}
\begin{pgfplotsxycodekeylist}{%
@@ -871,6 +951,24 @@ Comb plots are very similar to bar plots except that they employ single horizont
quiver/after arrow}%
Advanced keys for more fine tuning of the display. They allow to install some \TeX\ code manually before or after the drawing operations for single arrows. Both are initially empty.
\end{pgfplotsxycodekeylist}
+
+ \begin{stylekey}{/pgfplots/quiver/quiver legend}
+ A style which redefines |legend image code| in order to produce a suitable legend for |quiver| plots.
+
+ It is implicitly activated whenever |quiver| plot handlers are selected.
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[tiny]
+\addplot[blue,
+ quiver={u=1,v=3*x},
+ -stealth,
+ samples=15]
+ {x^3};
+\addlegendentry{Legend}
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \end{stylekey}
\end{plottype}
\subsubsection{Stacked Plots}
@@ -1584,7 +1682,26 @@ Please note that |\ifdim| compares \TeX\ lengths, so the example employs the suf
\subsubsection{Interrupted Plots}
\index{Interrupted Plots}%
\label{pgfplots:interrupt}%
-Sometimes it is desirable to draw parts of a single plot separately, without connection between the parts (discontinuities). This can be achieved using the |unbounded coords| key combined with coordinate values |nan|, |inf| or |-inf|.
+Sometimes it is desirable to draw parts of a single plot separately, without connection between the parts (discontinuities). \PGFPlots\ offers two ways to generate interrupted plots: either using |empty line|s or by providing |unbounded coords|.
+
+The first way is simple; it needs no extra key (only |\pgfplotsset{compat=1.4}| or newer in your preamble):
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ title=Interrupted data plot]
+
+ \addplot coordinates {
+ (0,0) (10,50) (20,100) (30,200)
+
+ (50,600) (60,800) (80,1000)
+ };
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\noindent Here, \PGFPlots\ runs with the default configuration |empty line=auto| which interpretes empty lines as ``jump'' markers. This works for any data input method, i.e.\ using |\addplot coordinates|, |\addplot table|, and |\addplot file|.
+
+
+The second way to generate interrupted plots addresses the case where |empty line|s are unavailable or impossible (due to limitations of the tool generating the data file, for example). In this case, interrupted plots can be achieved using the |unbounded coords| key combined with coordinate values |nan|, |inf| or |-inf|.
\begin{pgfplotskey}{unbounded coords=\mchoice{discard,jump} (initially discard)}
This key configures what to do if one or more coordinates of a single point are unbounded. Here, unbounded means it is either $\pm \infty$ (|+inf| or |-inf|) or it has the special ``not--a--number'' value |nan|.
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.3dplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.3dplots.tex
index 86b1f562b2c..b1a41674b22 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.3dplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.3dplots.tex
@@ -30,7 +30,7 @@ Enough for now, let's continue.
\begin{addplot3operation}[]{coordinates}{\marg{coordinate list}}
The \verbpdfref{\addplot3 coordinates} method works like its two--dimensional variant, \verbpdfref{\addplot coordinates} which is described in all detail on page~\pageref{pgfplots:addplot:coordinates}:
- A long list of coordinates |(|\meta{x}|,|\meta{y}|,|\meta{z}|)| is expected, separated by white spaces. The input list can be either an unordered series of coordinates, for example for scatter or line plots. It can also have matrix structure, in which case an empty input line (which is equivalent to ``|\par|'') marks the end of one matrix row. Matrix structure can also be provided if one of |mesh/rows| or |mesh/cols| is provided explicitly.
+ A long list of coordinates |(|\meta{x}|,|\meta{y}|,|\meta{z}|)| is expected, separated by white spaces. The input list can be either an unordered series of coordinates, for example for scatter or line plots. It can also have matrix structure, in which case an |empty line| (which is equivalent to ``|\par|'') marks the end of one matrix row. Matrix structure can also be provided if one of |mesh/rows| or |mesh/cols| is provided explicitly.
\long\def\temporarytest{\noexpand\par}
\begin{codeexample}[newline=\temporarytest]
@@ -47,7 +47,7 @@ Enough for now, let's continue.
\end{axis}
\end{tikzpicture}
\end{codeexample}
- \noindent Here, \verbpdfref{\addplot3} reads a matrix with three rows and four columns. The empty lines separate one row from the following.
+ \noindent Here, \verbpdfref{\addplot3} reads a matrix with three rows and four columns. The |empty line|s separate one row from the following.
As for the two--dimensional |plot coordinates|, it is possible to provide (constant) mathematical expressions inside of single coordinates. The syntax |(|\meta{x}|,|\meta{y}|,|\meta{z}|) |\oarg{meta} can be used just as for two dimensional |plot coordinates| to provide explicit color data; error bars are also supported.
\end{addplot3operation}
@@ -58,7 +58,7 @@ Enough for now, let's continue.
A further column is read after $z_i$ if |point meta=explicit| has been requested, see the documentation of \verbpdfref{\addplot file} on page~\pageref{pgfplots:addplot:file} for details.
- As for \verbpdfref{\addplot3 coordinates}, an empty line in the file marks the end of one matrix row.
+ As for \verbpdfref{\addplot3 coordinates}, an |empty line| in the file marks the end of one matrix row.
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}
@@ -97,7 +97,7 @@ Enough for now, let's continue.
\end{addplot3operation}
\begin{pgfplotskeylist}{mesh/rows=\marg{integer},mesh/cols=\marg{integer}}
- For visualization of mesh or surface plots which need some sort of matrix input, the dimensions of the input matrix need to be known in order to visualize the plots correctly. The matrix structure may be known from end--of--row marks (empty lines as general end--of--scanline markers in the input stream) as has been described above.
+ For visualization of mesh or surface plots which need some sort of matrix input, the dimensions of the input matrix need to be known in order to visualize the plots correctly. The matrix structure may be known from end--of--row marks (|empty line|s as general end--of--scanline markers in the input stream) as has been described above.
If the matrix structure is not yet known, it is necessary to provide at least one of |mesh/rows| or |mesh/cols| where |mesh/rows| indicates the number of samples for $y$ coordinates whereas |mesh/cols| is the number of samples used for $x$ coordinates (see also |mesh/ordering|).
@@ -148,6 +148,7 @@ Enough for now, let's continue.
\end{axis}
\end{tikzpicture}
\end{codeexample}
+ \noindent Note that |mesh/ordering| is mandatory, even though the size of the matrix can be provided in different ways. The example above uses |empty line|s to mark scanlines. One could also say |mesh/rows=3| and omit the |empty line|s.
Consequently, |mesh/ordering=|\declaretext{y varies} provides points such that successive $m$=|mesh/rows| points form a column, i.e. the $x$ coordinate is fixed and the $y$ coordinate changes. In this sense, |y varies| is equivalent to \declaretext{colwise} ordering, it is actually a matrix transposition.
\long\def\temporarytest{\noexpand\par}
@@ -237,7 +238,7 @@ Three dimensional line plots are generated if the input source has no matrix str
\end{axis}
\end{tikzpicture}
\end{codeexample}
-If there is no value for neither |mesh/rows| nor |mesh/cols| or if one of them is |1|, \PGFPlots\ will draw a line plot. This is also the case if there is no end--of--scanline marker (empty line) in the input stream.
+If there is no value for neither |mesh/rows| nor |mesh/cols| or if one of them is |1|, \PGFPlots\ will draw a line plot. This is also the case if there is no end--of--scanline marker (|empty line|) in the input stream.
For \verbpdfref{\addplot3 expression}, this requires to set |samples y=0| to disable the generation of a mesh.
\begin{codeexample}[]
@@ -250,6 +251,49 @@ For \verbpdfref{\addplot3 expression}, this requires to set |samples y=0| to dis
\end{axis}
\end{tikzpicture}
\end{codeexample}
+\noindent The example above is a parametric plot by expression, i.e.\ it has three distinct expressions for $x$, $y$, and $z$.
+
+Line plots in three dimensions are also possible for data plots (tables). The most simple case is if you simply provide a series of three--dimensional coordinates which will be connected in the order of appearance:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}
+\addplot3 table {
+ x y z
+ 0 0 0
+ 0.1 0.1 0.1
+ 0.1 0.2 0.2
+ 0.3 0.3 0.3
+ 1 1 1
+ };
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\noindent Note that this plot implicitly has |mesh/rows=1| because it has no end--of--scanline markers (|empty line|s). If in doubt, you can set |mesh/rows=1| explicitly to tell \PGFPlots\ that you have one--dimensional data (and not a matrix).
+
+Line plots from data files are also possible if the data files only contains two coordinates -- and the third should be provided somehow. In this case, the |table/x expr| feature comes into play: it allows to combine data plots and math expressions:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ xmin=3,xmax=6,
+ extra x ticks={4,5},
+ extra x tick style={xticklabel=\empty,grid=major}
+]
+\addplot3 table[x expr=4,y=a,z=b] {
+a b
+-3 9
+-2 4
+-1 1
+0 0
+1 1
+2 4
+3 9
+};
+\addplot3[red,domain=-3:3,samples y=0] (5,x,x^2);
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\noindent Here, we have two plots in one axis: one data plot from a data table with just two coordinates and one parametric plot. Both denote the same two functions. For the data plot, |x expr=4| assigns the $x$ coordinate, and |y=a,z=b| define how the input columns map to coordinates. Again, the plot implicitly uses |mesh/rows=1| since there is no end--of--scanline marker. The second plot does the same with the short--handed notation |(5,x,x^2)|. It only samples one--dimensional data due to |samples y=0|. Finally, |extra x ticks| configures two additional ticks for the $x$~axis; this is used to display grid lines for these specific ticks. The |xticklabel=\empty| argument avoids overprinted $x$~tick labels at positions $x\in\{4,5\}$.
+
Three dimensional line plots will usually employ lines to connect points (i.e.\ the initial |sharp plot| handler of \Tikz). The |smooth| method of \Tikz\ might also prove be an option. Note that no piecewise constant plot, comb or bar plot handler is supported for three dimensional axes.
@@ -685,6 +729,121 @@ The following example uses |mark=cube*| and |z buffer=sort| to place boxes at ea
Set |faceted color=none| to disable edge colors.
\end{pgfplotskey}
+{
+\tikzset{external/figure name/.add={}{interior_colormap_}}%
+\tikzset{
+ /pdflinks/search key prefixes in/.add={}{,/pgfplots/mesh/},
+}%
+\begin{pgfplotskeylist}{%
+ mesh/interior colormap=\marg{map name}\marg{colormap specification},%
+ mesh/interior colormap name=\marg{map name}}
+ Allows to use a different |colormap| for the ``other side'' of the surface.
+
+ Each mesh has two sides: one which ``points'' to the view's origin and one which points away from it. This key allows to define a second |colormap| for the side which points away from the view's origin. The motivation is to distinguish between the outer side and the interior parts of a surface:
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ axis lines=center,
+ axis on top,
+ xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
+ domain=0:1,
+ y domain=0:2*pi,
+ xmin=-1.5, xmax=1.5,
+ ymin=-1.5, ymax=1.5, zmin=0.0,
+ mesh/interior colormap=
+ {blueblack}{color=(black) color=(blue)},
+ colormap/blackwhite,
+ samples=10,
+ samples y=40,
+ z buffer=sort,
+ ]
+ \addplot3[surf]
+ ({x*cos(deg(y))},{x*sin(deg(y))},{x});
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+ \noindent The |interior colormap| is often the one for the ```inner side''. However, the orientation of the surface depends on its normal vectors: \PGFPlots\ computes them using the right-hand-rule. The right-hand-rule applied to a triangle means to take the first encountered point, point the thumb in direction of the second point and the first finger in direction of the third point. Then, the normal for that triangle is the third finger (i.e.\ the cross--product of the involved oriented edges). For rectangular patches, \PGFPlots\ uses the normal of one of its triangles\footnote{This may change in future versions.}. Consequently, |mesh/interior colormap| will only work if the involved patch segments are consistently oriented.
+
+ A patch whose normal vector points into the same direction as the view direction uses the standard |colormap name|. A patch whose normal vector points into the opposite direction (i.e.\ in direction of the viewport) uses |mesh/interior colormap|.
+
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ hide axis,
+ xlabel=$x$,ylabel=$y$,
+ mesh/interior colormap name=hot,
+ colormap/blackwhite,
+ ]
+ \addplot3[domain=-1.5:1.5,surf]
+ {-exp(-x^2-y^2)};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+ The implementation of |mesh/interior colormap| works well for most examples; in particular, if the number of samples is large enough to resolve the boundary between inner and outer colormap. However, it might still produce spurious artifacts:
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ title=Example needing fine-tuning,
+ xlabel=$x$,
+ ylabel=$y$]
+\addplot3[surf,
+ mesh/interior colormap=
+ {blueblack}{color=(black) color=(blue)},
+ colormap/blackwhite,
+ domain=0:1]
+ {sin(deg(8*pi*x))* exp(-20*(y-0.5)^2)
+ + exp(-(x-0.5)^2*30
+ - (y-0.25)^2 - (x-0.5)*(y-0.25))};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent The previous example has need for improvement with respect to a couple of aspects: first, it has small overshoots near some of the meshes vertices (especially on top of the hills). These can be fixed using |miter limit=1|. Second, the boundary between blue and black is incorrect. This can be improved by means of an increased sampling density (|samples=31|). In addition, we can configure \PGFPlots\ to move the boundary between the two colormaps in favor of the blue region using |mesh/interior colormap thresh| as follows:
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ title=Example of before with fine-tuning,
+ xlabel=$x$,
+ ylabel=$y$]
+\addplot3[surf,
+ mesh/interior colormap=
+ {blueblack}{color=(black) color=(blue)},
+ % slightly increase sampling quality (was 25):
+ samples=31,
+ % avoids overshooting corners:
+ miter limit=1,
+ % move boundary between inner and outer:
+ mesh/interior colormap thresh=0.1,
+ colormap/blackwhite,
+ domain=0:1]
+ {sin(deg(8*pi*x))* exp(-20*(y-0.5)^2)
+ + exp(-(x-0.5)^2*30
+ - (y-0.25)^2 - (x-0.5)*(y-0.25))};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent This improves the display.
+ \paragraph{Call for volunteers:} it would be nice if the fine--tuning of these keys would be unnecessary. If someone has well--founded suggestions (like knowledge and perhaps exhaustive experiments) on how to improve the feature, let me know.
+
+ Note that |mesh/interior colormap| cannot be combined with |mesh/refines| currently.
+
+ Note that |mesh/interior colormap| will increase compilation times due to the computation of normal vectors.
+\end{pgfplotskeylist}
+
+\begin{pgfplotskey}{mesh/interior colormap thresh=\marg{Number between $-1.0$ and $+1.0$} (initially 0)}
+ A threshold which moves the boundary between the |colormap| and |interior colormap| in favor of |colormap| (if the value is negative) or in favor of |interior colormap| (if the value is positive).
+
+ The extreme value $-1$ essentially deactivates |interior colormap| whereas the other extreme $+1$ deactivates |colormap|.
+
+ See above for an example.
+\end{pgfplotskey}
+}%
+
\begin{pgfplotskey}{surf shading/precision=\mchoice{pdf,postscript,ps} (initially postscript)}
A key to configure how the low level driver for |shader=interp| writes its data. The choice |pdf| uses 32~bit binary coordinates (which is lossless). The resulting |.pdf| files appear to be correct, but they can't be converted to postscript -- the converter software always complains about an error.
@@ -742,7 +901,7 @@ As mentioned, you can use any of the \PGFPlots\ input methods as long as it yiel
What happens behind the scenes is that \PGFPlots\ takes the input matrix and writes all encountered coordinates to a temporary file, including the end--of--scanline markers. Then, it generates a small |gnuplot| script and invokes |gnuplot| to compute the contour coordinates, writing everything into a temporary output file. Afterwards, it includes |gnuplot|'s output file just as if you'd write |\addplot3[contour prepared] file |\marg{temporaryfile}|;|.
- All this invocation of |gnuplot|, including input/output file management is transparent to the user. It only requires two things: first of all, it requires matrix data as input\footnote{Note that \texttt{contour gnuplot} processes the input stream only once. Consequently, the temporary file will contain only information which was available before the first point has been seen. The example above works because it contains empty lines as end-of-scanline markers. If you do not provide such markers, you may need to provide two of the three options \texttt{mesh/rows}, \texttt{mesh/cols}, or \texttt{mesh/num points}.}. Second, it requires you to enable system calls. Consider the documentation for \verbpdfref{plot gnuplot} for how to enable system calls.
+ All this invocation of |gnuplot|, including input/output file management is transparent to the user. It only requires two things: first of all, it requires matrix data as input\footnote{Note that \texttt{contour gnuplot} processes the input stream only once. Consequently, the temporary file will contain only information which was available before the first point has been seen. The example above works because it contains |empty line|s as end-of-scanline markers. If you do not provide such markers, you may need to provide two of the three options \texttt{mesh/rows}, \texttt{mesh/cols}, or \texttt{mesh/num points}.}. Second, it requires you to enable system calls. Consider the documentation for \verbpdfref{plot gnuplot} for how to enable system calls.
There are several fine-tuning parameters of the input/output file management, and it is even possible to invoke different programs than |gnuplot| (even |matlab|). These details are discussed at the end of this section, see below at page~\pageref{key:pgfplots:contour:gnuplot}.
\end{plottype}
@@ -768,11 +927,36 @@ As mentioned, you can use any of the \PGFPlots\ input methods as long as it yiel
Note that |contour/number| has no effect on |contour prepared|.
\end{pgfplotskey}
+\begin{pgfplotskey}{contour/levels=\marg{list of levels} (initially empty)}
+ Configures the number of contour lines which should be produced by any external contouring algorithm by means of a list of discrete levels.
+\pgfplotsexpensiveexample
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[
+ title={$x \exp(-x^2-y^2)$},
+ domain=-2:2,
+ enlargelimits,
+ view={0}{90},
+ ]
+ \addplot3[
+ contour gnuplot={levels={-0.1,-0.2,-0.6}},
+ thick]
+ {exp(0-x^2-y^2)*x};
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ It is also possible to change the |/pgf/number format| settings, see the documentation for the |contour/every contour label| style below.
+
+ This key has higher precedence than |contour/number|, i.e.\ if both are given, |contour/levels| will be active.
+
+ Note that |contour/levels| has no effect on |contour prepared|.
+\end{pgfplotskey}
+
\begin{plottype}[/pgfplots]{contour prepared=\textcolor{black}{\marg{{\normalfont options with `\texttt{contour/}' prefix}}}}
A plot handler which expects already computed contours on input and visualizes them. It cannot compute contours on its own.
\begin{pgfplotskey}{contour prepared format=\mchoice{standard,matlab} (initially standard)}
- There are two accepted input formats. The first is a long sequence of coordinates of the form $(x,y,z)$ where all successive coordinates with the same $z$ value make up a contour level (this is only part of complete truth, see below). The end--of--scanline markers (empty lines in the input) mark an interruption in one contour level.
+ There are two accepted input formats. The first is a long sequence of coordinates of the form $(x,y,z)$ where all successive coordinates with the same $z$ value make up a contour level (this is only part of complete truth, see below). The end--of--scanline markers (|empty line|s in the input) mark an interruption in one contour level.
For example, |contour prepared format=standard| could be\footnote{This is actually the output from our \texttt{\textbackslash addplot3[contour gnuplot] coordinates} example from above.}
\begin{codeexample}[]
@@ -803,7 +987,7 @@ As mentioned, you can use any of the \PGFPlots\ input methods as long as it yiel
\end{axis}
\end{tikzpicture}
\end{codeexample}
- \noindent Note that the empty lines are not necessary in this case: empty lines make only a difference if they occur within the same contour level (i.e. if the same $z$ value appears above and below of them).
+ \noindent Note that the |empty line|s are not necessary in this case: |empty line|s make only a difference if they occur within the same contour level (i.e. if the same $z$ value appears above and below of them).
The choice |contour prepared format=matlab| expects two--dimensional input data where the contour level and the number of elements of the contour line are provided as $x$ and $y$ coordinates, respectively, of a leading point. Such a format is used by |matlab|'s contour algorithms, i.e.\ it resembles the output of the matlab commands |data=contour(...)| or |data=contourc(...)|.
@@ -989,7 +1173,7 @@ save 'exporteddata.dat' data -ASCII
The choice |false| writes no such markers at all. In this case, |script| should contain |mesh/rows| and/or |mesh/cols|.
- The choice |if in input| generates end-of-scanline markers if they appear in the provided input data (either as empty lines or if the user provided at least two of the three options |mesh/rows|, |mesh/cols|, or |mesh/num points| explicitly).
+ The choice |if in input| generates end-of-scanline markers if they appear in the provided input data (either as |empty line|s or if the user provided at least two of the three options |mesh/rows|, |mesh/cols|, or |mesh/num points| explicitly).
The choice |required| works like |if in input|, but it will fail unless there really was such a marker.
@@ -997,9 +1181,13 @@ save 'exporteddata.dat' data -ASCII
\end{pgfplotskey}
\begin{pgfplotskey}{contour external/script=\marg{Code for external program} (initially empty)}
- Provides template code to generate a script for the external program. Inside of \meta{Code for external program}, the placeholder |\infile| will expand to the temporary input file and |\outfile| to the temporary output file. The temporary |\infile| is a text file containing one point on each line, in the form |x y meta meta|, separated by tabstops. Whenever a scanline is complete, an empty line is issued (but only if these scanline markers are found in the input stream as well). The complete set of scanlines forms a matrix. There are no additional comments or extra characters in the file. The macro |\ordering| will expand to |0| if the matrix is stored in |mesh/ordering=x varies| and |\ordering| will be |1| for |mesh/ordering=y varies|.
+ Provides template code to generate a script for the external program. Inside of \meta{Code for external program}, the placeholder |\infile| will expand to the temporary input file and |\outfile| to the temporary output file. The temporary |\infile| is a text file containing one point on each line, in the form |x y meta meta|, separated by tabstops. Whenever a scanline is complete, an |empty line| is issued (but only if these scanline markers are found in the input stream as well). The complete set of scanlines forms a matrix. There are no additional comments or extra characters in the file. The macro |\ordering| will expand to |0| if the matrix is stored in |mesh/ordering=x varies| and |\ordering| will be |1| for |mesh/ordering=y varies|.
Inside of \meta{Code for external program}, you can also use |\pgfkeysvalueof{/pgfplots/mesh/rows}| and |\pgfkeysvalueof{/pgfplots/mesh/cols}|; they expand to the matrix' size. Similarly, |\pgfkeysvalueof{/pgfplots/mesh/num points}| expands to the total number of points.
+
+ Inside of \meta{Code for external program}, the macro \declareandlabel{\thecontournumber} is defined to be the value |\pgfkeysvalueof{/pgfplots/contour/number}| and \declareandlabel{\thecontourlevels} contains the value |\pgfkeysvalueof{/pgfplots/contour/levels}|. These two macros simplify conditional code.
+
+ If you need one of the characters [\verb!"|;:#'`!] and some macro package already uses the character for other purposes, you can prepend them with a backslash, i.e. write |\"| instead of |"|.
\end{pgfplotskey}
\begin{pgfplotskey}{contour external/script extension=\marg{extension} (initially script)}
@@ -1019,7 +1207,11 @@ save 'exporteddata.dat' data -ASCII
contour external={
script={
unset surface;
- set cntrparam levels \pgfkeysvalueof{/pgfplots/contour/number};
+ \ifx\thecontourlevels\empty
+ set cntrparam levels \thecontournumber;
+ \else
+ set cntrparam levels discrete \thecontourlevels;
+ \fi
set contour;
set table \"\outfile\";
splot \"\infile\";
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axis-addplot.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axis-addplot.tex
index 2cbbc623b96..b4a4a6f5296 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axis-addplot.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axis-addplot.tex
@@ -222,12 +222,56 @@ Thus, you can combine |cycle list| and \meta{options}.
The distinction is as follows: |\addplot ...| (without options) lets \PGFPlots\ select colors, markers and linestyles automatically (using |cycle list|). The variant |\addplot+|\oarg{option}| ...| will use the same automatically determined styles, but in addition it uses \meta{options}. Finally, |\addplot|\oarg{options} (without the |+|) uses only the manually provided \meta{options}.
\end{addplot+}
+\begin{pgfplotskey}{empty line=\mchoice{auto,none,scanline,jump} (initially auto)}
+ Controls how empty lines in the input coordinate stream are to be interpreted. You should ensure that you have |\pgfplotsset{compat=1.4}| or newer in your preamble and leave this key at its default |empty line=auto|.
+
+ Empty lines can occur between the coordinates of |\addplot coordinates| or successive rows of the data file input routines |\addplot table| (and |\addplot file|).
+
+ The choice \declaretext{auto} checks if the current plot type is |mesh| or |surf|. If so, it uses |scanline|. If the current plot type is some other plot type (like a standard line plot), it uses |jump|. Note that the value \texttt{auto} for non-mesh plots results in \texttt{none} if |compat=1.3| or older is used. In other words: you have to write |\pgfplotsset{compat=1.4}| or newer to let \PGFPlots\ interpret empty lines as |jump| in standard line plots:
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[tiny,
+ title={Ignored: compat=1.3},
+ compat=1.3]
+ \addplot table {
+ A B
+ 0 0
+ 1 1
+
+ 1 2
+ 2 2
+ };
+ \end{axis}
+\end{tikzpicture}
+\begin{tikzpicture}
+ \begin{axis}[tiny,
+ title={Jump: compat=1.4},
+ compat=1.4]
+ \addplot table {
+ A B
+ 0 0
+ 1 1
+
+ 1 2
+ 2 2
+ };
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+ The choice \declaretext{scanline} is only useful for |mesh| and |surf|: it is used to decode a matrix from a coordinate stream. If an empty line occurs once every $N$ data points, the ``scanline'' length is~$N$. This information, together with |mesh/ordering| and the total number of points, allows to deduce the matrix size. However, the distance between empty lines has to be consistent: if the first two empty lines have a distance of~$2$ and the next comes after~$5$, \PGFPlots\ will ignore the information and will expect explicit matrix sizes using |mesh/rows| and/or |mesh/cols|. The choice |scanline| is ignored if |mesh input=patches|. It has no effect for other plot types.
+
+ The choice \declaretext{none} will silently discard any empty line in the input stream.
+
+ The choice \declaretext{jump} tells \PGFPlots\ to generate a jump.
+\end{pgfplotskey}
+
\subsubsection{Coordinate Lists}
\label{pgfplots:providing:input}
\begin{addplotoperation}[]{coordinates}{\marg{coordinate list}}
\label{pgfplots:addplot:coordinates}
-The `|plot coordinates|' command is like that provided by \Tikz\ and reads its input data from a sequence of point coordinates, encapsulated in round braces.
+The `|\addplot coordinates|' command is like that provided by \Tikz\ and reads its input data from a sequence of point coordinates, encapsulated in round braces.
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}
@@ -239,7 +283,10 @@ The `|plot coordinates|' command is like that provided by \Tikz\ and reads its i
\end{axis}
\end{tikzpicture}
\end{codeexample}
-\noindent The coordinates can be numbers, but they can also contain mathematical expressions like |sin(0.5)| or |\h*8| (assuming you defined |\h| somewhere). However, expressions which involve round braces need to be encapsulated in a further set of curly braces, for example |({sin(0.5)},{cos(0.1)})|.
+
+ You should \empty{only} use this input format if you have short diagrams and you want to provide mathematical expressions for each of the involved coordinates. Any data plots are typically easier to handle using a table format and |\addplot table|.
+
+The coordinates can be numbers, but they can also contain mathematical expressions like |sin(0.5)| or |\h*8| (assuming you defined |\h| somewhere). However, expressions which involve round braces need to be encapsulated in a further set of curly braces, for example |({sin(0.5)},{cos(0.1)})|.
You can also supply error coordinates (reliability bounds) if you are interested in error bars. Simply append the error coordinates with `\declareandlabel{+-} \parg{ex,ey}' (or |+- |\parg{ex,ey,ez}) to the associated coordinate:
\begin{codeexample}[]
@@ -280,6 +327,8 @@ Furthermore, |coordinates| allows to define ``meta data'' for each coordinate. T
\end{tikzpicture}
\end{codeexample}
Please refer to the documentation of |point meta| on page~\pageref{pgfplots:point:meta} for more information about per point meta data.
+
+ The coordinate stream can contain |empty line|s to tell \PGFPlots\ that the function has jumps. To use it, simply insert an empty line (and ensure that you have |\pgfplotsset{compat=1.4}| or newer in your preamble). See the documentation of |empty line| for details.
\end{addplotoperation}
\begin{pgfplotskey}{plot coordinates/math parser=\mchoice{true,false} (initially true)}
@@ -288,61 +337,14 @@ Please refer to the documentation of |point meta| on page~\pageref{pgfplots:poin
It is necessary to disable |plot coordinates/math parser| if you use some sort of symbolic transformations (i.e. text coordinates).
\end{pgfplotskey}
-\subsubsection{Reading Coordinates From Files}
-
-\begin{addplotoperation}[]{file}{\marg{name}}
-\label{pgfplots:addplot:file}
-\PGFPlots\ supports two ways to read plot coordinates of external files, and one of them is similar to the \Tikz-command `|plot file|'. It is to be used like
-\begin{codeexample}[code only]
-\addplot file {datafile.dat};
-\end{codeexample}
-where \meta{name} is a text file with at least two columns which will be used as $x$ and $y$ coordinates. Lines starting with `|%|' or `|#|' are ignored. Such files are often generated by \textsc{gnuplot}:
-\begin{codeexample}[code only]
-#Curve 0, 20 points
-#x y type
-0.00000 0.00000 i
-0.52632 0.50235 i
-1.05263 0.86873 i
-1.57895 0.99997 i
-...
-9.47368 -0.04889 i
-10.00000 -0.54402 i
-\end{codeexample}
-This listing has been copied from~\cite[section~16.4]{tikz}.
-
-Plot file accepts one optional argument,
-
-\begin{codeexample}[code only]
-\addplot file[skip first] {datafile.dat};
-\end{codeexample}
-
-\noindent
-which allows to skip over a non-comment header line. This allows to read the same input files as |plot table| by skipping over column names. Please note that comment lines do not count as lines here.
-
-The input method |plot file| can also read meta data for every coordinate. As already explained for |plot coordinates| (see above), meta data can be used to change colors or other style parameters for every marker separately. Now, if |point meta| is set to |explicit| or to |explicit symbolic| and the input method is |plot file|, one further element will be read from disk -- for every line. Meta data is always the last element which is read. See page~\pageref{pgfplots:scatter:src} for information and examples about per point meta data and page~\pageref{pgfplots:scatterclasses} for an application example using |scatter/classes|.
-
-
-Plot file is very similar to |plot table|: you can achieve the same effect with
-\begin{codeexample}[code only]
-\addplot table[x index=0,y index=1,header=false] {datafile.dat};
-\end{codeexample}
-\noindent Due to its simplicity, |plot file| is slightly faster while |plot table| allows higher flexibility.
-
-Technical note: every opened file will be protocolled into your log file.
-\end{addplotoperation}
-
-\begin{pgfplotskeylist}{%
- plot file/skip first=\mchoice{true,false} (initially false),%
- plot file/ignore first=\mchoice{true,false} (initially false)}
- The two keys can be provided as arguments to |\addplot file[|\meta{options}|] |\marg{filename}|;| to skip the first non-comment entry in the file. They are equivalent.
- If you provide them in this context, the prefix |/pgfplots/plot file| can be omitted.
-\end{pgfplotskeylist}
\subsubsection{Reading Coordinates From Tables}
-\begin{addplotoperation}[]{table}{\oarg{column selection}\marg{file}}
+\begin{addplotoperation}[]{table}{\oarg{column selection}\marg{file or inline table}}
\label{pgfplots:addplot:table}
-The use of `|plot table|' is similar in spirit to `|plot file|', but its flexibility is higher. Given a data file like
+This input method is the main input format for any data--based function. It accepts either a file containing data or an inline table provided in curly braces.
+
+Given a data file like
\begin{codeexample}[code only]
dof L2 Lmax maxlevel
5 8.31160034e-02 1.80007647e-01 2
@@ -470,8 +472,12 @@ Summary and remarks:
One application (with several examples how to use this syntax) is line fitting with |create col/linear regression|, see Section~\ref{sec:linefitting} for details.
+ \item
+ The table can contain |empty line|s to tell \PGFPlots\ that the function has jumps. To use it, simply insert an empty line (and ensure that you have |\pgfplotsset{compat=1.4}| or newer in your preamble). See the documentation of |empty line| for details.
\item Technical note: every opened file will be protocolled into your log file.
+
\end{itemize}
+
\end{addplotoperation}
\subsubsection*{Keys To Configure Table Input}
@@ -1140,9 +1146,9 @@ The following list of keys configure |\addplot graphics|. Note that the common p
The |plot graphics| tool of \PGFPlots\ allows to include three--dimensional external graphics: it generates a three--dimensional axis on its own. The idea is to provide a graphics (without descriptions) and use \PGFPlots\ to overlay a three--dimensional axis automatically. This allows to maintain document consistency (making it unnecessary to use different programs within the same document).
-You are probably guessing how this is possible. Well, it needs more user input than two--dimensional external graphics. The cost to include external three dimensional images into \PGFPlots\ is essentially control of a graphics program like |gimp|: you need to identify the 3D coordinates of a couple of points in your image. \PGFPlots\ will then squeeze the graphics correctly, and it reconfigures the axis to ensure a correct display of the result.
+You are probably wondering how this is possible. Well, it needs more user input than two--dimensional external graphics. The cost to include external three dimensional images into \PGFPlots\ is essentially control of a graphics program like |gimp|: you need to identify the 3D coordinates of a couple of points in your image. \PGFPlots\ will then squeeze the graphics correctly, and it reconfigures the axis to ensure a correct display of the result.
-\paragraph{Warning:} The feature is only 95\% stable yet and may need some more testing. Use at your own risk.
+\paragraph{Matlab versus other tools:} Although this section is based on Matlab images, the technique to import three--dimensional graphics is independent of Matlab. Thus, if you have a different tool, you need to read all that follows. However, users of Matlab \emph{can use a simplified export mechanism} which has been contributed by J\"urnjakob Dugge. Please skip to section~\ref{sec:plotgraphics3d:matlabscript} on page~\pageref{sec:plotgraphics3d:matlabscript} if you use Matlab to generate the graphics files (although you may want to take a brief look at the examples on the following pages to learn about flexibility or legends).
Let's start with two examples. Suppose you generate a surface plot with Matlab and want to include it in \PGFPlots. We have the matlab script
\begin{codeexample}[code only]
@@ -1228,7 +1234,7 @@ Once these four point coordinates are gathered, we find Matlab's surface plot in
\end{axis}
\end{tikzpicture}
\end{codeexample}
-\noindent \PGFPlots\ uses the four input points to compute appropriate |x|, |y| and |z| unit vectors (and the origin in graphics coordinates). These four vectors (with two components each) can be computed as a result of a linear system of size $8\times 8$, that is why you need to provide four input points (each has two coordinates). \PGFPlots\ computes the unit vectors of the imported graphics, and afterwards it rescales the result such that it fits into the specified |width| and |height|. This rescaling respects the |unit vector ratio| (more precisely, it uses |scale mode=scale uniformly| instead of |scale mode=stretch to fill|). Consequently, the freedom to change the view of a three--dimensional axis which contains a projected graphics is considerably smaller than before. Surprisingly, you can still change axis limits and |width| and |height| -- \PGFPlots\ will take care of a correct display of your imported graphics.
+\noindent \PGFPlots\ uses the four input points to compute appropriate |x|, |y| and |z| unit vectors (and the origin in graphics coordinates). These four vectors (with two components each) can be computed as a result of a linear system of size $8\times 8$, that is why you need to provide four input points (each has two coordinates). \PGFPlots\ computes the unit vectors of the imported graphics, and afterwards it rescales the result such that it fits into the specified |width| and |height|. This rescaling respects the |unit vector ratio| (more precisely, it uses |scale mode=scale uniformly| instead of |scale mode=stretch to fill|). Consequently, the freedom to change the view of a three--dimensional axis which contains a projected graphics is considerably smaller than before. Surprisingly, you can still change axis limits and |width| and |height| -- \PGFPlots\ will take care of a correct display of your imported graphics. Since version~1.6, you can also change |zmin| and/or |zmax| -- \PGFPlots\ will respect your changes as good as it can.
Here is a further example. Suppose we are given the three--dimensional visualization
@@ -1265,7 +1271,7 @@ It has been generated by matlab (I only added transparency to the background wit
\end{codeexample}
\noindent Note that I provided \emph{five} three--dimensional coordinates here, but the last entry has no |=>| mapping to two--dimensional canvas coordinates. Thus, it is only used to update the bounding box (see the reference manual for the |points| key for details).
-The example above is clipped because \PGFPlots\ could not rescale the graphics automatically. Changing the ratio between |width| and |height| improves the display:
+The example above leads to a relatively small image and much ``empty space''. This is due to the |scale mode=scale uniformly| implementation of \PGFPlots: it decided that the best way is to enlarge the involved axis limits. Here, ``best way'' means to satisfy |width|/|height| constraints combined with minimally enlarged (never shrinked) axis limits. The remaining degrees of freedom are |width|, |height|, and the axis limits. In our case, changing the ratio between |width| and |height| improves the display:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1291,7 +1297,11 @@ The example above is clipped because \PGFPlots\ could not rescale the graphics a
\end{axis}
\end{tikzpicture}
\end{codeexample}
-\noindent What happens is that \PGFPlots\ \emph{only} rescales the $z$ axis. This has the effect that the axes are all scaled by a single scaling factor (using |scale mode=scale uniformly|), skewing is avoided. In this approach, you can only modify |width| and |height| to provide more freedom.
+\noindent What happens is that \PGFPlots\ selects a \emph{single} scaling factor which is applied to all units as they have been deduced from the |points| key. This ensures that the imported graphics fits correctly into the axis. In addition, \PGFPlots\ does its best to satisfy the remaining constraints.
+
+The complete description of how \PGFPlots\ scales the axis can be found in the documentation for |scale mode=scale uniformly|. Here is just a brief summary: \PGFPlots\ assumes that the prescribed |width| and |height| have to be satisfied. To this end, it rescales the projected unit vectors (i.e.\ the space which is taken up for each unit in $x$, $y$, and $z$) and it can modify the axis limits. In the default configuration |scale uniformly strategy=auto|, \PGFPlots\ will \emph{never} shrink axis limits.
+
+\paragraph{Compatibility remark:} Note that the scaling capabilities have been improved for \PGFPlots\ version~1.6. In previous versions, only |scale uniformly strategy=change vertical limits| was available which lead to clipped axes. In short: please consider writing |\pgfplotsset{compat=1.6}| or newer into your document to benefit from the improved scaling. If you have |\pgfplotsset{compat=1.5}| or older, the outcome for |\addplot3 graphics| will be different.
We consider a third example which has been generated by the Matlab code
\begin{codeexample}[code only]
@@ -1342,15 +1352,126 @@ We proceed as before and collect four points, each with 3d logical coordinates (
\end{axis}
\end{tikzpicture}
\end{codeexample}
+\noindent Note that it has non-standard data aspect ratio which is respected by \PGFPlots\ automatically.
+
+
+\subsubsection*{External Three-Dimensional Graphics and Matlab}
+
+\textit{An extension by J\"urnjakob Dugge}
+\vskip\baselineskip
+
+\noindent
+\label{sec:plotgraphics3d:matlabscript}
+The procedure to map three--dimensional logical coordinates to two--dimensional canvas coordinates is tedious.
+
+J\"urnjakob Dugge contributed a script which does most of the logic and your work is reduced to a copy--paste job. With his permission, I post the contribution here.
+
+The idea is to start a simple script which \emph{records} mappings for any coordinates which have been clicked by the user. It works as follows:
+
+\begin{enumerate}
+ \item Create the Matlab plot, say, using
+\begin{codeexample}[code only]
+hist3(randn(10000,2)) % some random data
+set(get(gca,'child'),'FaceColor','interp','CDataMode','auto'); % colors
+% make sure the "print" paper format is the same as the screen paper format:
+set(gcf,'PaperPositionMode','auto')
+\end{codeexample}
+
+ \item Save the following code as |pgfplotscsconversion.m|:
+\begin{codeexample}[code only]
+function pgfplotscsconversion
+
+% Hook into the Data Cursor "click" event
+h = datacursormode(gcf);
+set(h,'UpdateFcn',@myupdatefcn,'SnapToDataVertex','off');
+datacursormode on
-\paragraph{Technical points:} the following issues might arise while working with \verbpdfref{\addplot3} |graphics|:
+% select four points in plot using mouse
+
+% The function that gets called on each Data Cursor click
+function [txt] = myupdatefcn(obj,event_obj)
+
+% Get the screen resolution, in dots per inch
+dpi = get(0,'ScreenPixelsPerInch');
+
+% Get the click position in pixels, relative to the lower left of the
+% screen
+screen_location=get(0,'PointerLocation');
+
+% Get the position of the plot window, relative to the lower left of
+% the screen
+figurePos = get(gcf,'Position');
+
+% Get the data coordinates of the cursor
+pos = get(event_obj,'Position');
+
+% Format the data and figure coordinates. The factor "72.27/dpi" is
+% necessary to convert from pixels to TeX points (72.27 poins per inch)
+display(['(',num2str(pos(1)),',',num2str(pos(2)),',',num2str(pos(3)),') => (', ...
+ num2str((screen_location(1)-figurePos(1))*72.27/dpi),',', ...
+ num2str((screen_location(2)-figurePos(2))*72.27/dpi),')'])
+
+% Format the tooltip display
+txt = {['X: ',num2str(pos(1))],['Y: ',num2str(pos(2))],['Z: ',num2str(pos(3))]};
+\end{codeexample}
+
+ Run |pgfplotscsconversion|, click on four points in your plot. Preferably select non-colinear points near the edges of the plot. Copy and paste the four lines that were written to the Matlab command window.
+
+ Make sure that the first two points have different $X$ and $Y$ values on screen (i.e.\ image canvas coordinates).
+ \item Export the plot as an image
+\begin{codeexample}[code only]
+axis off
+print -dpng matlabout -r400 % PNG called "matlabout.png" with 400 dpi resolution
+\end{codeexample}
+
+Note that |pdf| output of Matlab is clumsy. It might be best to export to |eps| first, followed by a conversion from |eps| to |pdf|.
+
+\emph{If} you really want to use |pdf| output of Matlab, you may need to set the paper size to match the figure size by yourself, since the PDF driver does not automatically adjust the size:
+
+\begin{codeexample}[code only]
+% It might be better to use print -depsc followed by epstopdf.
+% Use this if you (really) want to use print -dpdf:
+currentScreenUnits=get(gcf,'Units') % Get current screen units
+currentPaperUnits=get(gcf,'PaperUnits') % Get current paper units
+set(gcf,'Units',currentPaperUnits) % Set screen units to paper units
+plotPosition=get(gcf,'Position') % Get the figure position and size
+set(gcf,'PaperSize',plotPosition(3:4)) % Set the paper size to the figure size
+set(gcf,'Units',currentScreenUnits) % Restore the screen units
+
+print -dpdf matlabout % PDF called "matlabout.pdf"
+\end{codeexample}
+\item Include the image in your \PGFPlots\ axis. If you selected points on the plot corners, your |xmin|, |xmax|, |ymin| and |ymax| should be set automatically, otherwise you may want to provide those yourself. Also, adjustments of |width| and |height| might be of interest to get the right vertical placement of the plot. Consider changing |zmin| and/or |zmax| to fit your needs (preferrably only one of them; otherwise \PGFPlots\ may be unable to fix the |height|).
+\end{enumerate}
+
+This contribution is from
+
+\noindent
+\url{http://tex.stackexchange.com/questions/52987/3-dimensional-histogram-in-pgfplots} .
+
+
+
+\subsubsection*{Summary: External Three-Dimensional Graphics}
+As has been shown in the previous sections, \verbpdfref{\addplot3} |graphics| allows to include three-dimensional graphics and \PGFPlots\ overlays a flexible axis with all its power. The cost to do so is
+\begin{enumerate}
+ \item collect both logical three--dimensional coordinates \emph{and} image--internal two--dimensional coordinates for \emph{four points} of your graphics.
+
+ In Matlab, this can be simplified by the tool mentioned on page~\pageref{sec:plotgraphics3d:matlabscript}.
+
+ \item If your axes form a right--handed--coordinate system, that is all. If not, also add |x dir=reverse| for any reversed axes.
+\end{enumerate}
+
+\noindent
+Consider the following list of you encounter problems while working with \verbpdfref{\addplot3} |graphics|:
\begin{itemize}
\item It must be possible to deduce the origin and the three (two--dimensional) unit vectors from the four provide |points|; otherwise the algorithm will fail.
The algorithm should detect any deficiancies. However, if you encounter strange ``Dimension too large'' messages here, you can try other arguments in |points|. Take a look into your log file, it will probably indicate the source of problems (or use the |debug| key).
\item \PGFPlots\ uses the first two points to squeeze the graphics into the desired coordinates (which implies that they should not have the same canvas $X$ or $Y$ coordinates). It verifies that the remaining |points| arguments are projected correctly.
- \item The resulting scaling by means of |scale mode=scale uniformly| will only rescale the $z$ axis. You may need to adjust |width| and |height| (both of them) if the result is unsatisfactory (see the example above).
+ \item The resulting scaling by means of |scale mode=scale uniformly| will try to satisfy all scaling constraints. You can change these constraints by modifying |width|, |height|, |xmin|, |xmax|, |ymin|, |ymax|, |zmin|, |zmax| and/or any combination of these parameters. See also |unit rescale keep size| which controls the flexibility of limit changes. There is also a key |scale uniformly strategy| which allows to select a different scaling strategy.
+
+ \item The image should have a ``right--handed--coordinate system'': you should be able to take your right hand, point your thumb in direction of the $x$ axis, your first finger in direction of~$y$, and your second finger in direction of the $z$~axis. If that is impossible, once of your axes is reversed and you need to communicate that to \PGFPlots\ explicitly by means of the |x dir=reverse| key (and its variants).
+
\item There is a |debug| key to investigate what the algorithm is doing:
\begin{pgfplotskey}{plot graphics/debug=\marg{true,false} (initially false)}
If you provide |\addplot3 graphics[debug,points={...}]|, \PGFPlots\ will provide debug information onto your terminal and into the logfile. It will also generate extra files containing the determined unit vectors and the linear system used to derive them (one such file for every |\addplot3 graphics| statement, the filename will be the graphics file name and |.dat| appended).
@@ -1360,4 +1481,58 @@ We proceed as before and collect four points, each with 3d logical coordinates (
\end{itemize}
}
+\subsubsection{Reading Coordinates From Files}
+
+\begin{addplotoperation}[]{file}{\marg{name}}
+\label{pgfplots:addplot:file}
+\paragraph{Deprecation note:} If you have data files, you should generally use |\addplot table|. The input type |\addplot file| is almost the same, but considerably less powerful. It is only kept for backwards compatibility.
+
+
+The |\addplot file| input mechanism is similar to the \Tikz-command `|plot file|'. It is to be used like
+\begin{codeexample}[code only]
+\addplot file {datafile.dat};
+\end{codeexample}
+where \meta{name} is a text file with at least two columns which will be used as $x$ and $y$ coordinates. Lines starting with `|%|' or `|#|' are ignored. Such files are often generated by \textsc{gnuplot}:
+\begin{codeexample}[code only]
+#Curve 0, 20 points
+#x y type
+0.00000 0.00000 i
+0.52632 0.50235 i
+1.05263 0.86873 i
+1.57895 0.99997 i
+...
+9.47368 -0.04889 i
+10.00000 -0.54402 i
+\end{codeexample}
+This listing has been copied from~\cite[section~16.4]{tikz}.
+
+Plot file accepts one optional argument,
+
+\begin{codeexample}[code only]
+\addplot file[skip first] {datafile.dat};
+\end{codeexample}
+
+\noindent
+which allows to skip over a non-comment header line. This allows to read the same input files as |plot table| by skipping over column names. Please note that comment lines do not count as lines here.
+
+The input method |plot file| can also read meta data for every coordinate. As already explained for |plot coordinates| (see above), meta data can be used to change colors or other style parameters for every marker separately. Now, if |point meta| is set to |explicit| or to |explicit symbolic| and the input method is |plot file|, one further element will be read from disk -- for every line. Meta data is always the last element which is read. See page~\pageref{pgfplots:scatter:src} for information and examples about per point meta data and page~\pageref{pgfplots:scatterclasses} for an application example using |scatter/classes|.
+
+
+Plot file is very similar to |plot table|: you can achieve the same effect with
+\begin{codeexample}[code only]
+\addplot table[x index=0,y index=1,header=false] {datafile.dat};
+\end{codeexample}
+\noindent Due to its simplicity, |plot file| is slightly faster while |plot table| allows higher flexibility.
+
+Technical note: every opened file will be protocolled into your log file.
+
+ The file can contain |empty line|s to tell \PGFPlots\ that the function has jumps. To use it, simply insert an empty line (and ensure that you have |\pgfplotsset{compat=1.4}| or newer in your preamble). See the documentation of |empty line| for details.
+\end{addplotoperation}
+
+\begin{pgfplotskeylist}{%
+ plot file/skip first=\mchoice{true,false} (initially false),%
+ plot file/ignore first=\mchoice{true,false} (initially false)}
+ The two keys can be provided as arguments to |\addplot file[|\meta{options}|] |\marg{filename}|;| to skip the first non-comment entry in the file. They are equivalent.
+ If you provide them in this context, the prefix |/pgfplots/plot file| can be omitted.
+\end{pgfplotskeylist}
}%
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex
index 0e7dc2f4705..6f805573d05 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.axisdescription.tex
@@ -1617,6 +1617,8 @@ In some applications, more than one $y$ axis is used if the $x$ range is the sam
\begin{codeexample}[]
\begin{tikzpicture}
+ % let both axes use the same layers
+ \pgfplotsset{set layers}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
@@ -1640,6 +1642,7 @@ In some applications, more than one $y$ axis is used if the $x$ range is the sam
\begin{enumerate}
\item Scaling. You should set |scale only axis| because this forces equal dimensions for both axis, without respecting any labels.
\item Same $x$ limits. You should set those limits explicitly.
+ \item You need to tell \PGFPlots\ that it should share the same graphics layers for both axes. In this case, \PGFPlots\ will draw plots of the first axis and of the second axis onto the same layer. It will also draw background(s) into the background layer and descriptions into the foreground layer. Use the key |\pgfplotsset{set layers}| in front of the first axis to prepare the complete picture for layered graphics.
\end{enumerate}
You may want to consider different legend styles.
It is also possible to use only the axis, without any plots:
@@ -1647,6 +1650,8 @@ It is also possible to use only the axis, without any plots:
\begin{codeexample}[]
% \usepackage{textcomp}
\begin{tikzpicture}
+ % let both axes use the same layers
+ \pgfplotsset{set layers}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
@@ -2230,166 +2235,3 @@ Thus, typing |\ref|\marg{name} somewhere outside of the axis, maybe even outside
\end{stylekey}
\end{pgfplotskey}
-\subsubsection{Scaling Descriptions: Predefined Styles}
-\label{sec:scaling:styles}
-It is reasonable to change font sizes, marker sizes etc. together with the overall plot size: Large plots should also have larger fonts and small plots should have small fonts and a smaller distance between ticks.
-
-\begin{keylist}{
- /tikz/font=\mchoice{\textbackslash normalfont,\textbackslash small,\textbackslash tiny,$\dotsc$},
- /pgfplots/max space between ticks=\marg{integer},
- /pgfplots/try min ticks=\marg{integer},
- /tikz/mark size=\marg{integer}}
- These keys should be adjusted to the figure's dimensions. Use
-\begin{codeexample}[code only]
-\pgfplotsset{tick label style={font=\footnotesize},
- label style={font=\small},
- legend style={font=\small}
-}
-\end{codeexample}
- to provide different fonts for different descriptions.
-
- The keys |max space between ticks| and |try min ticks| are described on page~\pageref{maxspacebetweenticks} and configure the approximate distance and number of successive tick labels (in |pt|). Please omit the |pt| suffix here.
-\end{keylist}
-
-There are a couple of predefined scaling styles which set some of these options:
-
-\begin{stylekey}{/pgfplots/normalsize}
- Re-initialises the standard scaling options of \PGFPlots.
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \begin{axis}[normalsize,
- title=A ``normalsize'' figure,
- xlabel=The $x$ axis,
- ylabel=The $y$ axis,
- minor tick num=1,
- legend entries={Leg}]
- \addplot {max(4*x,7*x)};
- \end{axis}
-\end{tikzpicture}
-\end{codeexample}
-
- The initial setting is
-\begin{codeexample}[code only]
-\pgfplotsset{
- normalsize/.style={
- /pgfplots/width=240pt,
- /pgfplots/height=207pt,
- /pgfplots/max space between ticks=35
- }
-}
-\end{codeexample}
-\end{stylekey}
-
-\begin{stylekey}{/pgfplots/small}
- Redefines several keys such that the axis is ``smaller''.
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \begin{axis}[small,
- title=A ``small'' figure,
- xlabel=The $x$ axis,
- ylabel=The $y$ axis,
- minor tick num=1,
- legend entries={Leg}]
- \addplot {x^2};
- \end{axis}
-\end{tikzpicture}
-\end{codeexample}
- The initial setting is
-\begin{codeexample}[code only]
-\pgfplotsset{
- small/.style={
- width=6.5cm,
- height=,
- tick label style={font=\footnotesize},
- label style={font=\small},
- max space between ticks=25,
- }
-}
-\end{codeexample}
-Feel free to redefine the scaling -- the option may still be useful to get more ticks without typing too much. You could, for example, set |small,width=6cm|.
-\end{stylekey}
-
-\begin{stylekey}{/pgfplots/footnotesize}
- Redefines several keys such that the axis is even smaller. The tick labels will have |\footnotesize|.
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \begin{axis}[footnotesize,
- title=A ``footnotesize'' figure,
- xlabel=The $x$ axis,
- ylabel=The $y$ axis,
- minor tick num=1,
- legend entries={Leg}]
- \addplot+[const plot]
- coordinates {
- (0,0) (1,1) (3,3) (5,10)
- };
- \end{axis}
-\end{tikzpicture}
-\end{codeexample}
- The initial setting is
-\begin{codeexample}[code only]
-\pgfplotsset{
- footnotesize/.style={
- width=5cm,
- height=,
- legend style={font=\footnotesize},
- tick label style={font=\footnotesize},
- label style={font=\small},
- title style={font=\small},
- every axis title shift=0pt,
- max space between ticks=15,
- every mark/.append style={mark size=8},
- major tick length=0.1cm,
- minor tick length=0.066cm,
- },
-}
-\end{codeexample}
-As for |small|, it can be convenient to set |footnotesize| and set |width| afterwards.
-
-You will need |compat=1.3| or newer for this to work.
-\end{stylekey}
-
-\begin{stylekey}{/pgfplots/tiny}
- Redefines several keys such that the axis is very small. Most descriptions will have |\tiny| as fontsize.
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \begin{axis}[tiny,
- title=A ``tiny'' figure,
- xlabel=The $x$ axis,
- ylabel=The $y$ axis,
- minor tick num=1,
- legend entries={Leg}]
- \addplot+[const plot]
- coordinates {
- (0,0) (1,1) (3,3) (5,10)
- };
- \end{axis}
-\end{tikzpicture}
-\end{codeexample}
- The initial setting is
-\begin{codeexample}[code only]
-\pgfplotsset{
- tiny/.style={
- width=4cm,
- height=,
- legend style={font=\tiny},
- tick label style={font=\tiny},
- label style={font=\tiny},
- title style={font=\footnotesize},
- every axis title shift=0pt,
- max space between ticks=12,
- every mark/.append style={mark size=6},
- major tick length=0.1cm,
- minor tick length=0.066cm,
- every legend image post/.append style={scale=0.8},
- },
-}
-\end{codeexample}
-As for |small|, it can be convenient to use |tiny,width=4.5cm| to adjust the width.
-
-You will need |compat=1.3| or newer for this to work.
-\end{stylekey}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.coordfiltering.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.coordfiltering.tex
index 4aa02209c7a..a546a1acbf2 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.coordfiltering.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.coordfiltering.tex
@@ -83,6 +83,8 @@ There is also a style key which simplifies selection by index, see below.
A style which appends an |x filter| which discards all but each $n$th input coordinate.
\index{Downsampling}
+ This downsampling works fairly well. It can be used to reduce a huge amount of coordinates from an input file. In this case, you should also set |filter discard warning=false| to avoid repeated notifications about skipped coordinates and |unbounded coords=discard| such that \PGFPlots\ should silently forget any discarded points (rather than generated interrupted plots).
+
Note that there is also a |mark repeat| style which applies the same operation to plot marks only.
\paragraph{Technical note}: this style usually applies to $x$ coordinates (i.e.\ it counts $x$ coordinates). In case you want to apply it to something like |hist/data| or |quiver/u|, you can
@@ -141,7 +143,7 @@ There is also a style key which simplifies selection by index, see below.
A low--level (technical) key which allows to apply the |restrict * to ...| features also to something like |hist/data|.
For example,
- |@restrict to domain={hist/data}{}{0:1}{0}| applies the domain-restriction to the histogram-input |hist/data|. The final `|0|' means that it works as the key |restrict x to domain=0:1|, i.e.\ it skips everything which is outside of $[0,1]$. In a similar way,
+ |@restrict to domain={hist/data}{}{0:1}{0}| applies the domain-restriction to the histogram-input |hist/data|. The final `|0|' means that it works in a similar way as the key |restrict x to domain=0:1|, i.e.\ it skips everything which is outside of $[0,1]$. In a similar way,
|@restrict to domain={hist/data}{}{0:1}{1}| applies the functionality of |restrict x to domain*=0:1| to |hist/data|: it truncates values outside of $[0,1]$ to the domain's end-points.
The \meta{filter name} is expected to be a coordinate name like |x|, |y|, |z| (or |hist/data|).
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.layers.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.layers.tex
new file mode 100644
index 00000000000..8fdcfbb20df
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.layers.tex
@@ -0,0 +1,215 @@
+\subsection{Layers}
+{
+\tikzset{external/figure name/.add={}{layers_}}%
+
+It is important that several parts of an axis are drawn ``on top'' of others. Usually, \PGFPlots\ ensures this by drawing them in a suitable sequence (usually background followed by grid lines, followed by tick lines and tick labels, followed by plots and finally axis descriptions). While this works reasonable in most cases, there are cases where more control is desired. One common use-case is if multiple axes shall be drawn into the same picture: here, the sequence from above should be applied to all involved axes simultaneously.
+
+\subsubsection{Summary}
+This section is the technical reference for using and customizing layered graphics in \PGFPlots. As such, it is hard reading.
+
+For most purposes, the following is \emph{completely} sufficient for you: If you want to enable layered graphics, put the following statement into the |tikzpicture| which is supposed to have layered graphics:
+
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ \pgfplotsset{set layers}
+ \begin{axis}
+ ...
+ \end{axis}
+
+ % perhaps a second axis which should use the same layers?
+ \begin{axis}
+ ...
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+\noindent This enables layered graphics for that specific |tikzpicture|.
+
+You may want layered graphics if you have multiple axes in the same picture, of if you have specific needs for your plot.
+
+Consider reading |on layer| if you want to move particular elements of your axis to a different layer.
+
+
+\subsubsection{Using Predefined Layers}
+The main key to control layered graphics with \PGFPlots\ is |set layers|:
+
+\pgfkeys{
+ /pgfmanual/gray key prefixes/.add={/pgfplots/layers/,}{},
+}
+
+\begin{pgfplotskey}{set layers=\mchoice{none,\normalfont\meta{layer configuration name}} (initially none)}
+ This key enables layered graphics for either the current axis or for all following axes.
+
+ Enabling layered graphics has the effect that the order in which graphical elements are given is unrelated to the ordering in which they will be drawn. The main benefit is if you have multiple axes in the same figure: the axes can share the same layers.
+
+ The invocation |set layers=none| disables layered graphics.
+
+ The invocation |set layers| (without equal sign and without arguments) is the same as if you would write |set layers=||default|.
+
+ In all other cases, |set layers| expects a \meta{layer configuration name}. There are two predefined configurations available (the prefix |/pgfplots/layers/| is optional):
+
+ \begin{pgfplotskey}{layers/standard}
+ A layer configuration which defines the layers \texttt{axis background}, \texttt{axis grid}, \texttt{axis ticks}, \texttt{axis lines}, \texttt{axis tick labels}, \texttt{main}, \texttt{axis descriptions}, \texttt{axis foreground}. They are drawn in the order of appearance.
+ \end{pgfplotskey}
+
+ \begin{pgfplotskey}{layers/axis on top}
+ A layer configuration which uses the same layer names as |layers/standard|, but with a different sequence: \texttt{axis background}, \texttt{main}, \texttt{axis grid}, \texttt{axis ticks}, \texttt{axis lines}, \texttt{axis tick labels}, \texttt{axis descriptions}, \texttt{axis foreground}.
+
+ This layer is automatically used if the key |axis on top| is used together with |set layers=|\meta{any layer configuration name}.
+ \end{pgfplotskey}
+
+ As soon as the key |set layers=|\meta{layer configuration name} is encountered, \PGFPlots\ starts the \pgfname\ command |\pgfsetlayers|\marg{layer names} with the layer names of the respective configuration. Usually, this \emph{replaces} the current layer configuration of the embedding |tikzpicture|. Furthermore, |set layers| stores the name of \meta{layer configuration name} such that every following |axis| knows how to map graphical elements to layer names.
+
+
+ The fact that layer configurations are properties of a complete |tikzpicture| (whereas an axis is only one of multiple graphical elements of that picture), they need to be given at one of several supported positions:
+ \begin{enumerate}
+ \item Directly within the picture:
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ \pgfplotsset{set layers=default}
+ \begin{axis}
+ ...
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent This option explicitly tells the reader of your source code that a significant portion of your picture has been changed: the complete picture has and uses a \meta{layer configuration name} (in this case |default|).
+
+ \item As option for one or more axes which is/are directly within the picture:
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ \begin{axis}[set layers]
+ ...
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ Here, \PGFPlots\ implicitly communicates its layer configuration to the enclosing |tikzpicture|. Thus, the effect of |set layers| is \emph{not local to an axis}; it survives until |\end{tikzpicture}|. Any other option only survives until |\end{axis}|.
+
+ In this case, only the \emph{last} activated layer configuration will apply to the picture.
+
+ \paragraph{Limitation: no environments or local \TeX\ groups allowed.} Standard usages as within the examples of this manual will always work. But since the layer name configuration is essentially part of a \PGF\ picture (at a low level), one cannot arbitrarily set them; \PGF\ will complain if they are changed within some nested \TeX\ groups or \LaTeX\ environments. Typically, you will never need to worry about this.
+
+ In short, the following examples are \emph{forbidden} because the axis is within locally nested groups.
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ {% FORBIDDEN! Consider using case (1) above!
+ \begin{axis}[set layers]
+ ...
+ \end{axis}
+ }
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[code only]
+\begin{tikzpicture}
+ \begin{scope} % FORBIDDEN! Consider using case (1) above!
+ \begin{axis}[set layers]
+ ...
+ \end{axis}
+ \end{scope}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent These examples are forbidden because the layer configuration will be cleared by the `|}|' of the first forbidden example and by the `|\end{scope}|' of the second example. A solution would be one of the different placement options (i.e. choice (1.) or (3.)).
+
+ \item outside of any picture:
+\begin{codeexample}[code only]
+\pgfplotsset{set layers=default}
+\begin{tikzpicture}
+ \begin{axis}
+ ...
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent This choice configures the layer configuration for \emph{every} following |tikzpicture|.
+
+ \end{enumerate}
+
+
+ \paragraph{Limitation: axis alignment restricted to inner anchors.} This applies only if you changed the default value of |anchor| (which is |anchor=south west|).
+ Any axis which uses layered graphics should use one of the following values of |anchor|: |north|, |north west|, |west|, |south west|, |south|, |south east|, |east|, |north east|, |north|, |center|, |origin|, |above origin|, |left of origin|, |right of origin|, |below origin|. In case you really need another anchor, \PGFPlots\ requires the use of |cell picture=true|, causing the layers to be local for that specific axis.
+
+ The technical background for this limitation is a hen-and-egg problem: outer anchors (like |outer south west|) are only available \emph{after} the complete axis has been generated -- and layers can only be drawn after each drawing instruction has been issued. The technical keys for further reading are |cell picture=false| or |cell picture=if necessary| (one of them is active for layered graphics).
+\end{pgfplotskey}
+
+\begin{command}{\pgfplotssetlayers}
+ An alias for |\pgfplotsset{set layers}|. It activates the |layers/default| layer configuration.
+
+\end{command}
+\begin{command}{\pgfplotssetlayers\marg{layer configuration name}}
+ An alias for |\pgfplotsset{set layers=|\marg{layer configuration name}|}|.
+\end{command}
+
+\begin{handler}{{.define layer set}=\marg{ordered layer names}\marg{style definitions}}
+ Allows to define a new layer set configuration named \meta{key}. Afterwards, \meta{key} is a valid argument for |set layers=|\meta{key}.
+
+ The first argument \meta{ordered layer names} is a comma-separated list of layer names. The names are arbitrary, and |\pgfdeclarelayer| will be called for every encountered argument\footnote{To be more precise: \texttt{set layers} calls \texttt{\textbackslash pgfdeclarelayer} when it uses \meta{ordered layer names}.}. There is just one ``magic'' name: the layer |main| should be part of every \meta{ordered layer names} as it will contain every graphical element which is not associated with a specific layer.
+
+ The second argument \meta{style definitions} contains options -- just as if you would have written \meta{key}|/.style=|\marg{style definitions}. The \meta{style definitions} are supposed to contain \PGFPlots\ style redefinitions which make use of each encountered element of \meta{ordered layer names}. This is probably best explained by an example: the |layers/standard| layer configuration is defined by
+\begin{codeexample}[code only]
+\pgfplotsset{
+ layers/standard/.define layer set=
+ {axis background,axis grid,axis ticks,axis lines,axis tick labels,main,%
+ axis descriptions,axis foreground}
+ {
+ grid style= {/pgfplots/on layer=axis grid},
+ tick style= {/pgfplots/on layer=axis ticks},
+ axis line style= {/pgfplots/on layer=axis lines},
+ label style= {/pgfplots/on layer=axis descriptions},
+ legend style= {/pgfplots/on layer=axis descriptions},
+ title style= {/pgfplots/on layer=axis descriptions},
+ colorbar style= {/pgfplots/on layer=axis descriptions},
+ ticklabel style= {/pgfplots/on layer=axis tick labels},
+ axis background@ style={/pgfplots/on layer=axis background},
+ 3d box foreground style={/pgfplots/on layer=axis foreground},
+ },
+}
+\end{codeexample}
+ \noindent This definition declares a couple of layers, and it adjusts \PGFPlots\ styles by adding |on layer| commands. The arguments for |on layer| are the elements of \meta{ordered layer names}.
+
+ Note that if you have an element in \meta{ordered layer names} which is never referenced inside of \meta{style definitions}, this layer will always be empty. In other words: the \emph{only} reference to the names in \meta{ordered layer names} is \meta{style definitions}, \PGFPlots\ has no hard-coded magic layer names (except for |main| as explained above).
+
+ Since the second argument \meta{style definitions} defines \meta{key} to be a normal style key, one can simply use \meta{key} in order to set \meta{style definitions}. This allows to inherit them. For example, the |layers/axis on top| layer configuration is defined by means of
+\begin{codeexample}[code only]
+\pgfplotsset{
+ /pgfplots/layers/axis on top/.define layer set=
+ {axis background,main,axis grid,axis ticks,axis lines,axis tick labels,%
+ axis descriptions,axis foreground}
+ {/pgfplots/layers/standard}
+}
+\end{codeexample}
+ \noindent i.e.\ it only redefines the \emph{sequence} of the layers and re-uses the style definitions of |layers/standard|.
+
+ Any number of layer configurations can be defined.
+\end{handler}
+
+
+\subsubsection{Changing the Layer of Graphical Elements}
+There are a couple of keys which change the layer of a graphical element.
+
+\begin{pgfplotskey}{on layer=\marg{layer name}}
+ Providing this key somewhere in a \PGFPlots\ style or inside of a \PGFPlots\ axis will change the layer for all graphical elements for which the style applies.
+
+ For example,
+\begin{codeexample}[code only]
+...
+\begin{axis}[set layers,grid style={/pgfplots/on layer=axis foreground}]
+...
+\end{codeexample}
+ \noindent will change the layer for any grid lines to |axis foreground|.
+
+ The argument \meta{layer name} is expected to be part of the current layer configuration, i.e.\ the argument of |set layers| should contain it.
+
+ Note that if you have two \emph{plots} with different values of |on layer|, you may also want to enable |clip mode=clip individual| or to deactivate clipping altogether using |clip=false|. Clipping options need to be provided as option to the axis, not to the plot. The technical background is that clip paths needs to be replicated for the layer on which the drawing is supposed to happen -- otherwise they will be applied to the wrong layer.
+\end{pgfplotskey}
+
+\begin{pgfplotskey}{mark layer=\mchoice{auto,like plot,\meta{layer name}} (initially auto)}
+ An advanced key which defines the layer for plot |mark|s. It is typically the best choice to leave it at |auto|.
+
+ If you write |\addplot[on layer=|\meta{layer name}|]|, the
+ layer will be used for the complete plot. Plot marks are treated with special care, so you can define an own layer for plot marks.
+
+ The initial choice \declaretext{auto} will automatically define a ``suitable'' choice, leaving the responsability with \PGFPlots. Here, ``suitable'' means to respect |clip mode| and |clip marker paths| in a way such that plot marks will not be clipped even though the default layer for your plot will be clipped.
+
+ The choice \declaretext{like plot} will pack the marks onto the same layer as the plot they belong to. This might cause clipped markers, i.e.\ markers which are only displayed partially if they are close to the boundary of the axis.
+
+ Finally, one can provide any \meta{layer name}, just as for |on layer| -- but the layer can be different from the layer used for the plot.
+\end{pgfplotskey}
+
+}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.linefitting.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.linefitting.tex
index 1264ce8fc62..a0f81128a19 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.linefitting.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.linefitting.tex
@@ -52,6 +52,8 @@ This section documents the attempts of \PGFPlots\ to fit lines to input coordina
The example above has two plots: one showing the data and one containing the |linear regression| line. We use |y={create col/linear regression={}}| here, which means to create a new column\footnote{The \texttt{y=\{create col/} feature is available for any other \PGFPlotstable\ postprocessing style, see the \texttt{create on use} documentation in the \PGFPlotstable\ manual.} containing the regression values automatically.
As arguments, we need to provide the $y$ column name explicitly\footnote{In fact, \PGFPlots\ sees that there are only two columns and uses the second by default. But you need to provide it if there are at least 3 columns.}. The $x$ value is determined from context: |linear regression| is evaluated inside of |\addplot table|, so it uses the same $x$ as |\addplot table| (i.e.\ if you write |\addplot table[x=|\marg{col name}|]|, the regression will also use \meta{col name} as its |x| input). Furthermore, it shows the line parameters $a$ and $b$ in the legend.
+ Note that the uncommented line with |\xdef\slope{\pgfplotstableregressiona}| is useful if you have \emph{more than one} regression line: it copies the value of |\pgfplotstableregressiona| (in this case) into a new global variable called `|\slope|'. This allows to use `|\slope|' instead of |\pgfplotstableregressiona| -- even after |\pgfplotstableregressiona| has been overwritten.
+
The following \meta{key-value-config} keys are accepted as comma--separated list:
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.markers-meta.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.markers-meta.tex
index a2cf31dec0e..a587e61b55f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.markers-meta.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.markers-meta.tex
@@ -150,6 +150,31 @@ Note that each of the provided marks can be rotated freely by means of |mark opt
\begin{key}{/tikz/mark repeat=\marg{integer} (initially empty)}
Allows to draw only each $n$th |mark| where $n$ is provided as \meta{integer}.
\end{key}
+
+\begin{key}{/tikz/mark phase=\marg{integer $p$} (initially 1)}
+ This option allows to control which markers are drawn. It is primarily used together with the \Tikz\ option |mark repeat=|$r$: it tells \tikzname\ that the first mark to be draw should be the $p$th, followed by the $(p + r)$th, then
+ the $(p + 2r)$th, and so on.
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[tiny]
+ \addplot+[scatter] {sin(deg(x))};
+ \end{axis}
+\end{tikzpicture}
+\begin{tikzpicture}
+ \begin{axis}[tiny]
+ \addplot+[scatter,
+ mark repeat=3,mark phase=2]
+ {sin(deg(x))};
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ Here, $p=1$ is the first point (the one with |\coordindex|$=0$).
+\end{key}
+
+\begin{key}{/tikz/mark indices=\marg{index list} (initially empty)}
+ Allows to draw only the marker whose index numbers are in the argument list.
+\end{key}
+
\begin{key}{/pgf/mark color=\marg{color} (initially empty)}
Defines the \emph{additional} fill color for the |halfcircle|, |halfcircle*|, |halfdiamond*| and |halfsquare*| markers. An empty value uses |white| (which is the initial configuration). The value |none| disables filling for this part.
@@ -761,7 +786,7 @@ Available color maps are shown below.
\end{codeexample}
The usage of the result \meta{\textbackslash macro} is a little bit low--level.
- \paragraph{Attention:} \PGF\ shadings are always represented with respect to the RGB color space. Consequently, even CMYK \meta{colormap name}s will result in an RGB shading specification when using this method\footnote{In case \PGF\ should someday support CMYK shadings and you still see this remark, you can define \texttt{\textbackslash def\textbackslash pgfplotscolormaptoshadingspectorgb\{0\}}.}.
+ \paragraph{Attention:} \PGF\ shadings are always represented with respect to the RGB color space. Consequently, even CMYK \meta{colormap name}s will result in an RGB shading specification when using this method\footnote{In case \PGF\ should someday support CMYK shadings and you still see this remark, you can add the macro definition \texttt{\textbackslash def\textbackslash pgfplotscolormaptoshadingspectorgb\{0\}} to your preamble.}.
\end{command}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.miscellaneous.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.miscellaneous.tex
index 6ce239cd815..c7c6b01f607 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.miscellaneous.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.miscellaneous.tex
@@ -50,7 +50,7 @@ This axis option allows to invoke \meta{commands} after each |\addplot| command.
Allows to add customized code which is executed at the beginning of each plot visualization. In contrast to |execute at begin plot|, this happens not immediately during |\addplot|, but late during the postprocessing of |\end{axis}| when actual drawing commands are generated.
One possible application is shown below: suppose you want to use |\usepackage{ocg}| in order to switch layers dynamically, for example in a beamer package. This can be implemented as follows:
-% \usepackage[pdftex]{ocg}
+% \usepackage[pdftex]{pgfplots_ocg_copy}
\begin{codeexample}[]
% requires \usepackage[pdftex]{ocg}
\begin{tikzpicture}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.numberformatting.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.numberformatting.tex
index 640b162ef18..e92e1b133be 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.numberformatting.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.numberformatting.tex
@@ -72,8 +72,10 @@ This section provides a brief survey about the most frequently used aspects of n
\end{codeexample}
\begin{codeexample}[]
-\pgfmathprintnumber
- [1000 sep={\,},fixed,precision=6,1000 sep in fractionals]{1000000.123456}
+\pgfmathprintnumber[
+ 1000 sep={\,},fixed,precision=6,
+ 1000 sep in fractionals]
+ {1000000.123456}
\end{codeexample}
\noindent Each of these keys requires the prefix `|/pgf/number format/|' when used inside of a \PGFPlots\ style (try |/pgf/number format/.cd,|\meta{number formatting keys} to use the same prefix for many \meta{number formatting keys}).
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.preliminaryoptions.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.preliminaryoptions.tex
index a1f759a732b..7a11b05981f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.preliminaryoptions.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.preliminaryoptions.tex
@@ -14,7 +14,7 @@ A key usually has a value (like a number, a string, or perhaps some macro code).
\end{codeexample}
\noindent which changes them for the complete axis. A |key| in this context can be any option defined in this manual, no matter if it has the |/pgfplots/| or the |/tikz/| key prefix. Note that key prefixes can be omitted in almost all cases.
-A value can usually be provided without curly braces. For example, if the manual contains somethig like `|xmin=|\marg{$x$ coordinate}', you can safely skip the curly braces. The curly braces are mandatory if values contain something which would otherwise confuse the key setup (for example an equal sign `|=|' or a comma `|,|').
+A value can usually be provided without curly braces. For example, if the manual contains something like `|xmin=|\marg{$x$ coordinate}', you can safely skip the curly braces. The curly braces are mandatory if values contain something which would otherwise confuse the key setup (for example an equal sign `|=|' or a comma `|,|').
Some keys can be changed individually for each plot:
\begin{codeexample}[code only]
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.scaling.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.scaling.tex
index c5c8537a8d5..8b6f77d101f 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.scaling.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.scaling.tex
@@ -1,59 +1,94 @@
\subsection{Scaling Options}
+There are a various options which control or change the scaling of an axis. Here, ``scaling'' typically means two aspects: first, the unit vector size in each direction and second, the displayed limits in each direction. Both together control the size of the axis box. In addition, axis descriptions change the size. However, \PGFPlots\ scales only units and determines limits. It does not scale axis descriptions by default in order to keep consistent font sizes between the text and the figure.
-\begin{pgfplotskey}{width=\marg{dimen}}
-Sets the width of the final picture to \marg{dimen}. If no |height| is specified, scaling will respect aspect ratios.
+Often, one wishes to provide the target size only and let \PGFPlots\ do the rest. This is the default; it scales the axis to |width| and |height|. If you provide one of these options, the axis will be rescaled while keeping the aspect ratio.
-\paragraph{Remarks:}
-\begin{itemize}
- \item The scaling only affects the width of one unit in $x$-direction or the height for one unit in $y$-direction. Axis labels and tick labels won't be resized, but their size is used to determine the axis scaling.
+Occasionally, one wants to provide unit vectors explicitly to ensure that one unit takes a prescribed amount of space. This is possible by means of the |x|, |y|, and |z| keys. In such a case, the |width| and |height| options will be ignored (or only applied for the unspecified unit vectors).
- \item You can use the |scale=|\marg{number} option,
-\begin{codeexample}[code only]
-\begin{tikzpicture}[scale=2]
-\begin{axis}
-...
+Another common approach is to enforce specific |unit vector ratio|s: for example by specifying that each unit should take the same amount of space using |axis equal|. Here, \PGFPlots\ scales the lengths of all vectors uniformly, i.e.\ it applies the same scale to each vector. This is done by means of the |scale mode| configuration which is basically one of |scale mode=stretch to fill| or |scale mode=scale uniformly|: \PGFPlots\ tries to satisfy the prescribed |width| and |height| arguments by finding a \emph{common} scaling factor. In addition, it attempts to enlarge the limits individually to fit into the prescribed dimensions.
+
+In addition, you can use the option |/pgfplots/scale| to simply scale all final units up by some prescribed factor. This does not change text labels.
+
+If needed, you can also supply |/tikz/scale| to an axis. This will scale the complete resulting image, including all text labels.
+
+\subsubsection{Common Scaling Options}
+All common options mentioned in the previous paragraphs are described here.
+
+\begin{pgfplotskey}{width=\marg{dimen} (initially empty)}
+Sets the width of the final picture to \marg{dimen}.
+
+Any non-empty dimension like |width=5cm| sets the desired target width. Any \TeX\ unit is accepted (like |200pt| or |5in|).
+
+An empty value |width={}| means ``use default width or rescale proportionally to |height|''. In this case, \PGFPlots\ uses the value of |\axisdefaultwidth| as target quantity. However, if the |height| key has been set, \PGFPlots\ will rescale the |\axisdefaultwidth| in a way which keeps the ratio between |\axisdefaultwidth| and |\axisdefaultheight|. This allows to specify just one of |width| and |height| and keep aspect ratios.
+
+Consequently, if you specify just |width=5cm| but leave the default |height={}|, the scaling will respect the initial aspect ratio.
+
+The scaling affects the unit vectors for $x$, $y$, and $z$. It does not change the size of text labels or axis descriptions.
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[width=5cm]
+ \addplot {x};
\end{axis}
\end{tikzpicture}
\end{codeexample}
- to scale the complete picture.
- \item The \Tikz-options |x| and |y| which set the unit dimensions in $x$ and $y$ directions can be specified as arguments to |\begin{axis}[x=1.5cm,y=2cm]| if needed (see below). These settings override the |width| and |height| options.
+Please note that \PGFPlots\ only estimates the size needed for axis- and tick labels. The estimate assumes a fixed amount of space for anything which is outside of the axis box. This has the effect that the final images may be slightly larger or slightly smaller than the prescribed dimensions. However, the fixed amount is always the same; it is set to~|45pt|. That means that multiple pictures with the same target dimensions will have the same size for their axis boxes -- even if the size for descriptions varies.
- \item You can also force a fixed width/height of the axis (without looking at labels) with
-\begin{codeexample}[code only]
+It is also possible to scale the \emph{axis box} to the prescribed width/height. In that case, the total width will be larger due to the axis descriptions. However, the axis box fills the desired dimensions exactly.
+\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[width=5cm,scale only axis]
- ...
+ \addplot {x};
\end{axis}
\end{tikzpicture}
\end{codeexample}
- \item Please note that up to the writing of this manual, \PGFPlots\ only estimates the size needed for axis- and tick labels. It does not include legends which have been placed outside of the axis\footnote{I.e. the `\texttt{width}' option will not work as expected, but the bounding box is still ok.}. This may be fixed in future versions.
+ \paragraph{Note:} changing |width| and/or |height| changes \emph{only} the unit vector sizes. In particular, it does not change the font size for any axis description, nor does it change the default spacing between adjacent tick labels. It is best-practice to use |width|/|height| for ``small'' changes, i.e.\ changes for which the font size should remain the same. Consider using one of the styles |normalsize|, |small|, |footnotesize|, or |tiny| which are described in Section~\ref{sec:scaling:styles} on page~\pageref{sec:scaling:styles}, and \emph{then} change to your desired dimensions if you need a different ``quality'' of scaling.
+
+ \begin{command}{\axisdefaultwidth}
+ This macro defines the default width. It is preset to |240pt|.
- Use the |x=|\marg{dimension}, |y=|\marg{dimension} and |scale only axis| options if the scaling happens to be wrong.
-\end{itemize}
+ This default width defines the aspect ratio which will be used whenever just one of |width| or |height| is specified: the aspect ratio is the ratio between |\axisdefaultwidth| and |\axisdefaultheight|.
+
+ You can change it using
+\begin{codeexample}[code only]
+\def\axisdefaultwidth{10cm}
+\end{codeexample}
+ \end{command}
\end{pgfplotskey}
-\begin{pgfplotskey}{height=\marg{dimen}}
- See |width|.
+\begin{pgfplotskey}{height=\marg{dimen} (initially empty)}
+ Works in the same way as |width| except that an empty value |height={}| defaults to ``use either |\axisdefaultheight| or scale proportionally if just |width| has been changed''.
+
+ \begin{command}{\axisdefaultheight}
+ This macro defines the default height. It is preset to |207pt|.
+
+ See |\axisdefaultwidth|.
+ \end{command}
\end{pgfplotskey}
\begin{pgfplotskey}{scale only axis=\mchoice{true,false} (initially false)}
-If |scale only axis| is enabled, label, tick and legend dimensions won't influence the size of the axis rectangle, that means |width| and |height| apply only to the axis rectangle.
+If |scale only axis| is enabled, |width| and |height| apply only to the axis rectangle. Consequently, the resulting figure is larger that |width| and |height| (because of any axis descriptions). However, the axis box has exactly the prescribed target dimensions.
If |scale only axis=false| (the default), \PGFPlots\ will try to produce the desired width \emph{including} labels, titles and ticks.
\end{pgfplotskey}
\begin{pgfplotsxykeylist}{
- \x=\marg{dimen},
+ \x=\marg{dimen} (initially empty),
\x={\{(\meta{x},\meta{y})\}}}
-Sets the unit vectors for $x$ (or $y$). Every logical plot coordinate $(x,y)$ is drawn at the position
+Allows to provide zero, one, two, or three of the target unit vectors.
+
+In this context, a ``unit vector'' is a two--dimensional vector which defines the projection onto the canvas:
+every logical plot coordinate $(x,y)$ is drawn at the canvas position
\[ x \cdot \begin{bmatrix} e_{xx} \\ e_{xy} \end{bmatrix} + y \cdot \begin{bmatrix} e_{yx} \\ e_{yy} \end{bmatrix}. \]
The unit vectors $e_x$ and $e_y$ determine the paper position in the current (always two dimensional) image.
+For a standard three--dimensional axis, a plot coordinate $(x,y,z)$ is drawn at
+\[ x \cdot \begin{bmatrix} e_{xx} \\ e_{xy} \end{bmatrix} + y \cdot \begin{bmatrix} e_{yx} \\ e_{yy} \end{bmatrix} + z \cdot \begin{bmatrix} e_{zx} \\ e_{zy} \end{bmatrix}. \]
-The key |x=|\marg{dimen} simply sets $e_x = (\meta{dimen},0)^T $ while |y=|\marg{dimen} sets $e_y = (0,\meta{dimen})^T$.
-Here, \marg{dimen} is any \TeX\ size like |1mm|, |2cm| or |5pt|. Note that you should not use negative values for \meta{dimen} (consider using |x dir| and its variants to reverse axis directions).
+The initial setting assigns empty values to each of these keys, i.e. |x={},y={},z={}|. In this case, \PGFPlots\ is free to choose these vectors as best. To this end, it uses |width|, |height|, |scale mode|, |plot box ratio|, |unit vector ratio|, |view|, and the axis limits.
+
+The key |x=|\marg{dimen} simply sets $e_x = (\meta{dimen},0)^T $ while |y=|\marg{dimen} sets $e_y = (0,\meta{dimen})^T$. Using |z=|\marg{dimen} results in $e_z = (\meta{dimen},\meta{dimen})^T$. In this context, \meta{dimen} is any \TeX\ size like |1mm|, |2cm| or |5pt|. Note that you should not use negative values for \meta{dimen} (consider using |x dir| and its variants to reverse axis directions).
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[x=1cm,y=1cm]
@@ -70,7 +105,17 @@ Here, \marg{dimen} is any \TeX\ size like |1mm|, |2cm| or |5pt|. Note that you s
\end{tikzpicture}
\end{codeexample}
-The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})^T$ explicitly\footnote{Please note that you need extra curly braces around the vector. Otherwise, the comma will be interpreted as separator for the next key-value pair.}; the corresponding |y| key works similarly. This allows to define skewed or rotated axes.
+Note that if you change the unit vector for just one direction, the other vector(s) will be chosen by \PGFPlots\ -- and scaled in order to fill the prescribed |width| and |height| as best as \PGFPlots\ can (but see remarks for three--dimensional plots at the end of this key).
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[x=1cm,
+ title=Height is deduced from height option]
+\addplot expression[domain=0:3] {2*x};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})^T$ explicitly\footnote{Please note that you need extra curly braces around the vector. Otherwise, the comma will be interpreted as separator for the next key-value pair.}. The corresponding keys for |y| and |z| work in a similar way. This allows to define skewed or rotated axes.
\begin{codeexample}[]
\begin{tikzpicture}
@@ -90,9 +135,8 @@ The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})
\end{tikzpicture}
\end{codeexample}
- Setting $x$ explicitly overrides the |width| option. Setting $y$ explicitly overrides the |height| option.
- Setting |x| and/or |y| for logarithmic axis will set the dimension used for $1 \cdot e \approx 2.71828$.
+ Setting |x| and/or |y| for logarithmic axis will set the dimension used for $1 \cdot e \approx 2.71828$ (or whatever has been set as |log basis x|).
Please note that it is \emph{not} possible to specify |x| as argument to |tikzpicture|. The option
\begin{codeexample}[code only]
@@ -102,13 +146,15 @@ The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})
\end{axis}
\end{tikzpicture}
\end{codeexample}
- won't have any effect because an axis rescales its coordinates (see the |width| option).
+ does not have any effect because an axis rescales its coordinates (see the |width| option).
+ Note that providing unit vectors explicitly usually causes \PGFPlots\ to ignore any other scaling options. In other words: if you say |y=0.1cm|, \PGFPlots\ will use $(0\text{cm},0.1\text{cm})$ as $y$ projection vector. However, if you add |scale mode=scale uniformly|, you allow \PGFPlots\ to change the \emph{lengths} of your vectors. Of course, it will keep their relative directions and relative sizes. In this case, \PGFPlots\ will try to determine a good common scaling factor \emph{and} it will try to change the axis limits in order to fill the prescribed |width| and |height| (see the documentation for |scale mode| for details).
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[
- x={(1cm,-0.5cm)},
- y=1cm,
+ title=Allow to rescale \emph{lengths},
+ x={(0.1cm,-0.05cm)},
+ y=0.1cm,
z=0cm,
axis on top,
scale mode=scale uniformly,
@@ -117,6 +163,9 @@ The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})
\end{axis}
\end{tikzpicture}
\end{codeexample}
+ \noindent In the example above, \PGFPlots\ decided that it should only rescale units -- at the expensive of the |width| constraint.
+
+\paragraph{Changes to font sizes:} see also Section~\ref{sec:scaling:styles} if you want to change font sizes or the density of tick labels in a simple way.
\paragraph{Explicit units for 3D axes:} As of version~1.5, it is also possible to supply unit vectors to three-dimensional axes. In this case, the following extra assumptions need to be satisfied:
\begin{enumerate}
@@ -125,28 +174,15 @@ The second syntax, |x={(|\meta{x}|,|\meta{y}|)}| sets $e_x = (\meta{x},\meta{y})
Consider using |x dir=reverse| or its variants in case you want to reverse directions.
- \item For three-dimensional axes, \PGFPlots\ computes a view direction out of the provided unit vectors. The view direction is required to realize the |z buffer| feature (i.e.\ to decide about depths)\footnote{\PGFPlots\ provides a debug option called \texttt{view dir=\marg{x}\marg{y}\marg{z}} to override the view direction, should that ever be interesting.}.
+ \item For three-dimensional axes, \PGFPlots\ computes a view direction out of the provided unit vectors. The view direction is required to allow the |z buffer| feature (i.e.\ to decide about depths)\footnote{\PGFPlots\ provides a debug option called \texttt{view dir=\marg{x}\marg{y}\marg{z}} to override the view direction, should that ever be interesting.}.
\end{enumerate}
-This feature is used to realize the \verbpdfref{\addplot3 graphics} feature, compare the examples in Section~\ref{sec:plotgraphics3d} on page~\pageref{sec:plotgraphics3d}.
+This feature is used to for the \verbpdfref{\addplot3 graphics} feature, compare the examples in Section~\ref{sec:plotgraphics3d} on page~\pageref{sec:plotgraphics3d}.
\paragraph{Limitations:} Unfortunately, skewed axes are \textbf{not available for bar plots}.
\index{Errors!Skewed axes and bar plots}%
\index{Bar Plots!Skewed axes problems}%
\end{pgfplotsxykeylist}
-\begin{pgfplotskey}{scale mode=\mchoice{auto,none,stretch to fill,scale uniformly} (initially auto)}
- Specifies how |width|, |height|, and the three unit vector keys |x|, |y|, and |z| are combined to produce the final image.
-
- The initial choice \declaretext{auto} chooses one of the other possible choices depending on the actual context. More precisely, it is the same as |none| if at least one of |x|, |y|, or |z| is provided (meaning that these keys are the final unit size). If no unit is provided, it defaults to |stretch to fill|.
-
- The choice |none| does not apply any rescaling at all. Use this if prescribed lengths of |x|, |y| (and perhaps |z|) should be used. In other words: it ignores |width| and |height|. In this case, you may want to set |x post scale| and its variants to rescale units manually.
-
- The choice |stretch to fill| takes |x|, |y|, and |z| as they have been found (either from user input or from some automatic processing) and rescales the axis with two \emph{separate} scales: one which results in the proper |width| and one which results in the proper |height|. As a consequence, the unit vectors are modified and distorted such that the final image fits into the prescribed dimensions. This is usually what one expects unless one provides unit directions explicitly.
-
- The choice |scale uniformly| is similar -- but it applies only \emph{one} scaling factor to fit into the prescribed dimensions. This scaling factor will be the same for both, |width| and |height|. Naturally, this will result in unsatisfactory results because either the final width or the final height will not be met. Therefore, this choice will enlarge or shrink limits to get the desired dimensions. Thus, the unit vectors have exactly the same size \emph{relations and angles} as they had before the scaling; only their magnitude is changed uniformly. But due to the given constraints, parts of the image may be empty or may no longer be visible. In case the outcome needs manual improvements, you can improve the visibility by modifying |width| and/or |height| (more freedom is not supported for this choice). Note that \PGFPlots\ implements this rescaling \textbf{if and only if} $e_{yx} = 0$ (for two--dimensional axes) or $e_{zx} = 0$ (for three-dimensional axes). In other words: for two--dimensional axes, the |y| vector has to be parallel to the canvas $y$ direction and for three-dimensional axes, the same holds for the |z| vector. The idea is to rescale only the vertical part of one unit vector and to change the limits of that respective axis simultaneously. The |scale uniformly| choice is used to realize the \verbpdfref{\addplot3 graphics} feature, see the documentation in Section~\ref{sec:plotgraphics3d} on page~\pageref{sec:plotgraphics3d} for its examples.
-
-\end{pgfplotskey}
-
\begin{pgfplotsxykey}{\x mode=\mchoice{normal,linear,log} (initially normal)}
Allows to choose between linear (=normal) or logarithmic axis scaling or logplots for each $x,y,z$-combination.
@@ -194,6 +230,15 @@ This feature is used to realize the \verbpdfref{\addplot3 graphics} feature, com
\end{tikzpicture}
\end{codeexample}
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[axis equal,small,view={45}{35.26}]
+\addplot3[mark=cube, blue, mark size=1cm]
+ coordinates {(0,0,0)};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
The configuration |axis equal=true| is actually just a style which sets |unit vector ratio=1 1 1,unit rescale keep size=true|.
\end{pgfplotskey}
@@ -252,53 +297,79 @@ This feature is used to realize the \verbpdfref{\addplot3 graphics} feature, com
Trailing values of |1| can be omitted, i.e.\ |unit vector ratio=2 1| is the same as |unit vector ratio=2|; and |unit vector ratio=3 2 1| is the same as |unit vector ratio=3 2|.
An empty value |unit vector ratio={}| disables unit vector rescaling.
+ Note that an active |unit vector ratio| will implicitly set |scale mode=scale uniformly|\footnote{This has been introduced in version 1.6. For older versions, the axis equal feature produced wrong results for three--dimensional axes.}.
+
\begin{pgfplotskeylist}{%
unit vector ratio*=\marg{rx ry rz},
- unit rescale keep size=\marg{true,false} (initially true)}
+ unit rescale keep size=\mchoice{true,false,unless limits declared} (initially unless limits declared)}
In the default configuration, \PGFPlots\ maintains the original axis dimensions even though |unit vector ratio| involves different scalings.
+ \label{key:unit:rescale:keep:size}
It does so by enlarging the limits.
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,unit vector ratio=]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,unit vector ratio=1 1 1]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,unit vector ratio=0.25 0.5]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\end{codeexample}
\noindent The example above has the same plot, with three different unit ratios. The first has no limitations (it is the default configuration). The second uses the same length for each unit vector and enlarges the limits in order to maintain the same dimensions. The third example has an $x$ unit which is $\nicefrac14$ the length of a $z$ unit, and an $y$~unit which is $\nicefrac12$ the length of a $z$~unit.
+ \PGFPlots\ does its best to respect the involved scaling options (the prescribed |width| and |height|, the |unit vector ratio|, and any specified axis limits). In the case above, it enlarged the horizontal limits and kept the $z$~limit as-is. See |scale mode| and its documentation for details about the involved algorithm and its parameters.
+
The |unit rescale keep size=false| key, or, equivalently, |unit vector ratio*=...|, does not enlarge limits:
\begin{codeexample}[]
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,unit vector ratio=]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,
unit rescale keep size=false,
unit vector ratio=1 1 1]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[footnotesize,xlabel=$x$,ylabel=$y$,
unit vector ratio*=0.25 0.5, % the '*' implies 'unit rescale keep size=false'
]
- \addplot3[surf,samples=10,domain=0:1] {(1-x)*y};
+ \addplot3[surf,z buffer=sort,samples=15,
+ variable=\u, variable y=\v,
+ domain=0:180, y domain=0:360]
+ ({cos(u)*sin(v)}, {sin(u)*sin(v)}, {cos(v)});
\end{axis}
\end{tikzpicture}
\end{codeexample}
+ The key |unit rescale keep size| also affects |scale mode=scale uniformly| (which is closely related to |axis equal|).
+
+ Here is the reference of the value of |unit rescale keep size|: the value \declaretext{true} means that \PGFPlots\ will enlarge limits in order to keep the size. It will try to respect user provided limits, but if the user provided \emph{all} limits, it will \emph{override} the user-provided limits and will rescale them. Thus, |true| gives higher priority to the axis size than to user-provided limits. The choice \declaretext{false} will never rescale axis limits. The choice \declaretext{unless limits declared} is a mixture: it will enlarge limits unless the user provided them. If the user provides all limits explicitly, this choice is the same as |false|.
\end{pgfplotskeylist}
\end{pgfplotskey}
@@ -335,3 +406,224 @@ This feature is used to realize the \verbpdfref{\addplot3 graphics} feature, com
\end{tikzpicture}
\end{codeexample}
\end{pgfplotsxykeylist}
+
+\subsubsection{Scaling Descriptions: Predefined Styles}
+\label{sec:scaling:styles}
+It is reasonable to change font sizes, marker sizes etc. together with the overall plot size: Large plots should also have larger fonts and small plots should have small fonts and a smaller distance between ticks.
+
+\begin{keylist}{
+ /tikz/font=\mchoice{\textbackslash normalfont,\textbackslash small,\textbackslash tiny,$\dotsc$},
+ /pgfplots/max space between ticks=\marg{integer},
+ /pgfplots/try min ticks=\marg{integer},
+ /tikz/mark size=\marg{integer}}
+ These keys should be adjusted to the figure's dimensions. Use
+\begin{codeexample}[code only]
+\pgfplotsset{tick label style={font=\footnotesize},
+ label style={font=\small},
+ legend style={font=\small}
+}
+\end{codeexample}
+ to provide different fonts for different descriptions.
+
+ The keys |max space between ticks| and |try min ticks| are described on page~\pageref{maxspacebetweenticks} and configure the approximate distance and number of successive tick labels (in |pt|). Please omit the |pt| suffix here.
+\end{keylist}
+
+There are a couple of predefined scaling styles which set some of these options:
+
+\begin{stylekey}{/pgfplots/normalsize}
+ Re-initialises the standard scaling options of \PGFPlots.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[normalsize,
+ title=A ``normalsize'' figure,
+ xlabel=The $x$ axis,
+ ylabel=The $y$ axis,
+ minor tick num=1,
+ legend entries={Leg}]
+ \addplot {max(4*x,7*x)};
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+
+ The initial setting is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ normalsize/.style={
+ /pgfplots/width=240pt,
+ /pgfplots/height=207pt,
+ /pgfplots/max space between ticks=35
+ }
+}
+\end{codeexample}
+\end{stylekey}
+
+\begin{stylekey}{/pgfplots/small}
+ Redefines several keys such that the axis is ``smaller''.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[small,
+ title=A ``small'' figure,
+ xlabel=The $x$ axis,
+ ylabel=The $y$ axis,
+ minor tick num=1,
+ legend entries={Leg}]
+ \addplot {x^2};
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ The initial setting is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ small/.style={
+ width=6.5cm,
+ height=,
+ tick label style={font=\footnotesize},
+ label style={font=\small},
+ max space between ticks=25,
+ }
+}
+\end{codeexample}
+Feel free to redefine the scaling -- the option may still be useful to get more ticks without typing too much. You could, for example, set |small,width=6cm|.
+\end{stylekey}
+
+\begin{stylekey}{/pgfplots/footnotesize}
+ Redefines several keys such that the axis is even smaller. The tick labels will have |\footnotesize|.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[footnotesize,
+ title=A ``footnotesize'' figure,
+ xlabel=The $x$ axis,
+ ylabel=The $y$ axis,
+ minor tick num=1,
+ legend entries={Leg}]
+ \addplot+[const plot]
+ coordinates {
+ (0,0) (1,1) (3,3) (5,10)
+ };
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ The initial setting is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ footnotesize/.style={
+ width=5cm,
+ height=,
+ legend style={font=\footnotesize},
+ tick label style={font=\footnotesize},
+ label style={font=\small},
+ title style={font=\small},
+ every axis title shift=0pt,
+ max space between ticks=15,
+ every mark/.append style={mark size=8},
+ major tick length=0.1cm,
+ minor tick length=0.066cm,
+ },
+}
+\end{codeexample}
+As for |small|, it can be convenient to set |footnotesize| and set |width| afterwards.
+
+You will need |compat=1.3| or newer for this to work.
+\end{stylekey}
+
+\begin{stylekey}{/pgfplots/tiny}
+ Redefines several keys such that the axis is very small. Most descriptions will have |\tiny| as fontsize.
+
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[tiny,
+ title=A ``tiny'' figure,
+ xlabel=The $x$ axis,
+ ylabel=The $y$ axis,
+ minor tick num=1,
+ legend entries={Leg}]
+ \addplot+[const plot]
+ coordinates {
+ (0,0) (1,1) (3,3) (5,10)
+ };
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ The initial setting is
+\begin{codeexample}[code only]
+\pgfplotsset{
+ tiny/.style={
+ width=4cm,
+ height=,
+ legend style={font=\tiny},
+ tick label style={font=\tiny},
+ label style={font=\tiny},
+ title style={font=\footnotesize},
+ every axis title shift=0pt,
+ max space between ticks=12,
+ every mark/.append style={mark size=6},
+ major tick length=0.1cm,
+ minor tick length=0.066cm,
+ every legend image post/.append style={scale=0.8},
+ },
+}
+\end{codeexample}
+As for |small|, it can be convenient to use |tiny,width=4.5cm| to adjust the width.
+
+You will need |compat=1.3| or newer for this to work.
+\end{stylekey}
+
+
+\subsubsection{Scaling Strategies}
+ The content of this section is quite involved -- and its knowledge is typically unnecessary because by default, \PGFPlots\ controls the involved stuff automatically. You may want to skip this section.
+
+\begin{pgfplotskey}{scale mode=\mchoice{auto,none,stretch to fill,scale uniformly} (initially auto)}
+ Specifies how to choose the (individual) unit vector scaling factors, their length ratios, and perhaps the axis limits in order to fill the prescribed |width| and |height|.
+
+ The |scale mode| implementation expects some ``initial'' set of unit vectors. This initial set of unit vectors is determined as follows: for standard two--dimensional axes, it is simply the unit cube $e_x=(1\text{pt},0\text{pt})^T$, $e_y=(0\text{pt},1\text{pt})^T$, $e_z=0$. For three--dimensional axes, it is the outcome of the two keys |view| and |plot box ratio|. If you provided units explicitly by means of one of |x|, |y|, or |z|, this value is the initial unit vector.
+
+ In addition, it expects ``initial'' axis limits (i.e.\ values of |xmin|, |xmax|, etc.). The initial axis limits are those limits which have been deduced from your data or which have been provided explicitly. Furthermore, the initial axis limits already include changes of the |enlargelimits| key.
+
+ Given the initial set of unit vectors and the initial axis limits, the |scale mode| implementation is a kind of ``post--processor'' which creates modified unit vectors and modified axis limits in order to satisfy all specified constraints. These constraints are |width|, |height|, and |unit vector ratio|.
+
+ The initial choice \declaretext{auto} tells \PGFPlots\ to take full control over this key. It chooses one of the other possible choices depending on the actual context. The choice |auto| evaluates to |scale uniformly| if |unit vector ratio| is set. Otherwise it evaluates to |stretch to fill|.
+
+ The choice \declaretext{none} does not apply any rescaling at all. Use this if prescribed lengths of |x|, |y| (and perhaps |z|) should be used. In other words: it ignores |width| and |height|. In this case, you may want to set |x post scale| and its variants to rescale units manually. See also |disabledatascaling|.
+
+ The choice \declaretext{stretch to fill} takes the initial unit vectors and rescales the unit vectors with two \emph{separate} scales: one which results in the proper |width| and one which results in the proper |height|. As a consequence, the unit vectors are modified and distorted such that the final image fits into the prescribed dimensions. This is usually what one expects unless one provides unit directions explicitly. This mode does not change axis limits. Note that if one of the unit vectors has been provided explicitly, \PGFPlots\ will not change it. It will only change the remaining axis limits. This mode contradicts |axis equal| or |unit vector ratio|.
+
+ The choice \declaretext{scale uniformly} takes the initial unit vectors and applies only \emph{one} scaling factor to all units. In this case, there is just \emph{one} common scaling factor for both |width| and |height|. Naturally, this will result in unsatisfactory results because either the final width or the final height will not be met. Therefore, this choice will adjust axis limits to get the desired dimensions. Thus, the unit vectors have exactly the same size \emph{relations and angles} as they had before the scaling; only their magnitude is changed uniformly. In addition, axis limits may be changed (with individual scaling factors for each axis limit). Note that if unit vectors have been provided explicitly, \PGFPlots\ can still rescale it with this choice -- it will keep the relative directions and size ratios. The choice |scale uniformly| tries its best to modify the degrees of freedom in a ``useful'' way. The precise meaning of ``useful'' is the |scale uniformly strategy| key.
+
+ \begin{pgfplotskey}{scale uniformly strategy=\mchoice{auto,units only,change vertical limits,\\change horizontal limits} (initially auto)}
+ The |scale uniformly| method requires to determine one \emph{common} scaling factor which rescales every axis \emph{unit}. In addition, it allows one scaling factor \emph{for each axis limit}, i.e.\ up to three.
+
+ The constraints for this search are that we want to satisfy the |width|/|height| constraint, have as few rescaling as possible and that we do not want to reduce limits (as this could possibly hide data points).
+
+ The choice \declaretext{auto} chooses one of the other possibilities automatically. Depending on whether we have two dimensions or three dimensions, it compares the available methods and chooses the one which does not reduce limits and which involves the fewest rescaling (i.e.\ it may compare the outcome of the other strategies). This is the default. If you keep the choice |auto|, you do not have to worry about the remaining choices. Note that manually provided axis limits will not be modified.
+
+ The choice \declaretext{units only} will not enlarge axis limits. It will only rescale the units. To this end, it chooses the scaling factor such that the \emph{smaller} target dimension is filled as desired. In other words: if |width| $< $ |height|, it will scale to satisfy the |width| constraint. The |height| constraint will be ignored. The case $>$ will be done the other way round. The choice |units only| typically results in a square axis as it takes the initial set of unit vectors (which are typically the unit box) and scales them with a common scaling factor. Consequently, you can choose |units only| if you want a boxed axis. You can still change axis limits manually, however.
+
+ The choice \declaretext{change vertical limits} chooses a common scaling factor for the unit vectors on order to satisfy the |width| (!) constraint. This common scaling factor is similar to |units only| -- but |units only| can also decide to satisfy the |height| constraint whereas |change vertical limits| will scale unit vectors to satisfy |width|. In order to satisfy the |height| constraint, |change vertical limits| modifies just the vertical limits. For two--dimensional axes, this is |ymin| and |ymax|. For three--dimensional axes, this is |zmin| and |zmax|. Clearly, there is a chance that it will \emph{decrease} the displayed range -- in this case, parts of the image will be clipped away. This method \emph{assumes} that the vertical axis has not been rotated (i.e.\ that $e_{yx}=0$ or $e_{zx}=0$, respectively). It refuses to work and falls back to |units only| for rotates axes. Choose |change vertical limits| if you want the image (i.e.\ the actual content) as wide as possible. You can modify |width| and |height| to improve its outcome. Note that manually specified axis limits will not be changed, see below for details.
+
+ The choice \declaretext{change horizontal limits} attempts a similar approach, but for the horizontal limits: it determines one suitable scaling factor which is applied to all unit vectors and modifies horizontal axis limits to satisfy the remaining constraints. For two--dimensional axes, this is quite simple because we typically have $e_{xy} = 0$ (i.e.\ the $x$ unit vector has vanishing $y$ component) and $e_{yx}=0$ such that \PGFPlots\ can change axis limits easily. If a two--dimensional axis has an $x$ unit with $e_{xy} \neq 0$, the method is not applicable and falls back to |units only|. For three--dimensional axes, it assumes that the $z$ vector is not rotated, i.e.\ $e_{zy} = 0$ and tries to change limits for both $x$ and $y$. This choice is much more involved because here, $x$ and $y$ components are coupled. Consequently, the common unit scaling factor and the two involved axis limit compensation factors for $x$ and $y$ are tightly coupled as well. \PGFPlots\ solves a system of non--linear equations iteratively to arrive at a suitable solution for all three scalings. Use this method if |change vertical limits| would clip away parts of the image (because it reduced the displayed range) and you do not want to change |width| and |height|. The choice |change horizontal limits| will typically result in more empty space in the resulting figure. But it will not clip away content. Manually specified axis limits will not be changed, see below for details.
+
+ \end{pgfplotskey}
+
+ \paragraph{Manually provided axis limits:} Any manually provided arguments for |xmin| and its variants are considered to be immutable; \PGFPlots\ will not change them. If you assign |xmin|, \PGFPlots\ will only change |xmax| and vice--versa. If you assign both |xmin| and |xmax|, \PGFPlots\ will not change $x$~limits at all. Note that if you assign both |xmin| and |xmax|, \PGFPlots\ will simply skip the scaling and will give up on the constraints. It will not try to compensate the lack of scaling opportunities by changing $y$~limits, for example. This has the positive effect that assigning limits does not change the complete appearance of your axis. The allowed set of changes to axis limits can be configured with the following key.
+
+ \paragraph{Interaction with }|enlargelimits|: Note that |enlargelimits| and |scale mode| are independent of another: the outcome of |enlargelimits| is used as ``initial axis limits'' and these limits may be changed by |scale mode| (even if you said |enlargelimits=false|). See the documentation of |enlargelimits| for details on this interaction.
+
+ \begin{pgfplotskey}{
+ unit rescale keep size=\mchoice{true,false,unless limits declared} (initially unless limits declared)}
+ In the default configuration \declaretext{unless limits declared}, unit rescaling may cause changes to the axis limits in order to keep the figure's size intact. However, only those limits which have not been declared manually are subject to rescaling: if you say |xmin=1|, only |xmax| and the limits for $y$ and $z$ are free to change.
+
+ Setting |unit rescale keep size=|\declaretext{false} will \emph{disable} the modification of axis limits altogether, i.e.\ axis limits will not be rescaled to compensate scalings on unit vectors.
+
+ Setting |unit rescale keep size=|\declaretext{true} will always rescale limits, even if they have been declared manually.
+
+ This key mainly affects |scale mode=scale uniformly|. This, in turn, is used for |axis equal| and |\addplot3 graphics|.
+
+ See also the addition documentation for this key and related examples on page~\pageref{key:unit:rescale:keep:size}.
+ \end{pgfplotskey}
+
+ The |scale uniformly| choice is implicitly used for |axis equal| and for the \verbpdfref{\addplot3 graphics} feature, see the documentation in Section~\ref{sec:plotgraphics3d} on page~\pageref{sec:plotgraphics3d} for its examples. Note that the common case is that the initial unit vectors form the unit cube (i.e.\ those before scaling, see above). In this case, |scale uniformly| is the same as |axis equal|.
+\end{pgfplotskey}
+
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex
index 5dc32cc749d..b6da2d73a6d 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.specifyrange.tex
@@ -117,7 +117,8 @@ Axis limits can be increased automatically using the |enlargelimits| option.
This option has nothing to do with path clipping, it only affects how the axis limits are computed.
\end{pgfplotskey}
-\begin{pgfplotsxykeylist}{enlarge \x\ limits=\mchoice{auto,true,false,upper,lower,\meta{val},value=\meta{val},abs value=\meta{val},\\ abs=\meta{val},rel=\meta{val}} (initially auto),
+\begin{pgfplotsxykeylist}{%
+ enlarge \x\ limits=\mchoice{auto,true,false,upper,lower,\meta{val},value=\meta{val},abs value=\meta{val},\\ abs=\meta{val},rel=\meta{val}} (initially auto),
enlargelimits=\meta{common value}}
Enlarges the axis size for one axis (or all of them for |enlargelimits|) somewhat if enabled.
@@ -190,6 +191,7 @@ You can set |xmin|, |xmax| and |ymin|, |ymax| to the minimum/maximum values of y
\end{tikzpicture}
\end{codeexample}
+ Note that |enlargelimits| is applied before any changes to axis limits are considered as part of |scale mode|: |enlargelimits| will always be applied. Afterwards, the choice |scale mode=scale uniformly| will enlarge limits once more in order to satisfy all scaling constraints. The two limit enlargements are independent of each other, i.e.\ even if you say |enlargelimits=false|, |scale mode| will still increase axis limits if this seems to be necessary. See |scale mode| (especially |scale mode=units only|) and |unit rescale keep size| for detail on how to disable limit enlargement caused by |scale mode|.
\end{pgfplotsxykeylist}
\begin{pgfplotsxykeylist}{%
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.symbolic-transformations.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.symbolic-transformations.tex
index 5c1d36ee684..8a30dbfc371 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.symbolic-transformations.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.symbolic-transformations.tex
@@ -71,6 +71,28 @@ It is possible to provide a string dictionary to \PGFPlots. An input coordinate
The effect of the transformation is simply that input coordinates can be elements of the dictionary and tick labels will be chosen out of this dictionary as well.
+ Note that |symbolic x coords| is more-or-less equivalent to explicitly provided |xtick| positions and |xticklabels|:
+\begin{codeexample}[]
+\begin{tikzpicture}
+\begin{axis}[
+ xtick={0,1,2,...,20},
+ xticklabels={a,b,c,d,e,f,g,h,i},
+ xticklabel style={
+ anchor=base,
+ yshift=-\baselineskip
+ },
+ ]
+ \addplot+[smooth] coordinates {
+ (0,42)
+ (1,50)
+ (2,80)
+ (5,60)
+ (6,62)
+ (8,90)};
+\end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent The difference is that the approach with |symbolic x coords| is simpler to read whereas the |xtick| approach is simpler with respect to coordinate arithmetics (for example to increase limits using |enlargelimits|). The |xticklabel style| here is an attempt to align all tick labels at their base line (which would be useful for |symbolic x coords| as well as soon as labels have characters which exceed the baseline).
\paragraph{See also} the option to add tick and/or grid lines at every encountered coordinate using |xtick=data| (or |minor xtick=data|).
\end{pgfplotsxykeylist}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.technicalinternals.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.technicalinternals.tex
new file mode 100644
index 00000000000..d0300d9c559
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.technicalinternals.tex
@@ -0,0 +1,66 @@
+\subsection{Technical Internals}
+{
+\tikzset{external/figure name/.add={}{techinternals_}}%
+
+This section describes keys which are usually set by internal routines -- it is typically unnecessary to use them. However, they may impose limitations or influence performance. Such cases are documented clearly in other sections of this manual. This here is the reference on the involved internals.
+
+\begin{pgfplotskey}{cell picture=\mchoice{true,false,if necessary} (initially true)}
+ This key is set automatically by \PGFPlots\ if necessary (for example by |set layers|).
+
+ Typically, \PGFPlots\ creates a so-called ``cell picture''. A cell picture is a separate picture which is typeset into a node. Finally, the node is shifted to fulfill special |anchor| requirements. The necessity for a cell picture is given if the |anchor| of an axis is only known after the complete axis has been drawn.
+
+ The initial choice \declaretext{true} means that \PGFPlots\ will create a cell picture for every axis. This allows all |anchor|s, but it is unsuited if multiple graphics layers are desired or if one wants SVG export. In order to create a cell picture, \PGFPlots\ interrupts the embedding |tikzpicture|, draws a new |tikzpicture|, and finally typesets the result into a node.
+
+ The choice \declaretext{false} tells \PGFPlots\ to draw its paths directly into the embedding |tikzpicture|. Such an approach is necessary if the axis shall use layers of the embedding |tikzpicture|. This is possible if and only if the |anchor| can be determined without actually drawing the complete axis. If so, \PGFPlots\ will modify the transformation matrix in advance. Note that axes with |cell picture=false| will \emph{contain} all the usual anchors -- the only difference is that the axis itsself can only use one of the following anchors for its alignment: |north|, |north west|, |west|, |south west|, |south|, |south east|, |east|, |north east|, |north|, |center|, |origin|, |above origin|, |left of origin|, |right of origin|, |below origin|.
+
+ The choice \declaretext{if necessary} will check if the chosen anchor is one of the list above. If so, it will use |cell picture=false|. Otherwise, it will use |cell picture=true|.
+
+\end{pgfplotskey}
+
+\begin{pgfplotskey}{clip mode=\mchoice{global,individual} (initially global)}
+ This key controls how \PGFPlots\ implements the |clip=true| feature (which is on by default). Its primary motivation is control where markers are placed: are markers on top of everything else (choice |global|) or are they overdrawn by following plots (choice |individual|)?
+
+
+ The choice \declaretext{global} tells \PGFPlots\ to install one single clip path for the complete picture\footnote{The choice \texttt{clip mode=global} was the only supported clipping mechanism up to and including version 1.5.}.
+ In order to avoid clipped marker paths, any markers are processed after the clip path has been closed, i.e.\ on a separate layer (see |clip marker paths|). An unexpected side--effect is that marks are on top of plots, even if the plots have been added after the markers.
+
+ The choice \declaretext{individual} instructs \PGFPlots\ to install a separate clip path for \emph{every} |\addplot| command. Consequently, the plot will be clipped. But most importantly, its markers will be drawn immediately after the clip path has been deactivated.
+
+ An unexpected side--effect of |clip mode=individual| is that
+ \begin{enumerate}
+ \item the resulting pdf will be slightly larger due to the repeated paths,
+ \item custom drawing instruction like |\node| or |\draw| need to be clipped \emph{manually}: use
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \begin{axis}[
+ clip mode=individual,
+ ]
+ \addplot+[samples=3] {x^2};
+
+ \begin{scope}
+ \clip \pgfextra{\pgfplotspathaxisoutline};
+
+ \draw (axis cs:-20,15) -- (axis cs:20,15);
+
+ \draw (axis cs:-20,20) -- (axis cs:20,20);
+ \end{scope}
+
+ \addplot+[samples=2] {x};
+ \end{axis}
+\end{tikzpicture}
+\end{codeexample}
+ \noindent to install a custom clip path around your |\draw| instructions for such a use--case. Here, the path instruction |\pgfplotspathaxisoutline| results in a path of the axis outline, i.e.\ the path which is used for the background paths or for clipping. Since it is a basic level macro, it needs to be encapsulated by |\pgfextra|.
+ \end{enumerate}
+
+ Note that |clip marker paths| can lead to the same result as |clip mode=individual| if the plot does not reach the boundaries.
+\end{pgfplotskey}
+
+\begin{pgfplotskey}{compat/show suggested version=\mchoice{true,false} (initially true)}
+ If enabled, \PGFPlots\ will show you which value for |compat=|\meta{version} results in the largest active feature set and highest quality.
+
+ This key will generate a warning if the current version is so old that the quality degrades seriously.
+
+ The notification will be printed to your |.log| file (during |\end{document}|).
+\end{pgfplotskey}
+}
+
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tex
index 7cdb4f99da7..40788fdbe73 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tex
@@ -26,5 +26,7 @@
\input pgfplots.reference.linefitting.tex
\input pgfplots.reference.miscellaneous.tex
\input pgfplots.reference.tikzinteroperability.tex
+\input pgfplots.reference.layers.tex
+\input pgfplots.reference.technicalinternals.tex
}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex
index c0f213634fa..00cd439a0c0 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.reference.tickoptions.tex
@@ -739,14 +739,14 @@ If the code is empty, no tick scale label will be drawn (and no space is consume
\makeatletter
\let\itsinitial=\pgfplots@scale@ticks@below@exponent
\makeatother
-\begin{pgfplotskey}{scale ticks below=\marg{exponent} (initially \itsinitial)}
+\begin{pgfplotskey}{scale ticks below exponent=\marg{exponent} (initially \itsinitial)}
Allows fine tuning of the `|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e<$\meta{exponent}, the common prefactor~$10^e$ will be factored out. The default is
\end{pgfplotskey}
\makeatletter
\let\itsinitial=\pgfplots@scale@ticks@above@exponent
\makeatother
-\begin{pgfplotskey}{scale ticks above=\marg{exponent} (initially \itsinitial)}
+\begin{pgfplotskey}{scale ticks above exponent=\marg{exponent} (initially \itsinitial)}
Allows fine tuning of the '|scaled ticks|' algorithm: if the axis limits are of magnitude $10^e$ and $e>$\meta{exponent}, the common prefactor~$10^e$ will be factored out.
\end{pgfplotskey}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.resources.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.resources.tex
index 86a1d0194f4..f9a4886a168 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.resources.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.resources.tex
@@ -38,12 +38,13 @@
\pgfplotsexpensiveexample
\begin{codeexample}[]
+% huger graphs are possible; consider lualatex
\begin{tikzpicture}
\begin{axis}[
- title=$120 \times 120$ Smooth Surface,
+ title=$80 \times 80$ Smooth Surface,
xlabel=$x$,
ylabel=$y$]
-\addplot3[surf,samples=120,shader=interp,domain=0:1]
+\addplot3[surf,samples=80,shader=interp,domain=0:1]
{sin(deg(8*pi*x))* exp(-20*(y-0.5)^2)
+ exp(-(x-0.5)^2*30
- (y-0.25)^2 - (x-0.5)*(y-0.25))};
@@ -60,7 +61,16 @@ The default settings of most \TeX-distributions are quite restrictive, so it may
Usually, the log--file or the final error message contains a summary about the used resources, giving a hint which parameter needs to be increased.
+\subsubsection{LuaLa\TeX}
+One solution which works quite well is to switch the La\TeX\ executable: if you have a decent \TeX\ distribution, you will have the |lualatex| executable as well. This, in turn, uses dynamic memory allocation such that it usually has enough memory for any \PGFPlots\ axis.
+
+The LuaLa\TeX\ executable |lualatex| is supposed to be almost compatible with |pdflatex|.
+
+This approach works for any platform.
+
\subsubsection{Mik\TeX}
+If you are running Mik\TeX\ and you do not want to (or cannot switch) to |lualatex|, you can proceed as follows.
+
For Mik\TeX, memory limits can be increased in two ways. The first is to use command line switches:
\begin{codeexample}[code only]
pdflatex
@@ -70,7 +80,7 @@ pdflatex
\end{codeexample}
\noindent Experiment with these settings if Mik\TeX\ runs out of memory. Usually, one doesn't invoke |pdflatex| manually: there is a development aid which does all the invocations, so this one needs to be adjusted.
-Sometimes it might be better to adjust the Mik\TeX\ configuration file permanently, for example to avoid reconfiguring the \TeX\ development program. This can be realized using the command
+Sometimes it might be better to adjust the Mik\TeX\ configuration file permanently, for example to avoid reconfiguring the \TeX\ development program. This can be implemented using the command
\begin{codeexample}[code only]
initexmf --edit-config-file=pdflatex
\end{codeexample}
@@ -85,6 +95,8 @@ Thanks to ``LeSpocky'' for his documentation in
\url{http://blog.antiblau.de/2009/04/21/speicherlimits-von-miktex-erhoehen}.
\subsubsection{\TeX Live or similar installations}
+In addition to the option to switch to |lualatex|, you can proceed as follows to keep existing |dvips| or |pdflatex| workflows.
+
For Unix installations, one needs to adjust config files. This can be done as follows:
\begin{enumerate}
\item Locate |texmf.cnf| on your system. On my Ubuntu installation, it is in
@@ -147,7 +159,7 @@ export TEXMFCNF=~/texmf/mytexcnf:
Unfortunately, \TeX\ does not allow arbitrary memory limits, there is an upper bound hard coded in the executables.
\subsection{Reducing Typesetting Time}
-\PGFPlots\ does a lot of computations ranging from abstract coordinate computations to low level |.pdf| drawing commands (realized by \PGF). For complex plots, this may take a considerable time -- especially for 3D plots.
+\PGFPlots\ does a lot of computations ranging from abstract coordinate computations to low level |.pdf| drawing commands (implemented by \PGF). For complex plots, this may take a considerable time -- especially for 3D plots.
One possibility to reduce typesetting time is to tell \PGF\ to generate single, temporary |.pdf| (or |.eps|) documents for a subset (or all) graphics in one run and re-use these temporary images in successive runs. For \PGFPlots, this is the most effective way to reduce typesetting time. It can be accomplished using the |external| library described in Section~\ref{sec:pgfplots:export}.
}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.tex
index 0196ebbe729..c010a3c790c 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplots.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplots.tex
@@ -19,7 +19,9 @@
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SEE pgfplots-macros.tex as well!
\input{pgfplots.preamble.tex}
+
%\RequirePackage[german,english,francais]{babel}
\def\matlabcolormaptext{This colormap is similar to one shipped with Matlab (\textregistered) under a similar name.}
@@ -60,7 +62,7 @@
%\\{\small Attention: you are using an unstable development version.}
}
-%\includeonly{pgfplots.libs}
+%\includeonly{pgfplots.reference,pgfplots.basic.reference}
\begin{document}
@@ -120,7 +122,7 @@ This section contains information about upgrades, the team, the installation (in
\PGFPlots\ is built completely on \Tikz/\PGF. Knowledge of \Tikz\ will simplify the work with \PGFPlots, although it is not required.
-However, note that this library requires at least \PGF\ version $2.00$. At the time of this writing, many \TeX-distributions still contain the older \PGF\ version $1.18$, so it may be necessary to install a recent \PGF\ prior to using \PGFPlots.
+However, note that this library requires at least \PGF\ version $2.10$. At the time of this writing, many \TeX-distributions still contain the older \PGF\ version $1.18$, so it may be necessary to install a recent \PGF\ prior to using \PGFPlots.
\subsection{Components}
\PGFPlots\ comes with two components:
@@ -138,12 +140,16 @@ This release provides a lot of improvements which can be found in all detail in
Any new features or bugfixes which cause backwards compatibility problems need to be activated \emph{manually} and \emph{explicitly}. In order to do so, you should use
\begin{codeexample}[code only]
\usepackage{pgfplots}
-\pgfplotsset{compat=1.5.1}
+\pgfplotsset{compat=1.6}
\end{codeexample}
\noindent in your preamble. This will configure the compatibility layer.
+You should have at least |compat=1.3|. The suggested value is printed to the |.log| file after running \TeX.
+
Here is a list of changes introduced in recent versions of \PGFPlots:
\begin{enumerate}
+ \item \PGFPlots\ 1.6 added new options for more accurate scaling and more scaling options for |\addplot3 graphics|. These are enabled with |compat=1.6| or higher.
+
\item \PGFPlots\ 1.5.1 interpretes circle- and ellipse radii as \PGFPlots\ coordinates (older versions used \pgfname\ unit vectors which have no direct relation to \PGFPlots). In other words: starting with version 1.5.1, it is possible to write |\draw circle[radius=5]| inside of an axis. This requires |\pgfplotsset{compat=1.5.1}| or higher.
Without this compatibility setting, circles and ellipses use low--level canvas units of \pgfname\ as in earlier versions.
@@ -160,7 +166,7 @@ Here is a list of changes introduced in recent versions of \PGFPlots:
Since this affects the spacing, it is not enabled be default.
- \item \PGFPlots\ 1.3 now supports reversed axes. It is no longer necessary to use workarounds with negative units.
+ \item \PGFPlots\ 1.3 supports reversed axes. It is no longer necessary to use workarounds with negative units.
\pgfkeys{/pdflinks/search key prefixes in/.add={/pgfplots/,}{}}
Take a look at the |x dir=reverse| key.
@@ -178,11 +184,11 @@ Here is a list of changes introduced in recent versions of \PGFPlots:
\end{enumerate}
I apologize for any inconvenience caused by these changes.
-\begin{pgfplotskey}{compat=\mchoice{1.5.1,1.5,1.4,1.3,pre 1.3,default,newest} (initially default)}
+\begin{pgfplotskey}{compat=\mchoice{1.6,1.5.1,1.5,1.4,1.3,pre 1.3,default} (initially default)}
The preamble configuration
\begin{codeexample}[code only]
\usepackage{pgfplots}
-\pgfplotsset{compat=1.5.1}
+\pgfplotsset{compat=1.6}
\end{codeexample}
allows to choose between backwards compatibility and most recent features.
@@ -196,12 +202,20 @@ I apologize for any inconvenience caused by these changes.
\end{codeexample}
\noindent in order to restrict the compatibility setting to the actual context (in this case, the |figure| environment).
- Use |\pgfplotsset{compat=default}| to restore the factory settings.
+ The the output of your |.log| file to see the suggested value for |compat|.
- The setting |\pgfplotsset{compat=newest}| will always use features of the most recent version. This might result in small changes in the document's appearance. Note that it is generally a good idea to select the most recent version which is compatible with your document. This ensures that future changes will still be compatible with your document.
+ Use |\pgfplotsset{compat=default}| to restore the factory settings.
Although typically unnecessary, it is also possible to activate only selected changes and keep compatibility to older versions in general:
- \begin{pgfplotskeylist}{compat/path replacement=\meta{version},compat/labels=\meta{version},compat/scaling=\meta{version},compat/general=\meta{version}}
+ \begin{pgfplotskeylist}{%
+ compat/path replacement=\meta{version},%
+ compat/labels=\meta{version},%
+ compat/scaling=\meta{version},%
+ compat/scale mode=\meta{version},%
+ compat/empty line=\meta{version},%
+ compat/plot3graphics=\meta{version},%
+ compat/general=\meta{version}%
+ }
Let us assume that we have a document with |\pgfplotsset{compat=1.3}| and you want to keep it this way.
In addition, you realized that version 1.5.1 supports circles and ellipses. Then, use
@@ -225,12 +239,20 @@ I apologize for any inconvenience caused by these changes.
The |compat/labels| key controls how axis labels are aligned: either uses adjacent to ticks or with an absolute offset.
- The |compat/scaling| key controls some bugfixes introduced in version 1.4: they might introduce slight scaling differences in order to improve the accuracy.
+ The |compat/scaling| key controls some bugfixes introduced in version 1.4 and 1.6: they might introduce slight scaling differences in order to improve the accuracy.
+
+ The |compat/plot3graphics| controls new features for |\addplot3 graphics|.
+
+ The |compat/scale mode| allows to enable/disable the warning ``The content of your 3d axis has CHANGED compared to previous versions'' because the |axis equal| and |unit vector ratio| features where broken for all versions before~1.6 and have been fixed in~1.6.
+
+ The |compat/empty line| allows to write empty lines into input files in order to generate a jump. This requires |compat=1.4| or newer. See |empty line| for details.
The |compat/general| key currently only activates |log origin|.
The detailed effects can be seen on the beginning of this section.
\end{pgfplotskeylist}
+
+ The value \meta{version} can be |default|, |pre 1.3|, |1.3|, |1.4|, |1.5|, |1.5.1|, |1.6|, and |newest|. The value |default| is the same as |pre 1.3| (up to insignificant changes). The use of |newest| is strongly \emph{discouraged}: it might cause changes in your document, depending on the current version of \PGFPlots. Please inspect your |.log| file to see suggestions for the best possible version.
\end{pgfplotskey}
\subsection{The Team}
@@ -239,7 +261,7 @@ I apologize for any inconvenience caused by these changes.
If you are interested in writing something but don't know how, consider reading the auxiliary manual \href{file:TeX-programming-notes.pdf}{TeX-programming-notes.pdf} which comes with \PGFPlots. It is far from complete, but maybe it is a good starting point (at least for more literature).
\subsection{Acknowledgements}
-I thank God for all hours of enjoyed programming. I thank Pascal Wolkotte and Nick Papior Andersen for their programming efforts and contributions as part of the development team. I thank Stefan Tibus, who contributed the |plot shell| feature. I thank Tom Cashman for the contribution of the |reverse legend| feature. Special thanks go to Stefan Pinnow whose tests of \PGFPlots\ lead to numerous quality improvements. Furthermore, I thank Dr.~Schweitzer for many fruitful discussions and Dr.~Meine for his ideas and suggestions. Special thanks go to Markus B\"ohning for proof-reading all the manuals of \PGF, \PGFPlots, and \PGFPlotstable. Thanks as well to the many international contributors who provided feature requests or identified bugs or simply improvements of the manual!
+I thank God for all hours of enjoyed programming. I thank Pascal Wolkotte and Nick Papior Andersen for their programming efforts and contributions as part of the development team. I thank J\"urnjakob Dugge for his contribution of |hist/density|, matlab scripts for \verbpdfref{\addplot3} |graphics|, excellent user forum help and helpful bug reports. I thank Stefan Tibus, who contributed the |plot shell| feature. I thank Tom Cashman for the contribution of the |reverse legend| feature. Special thanks go to Stefan Pinnow whose tests of \PGFPlots\ lead to numerous quality improvements. Furthermore, I thank Dr.~Schweitzer for many fruitful discussions and Dr.~Meine for his ideas and suggestions. Special thanks go to Markus B\"ohning for proof-reading all the manuals of \PGF, \PGFPlots, and \PGFPlotstable. Thanks as well to the many international contributors who provided feature requests or identified bugs or simply improvements of the manual!
Last but not least, I thank Till Tantau and Mark Wibrow for their excellent graphics (and more) package \PGF\ and \Tikz, which is the base of \PGFPlots.
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf b/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf
index e592d8a615c..2e250f51e75 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex
index 074e7738125..de2478c02bf 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex
@@ -3,7 +3,7 @@
% for dvipdfm:
%\def\pgfsysdriver{pgfsys-dvipdfm.def}
\usepackage{pgfplots}
-\pgfplotsset{compat=1.3}% <-- moves axis labels near ticklabels (respects tick label widths)
+\pgfplotsset{compat=1.6}% <-- moves axis labels near ticklabels (respects tick label widths)
\begin{document}
\begin{figure}
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
index ec463c59f91..027e8106b63 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex
index caf37fc33ac..42a058d40a7 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.tex
@@ -330,6 +330,8 @@ level,dof,error1,error2,info,{grad(log(dof),log(error2))},quot(error1)
The choice \declaretext{false} is identical to this last case, i.e.\ even if the first line contains strings, they won't be recognised as column names.
Finally, the choice \declaretext{has colnames} is the opposite of |false|: it assumes that the first non--comment line \emph{contains} column names. In other words: even if only numbers are contained in the first line, they are considered to be column \emph{names}.
+
+ Note that this key only configures headers in \emph{input} tables. To configure \emph{output} headers, you may want to look at |every head row|.
\end{key}
\begin{pgfplotskey}{table/format=\mchoice{auto,inline,file} (initially auto)}
@@ -758,6 +760,8 @@ A style which is installed for every column with odd column index (starting with
\label{pgfplotstable:page:tablerow}
\begin{command}{\pgfplotstablerow}
During the evaluation of row or column options, this command expands to the current row's index.
+
+ Note that it will have the special value $-1$ for the header row.
\end{command}
\begin{command}{\pgfplotstablecols}
During the evaluation of row or column options, this command expands to the total number of columns in the output table.
@@ -946,6 +950,22 @@ $3$ & $2$ & $2$ & $3 d\delta$ \\
\begin{stylekey}{/pgfplots/table/every head row}
A style which is installed for each first row in the tabular. This can be used to adjust options for column names or to add extra lines/colours.
+
+\begin{codeexample}[]
+\pgfplotstabletypeset[
+ % suppress the header row 'col1 col2 col3':
+ every head row/.style={output empty row},
+ col sep=comma,
+ columns/col1/.style={string type,column type=r},
+ columns/col2/.style={string type,column type=l},
+ columns/col3/.style={string type,column type=l},
+ ]
+{
+ col1,col2,col3
+ Col A,B,C
+ The first column,E,F
+}
+\end{codeexample}
\end{stylekey}
\begin{stylekey}{/pgfplots/table/every first row}
@@ -1013,6 +1033,21 @@ $3$ & $2$ & $2$ & $3 d\delta$ \\
Note that |every nth row/.style 2 args=...| is the same as |every nth row=...|.
\end{keylist}
+\begin{stylekey}{/pgfplots/table/output empty row}
+ A style which suppresses output for the current row.
+
+ This style is evaluated very late, after all column-specific content modifications have been applied. It is equivalent to
+\begin{codeexample}[code only]
+\pgfplotstableset{
+ output empty row/.style={
+ typeset cell/.style={@cell content={}}
+ },
+}
+\end{codeexample}
+
+ See |every head row| for an application.
+\end{stylekey}
+
\subsection{Configuring Single--Cell Appearance: Styles}
Besides the possibilities to change column styles and row styles, there are also a couple of styles to change single cells.
\begin{stylekey}{/pgfplots/table/every row \meta{rowindex} column \meta{colindex}}
@@ -1090,7 +1125,37 @@ The following keys allow changes of alignment (|begin table|) and |font| and the
}
\end{codeexample}
- It is also possible to \emph{change} the value. For example,
+ Note that |longtable| allows the use of \emph{replicated headers} for multi-page tables\index{Multi-page} by means of its \declareandlabel{\endhead} macro:\index{Replicate headers}
+\begin{codeexample}[code only]
+% replicate column names on top of every page of a multi-page table:
+\pgfplotstableset{
+ row sep=\\,
+ begin table=\begin{longtable},
+ end table=\end{longtable},
+ every head row/.append style={after row=\endhead},
+}
+\end{codeexample}
+
+ If the first page should have a different header, you can use \declareandlabel{\endfirsthead} provided by the |longtable| package:
+\begin{codeexample}[code only]
+% replicate column names on top of every page of a multi-page table,
+% but with different values for first page:
+\pgfplotstableset{
+ row sep=\\,
+ begin table=\begin{longtable},
+ end table=\end{longtable},
+ every head row/.append style={after row={%
+ \caption{The caption}%
+ \endfirsthead
+ \multicolumn{3}{c}{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
+ \endhead
+ },
+ },
+}
+\end{codeexample}
+ \noindent The preceding example uses the |longtable| macros |\caption|, |\endfirsthead|, |\thetable|, and |\endhead|. In addition, it requires to provide the number of columns (|{3}| in this case) \emph{explicitly}.
+
+ It is also possible to \emph{change} the value of |begin table|. For example,
\begin{codeexample}[code only]
\pgfplotstableset{
begin table/.add={}{[t]},
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf
index 6a2b52c5979..8c4aab7bc8b 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.tex b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.tex
index cf93843552b..731e28ed67d 100644
--- a/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.tex
+++ b/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.tex
@@ -28,99 +28,84 @@
\begin{document}
\maketitle
\tableofcontents
+
\section{Tests}
+ATTENTION: fix the buggy styles for axis lines=center in 3d
+
last test verifications:
\begin{tabular}{lllll}
& pgf CVS & pgf 2.10 & pgf 2.00 &pgf 2.00+compat=default\\
-pgfplotstests & for 1.5.1 & for 1.5.1 & for 1.4 &2009-12-30 \\
-manual & for 1.5.1 & for 1.5.1 & for 1.5 & \\
-pgfplotstable.pdf & for 1.5.1 & for 1.5.1 & for 1.5\\
-example latex & for 1.5 & for 1.5 & 2009-12-30 \\
-example context & for 1.5.1 & for 1.5.1 & 2009-12-30 \\
-example plain tex & for 1.5.1 & for 1.5.1 & 2009-12-30 \\
-tests context & for 1.4 & for 1.5.1\\
+pgfplotstests & for 1.6 & for 1.6 & for 1.4 &2009-12-30 \\
+manual & for 1.6 & for 1.6 & for 1.5 & \\
+pgfplotstable.pdf & for 1.6 & for 1.6 & for 1.5\\
+example latex & for 1.6 & for 1.5 & 2009-12-30 \\
+example context & for 1.6 & for 1.5.1 & 2009-12-30 \\
+example plain tex & for 1.6 & for 1.5.1 & 2009-12-30 \\
+tests context & for 1.6 & for 1.5.1\\
\end{tabular}
-\section{Future work}
-\begin{itemize}
-\item docs: replace `\verb|row sep=\\|' by newlines, it should work now!\ok
-\item docs: search for FIXME
-\item hist 98\% \ok
-\item quiver 95\% \ok
-\item contours 95\% ready.
- add "labels=if less than X" ?
-
- contour gnuplot currently works if and only if the mesh contains end-of-scanline markers and is in ordering x varies (everything gnuplot-specific)
-
- documentation is incomplete \ok
-\item[perhaps] contour filled 10\% ready
-\item plot graphics 3D:
- \begin{itemize}
- \item Documentation \ok
- \item datascaling
- \end{itemize}
-\item patch plots lib: 95\%
+\section{Documentation todo}
+\begin{bugtracker}
+\begin{doctodo}[+]
+ layers:
+ \begin{enumerate}
+ \item \ok motivation and use-cases
+ \item \ok simple example
+ \item \ok multi-axis discussion
+ \item \ok tikz integration
+ \item \ok explain how to merge custom layers and pgfplots layers (and say that pgfplots overwrites layers of tikz)
+ \item \ok specialties: defining own layer sets
+ \item \ok limitations: show list of supported anchors and explain implications of cell picture
+ \end{enumerate}
+
- \begin{itemize}
- \item
- implement displacement input
- \item bug for quad rectangle in middle point
- \item \ok perhaps 1d quadratic/cubic patches (simple)?
- \item \ok color data per patch, also for connectivity data
- \item document 'shader=flat' in patchplot lib
- \item document miter limit and line join options. miter limit=1 is good, use it\ok
-
- $\rightarrow$ perhaps \verb|miter limit=1| as initial config for \verb|patch| plots?\ok
- \end{itemize}
-\item polar axes: 90\% ready
- \begin{itemize}
- \item Documentation \ok
- \item missing feature: input of cartesian coords \ok
- \item special cases \ok (?)
- \item tests
- \end{itemize}
-\item ternary: 95\% ready
- \begin{itemize}
- \item but there are still quite a lot of feature request concerning them
- \item konnodalplots 90\% ready
- \end{itemize}
-\item smith charts: 90\% ready
- now
+ the clipping of marker paths should always be active - but at least for layered graphics. It also needs a better UI
- \begin{itemize}
- \item the huge smith chart is sub-optimal
- \item perhaps enough for the first stable?
-\end{itemize}
-\item internal coordmath framework: 80\% ready, but not used everywhere and
- undocumented
-\item layer graphics support for axes 0\% (should be easy, implement in new branch)
- \begin{itemize}
- \item new key \verb|/pgfplots/on layer| and \verb|/pgfplots/use layers=<sequence>| (or empty value)
- \item give the key a family such that it won't be extracted from styles
- \item the \verb|use layers| activates that stuff. Perhaps it can be set automatically somehow?
- Perhaps with advanced key filtering? Or I provide an error message if \verb|on layer| is used although \verb|use layers| is off.
- \item provide a set of positions where the \verb|on layer| key is checked
- \end{itemize}
-\item view configuration:
- \begin{itemize}
- \item \ok document gnuplot import/export
- \item view matrix input?
- \end{itemize}
-\item check 'empty lines' feature -> should have compat mode
-\item new public axis API is 90\% complete:
- documentation is missing
- log scaling is difficult, still
-\item Bugfixes
+ TODO:
\begin{itemize}
- \item what about 'scale' transformations? Are they correct?
+ \item implement 'clip mode=individual' for axis paths
+
+ FIXME : is there are good reason why \verb|clip mode=global| is a bad choice for the default!?
+
+ Perhaps the layered graphics feature can be shipped in a first version -- with \verb|clip mode=global|. It is simpler anyway.
+
+ \item \ok document 'mark layer'
\end{itemize}
-\end{itemize}
+\end{doctodo}
+
+\begin{doctodo}[+]
+ document benefits of using lualatex (memory limits)
+\end{doctodo}
+\begin{doctodo}
+ document installation requirements when using lualatex (LUAINPUTS should contain pgfplots install dir)
+\end{doctodo}
-\section{Documentation todo}
-\begin{bugtracker}
+\begin{doctodo}[+]
+ pgfplotstable: document that
+\begin{verbatim}
+\pgfplotstabletypeset[
+ typeset cell/.append code={%
+ \ifnum\pgfplotstablerow<0
+ \pgfkeyssetvalue{/pgfplots/table/@cell content}{}%
+ \fi
+ },
+ outfile={table},
+ header=false,
+ columns/0/.style={string type,column type=r},
+ columns/1/.style={string type,column type=l},
+ columns/2/.style={string type,column type=l}
+ ]
+\end{verbatim}
+ can be used to eliminate the displayed header line.
+
+\end{doctodo}
+
+\begin{doctodo}[+]
+ \verb|smithchart mirrored| is undocumented! see \url{https://sourceforge.net/tracker/?func=detail&atid=1060657&aid=3486928&group_id=224188}
+\end{doctodo}
\begin{doctodo}[+]
document that \verb|axis lines=none| is essentially an alias for \verb|hide axis| .
@@ -169,7 +154,7 @@ tests context & for 1.4 & for 1.5.1\\
\end{doctodo}
-\begin{doctodo}
+\begin{doctodo}[+]
document some FAQ for number formatting options.
This should contain how to get non-exponential number printing for log axes
@@ -214,7 +199,7 @@ document the possibiliy of skewed 3d axes by means of manually provided unit vec
mentioning of point meta is missing .
\end{doctodo}
-\begin{doctodo}
+\begin{doctodo}[+]
document the new 'data cs' feature
\end{doctodo}
@@ -412,20 +397,16 @@ beschreiben waere so mein Tip
\end{minimal}
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
release notes:
mention improvements of 'shader=interp'
\end{doctodo}
-\begin{doctodo}[-]
- new 'output cs' feature (when it is finished)
-\end{doctodo}
-
\begin{doctodo}[+]
There is a typo on section 4.5.12: "As for for dimensional patch plots "
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
quiver: the tests have a further pretty example where quiver is on top of
a surf, attached to z =2 or so.
\end{doctodo}
@@ -443,14 +424,16 @@ beschreiben waere so mein Tip
\end{doctodo}
\begin{doctodo}[-]
- try a bar plot with individually shaded bars
+ try a bar plot with individually shaded bars
+
+ FIXME : collect details
\end{doctodo}
\begin{doctodo}[+]
document 'contour prepared', 'contour external' and 'contour gnuplot'.
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
contour external: Do not forget the \verb|\", \'| etc special handling .
\end{doctodo}
@@ -479,11 +462,11 @@ beschreiben waere so mein Tip
+ do not forget 'cartesian cs' and its applications
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
document frac whole format
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
document /pgfplots/empty line
\end{doctodo}
@@ -513,7 +496,7 @@ beschreiben waere so mein Tip
tracingstuff.
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
document how to fix dimension too large problems: restrict to domain for
example
\end{doctodo}
@@ -528,7 +511,7 @@ beschreiben waere so mein Tip
instead
\end{doctodo}
-\begin{doctodo}[-]
+\begin{doctodo}[+]
pgfplotstable: show how to use '\verb|\begin{longtable}|'
\end{doctodo}
@@ -543,7 +526,7 @@ beschreiben waere so mein Tip
\section{Bugs/Features in PGF/TikZ}
\begin{bugtracker}
-\begin{pgfbug}
+\begin{pgfbug}[+]
number printer: apply
\verb|set thousands separator={\cdot}| also to fractional parts:
\begin{minimal}
@@ -652,7 +635,7 @@ Thanks!
\end{pgfbug}
-\begin{pgfbug}[open]
+\begin{pgfbug}[closed]
\verb|\pgfmathdivide@{-0.8}{1.00002}\pgfmathresult| yields
\makeatletter
@@ -725,16 +708,16 @@ Thanks!
implement \verb|\pgfmathfloattocount|
\end{pgfbug}
-\begin{pgfbug}[-]
+\begin{pgfbug}[+]
external lib: think whether it is possible to provide the real jobname
without explicit user input. Idea: transport it as TeX code argument to pdflatex
\end{pgfbug}
-\begin{pgfbug}[-]
+\begin{pgfbug}[+]
provide '$\times$' or more general formatting rules to number printer
\end{pgfbug}
-\begin{pgfbug}[-]
+\begin{pgfbug}[+]
code 2 args doesn't work correctly with spaces between the arguments!?
\end{pgfbug}
@@ -760,7 +743,7 @@ Thanks!
it seems fadings don't work correctly with externalization!?
\end{pgfbug}
-\begin{pgfbug}[-]
+\begin{pgfbug}[+]
include addition of Christophe Jorssen for MD5 checksums in external lib
\end{pgfbug}
@@ -816,7 +799,7 @@ Thanks!
'text height=1em' realisieren mit [node font units]1em
\end{pgfbug}
-\begin{pgfbug}[-]
+\begin{pgfbug}[+]
compatiblity code todo:
- the example for plot graphics (with view=0{90}) doesn't work.
$\leadsto$ that's the '\verb|exp(0-x^2)|' bug which is still in pgf 2.00!
@@ -828,7 +811,153 @@ Thanks!
% BUGS
\section{Bugs in PGFPlots}
+
\begin{bugtracker}
+
+\begin{bug}
+ new layered graphics stuff: the style changes of the layer config are read too later; it is impossible to overwrite them within the same axis (for example using \verb|set layers,tick style={on layer=...}|)
+\end{bug}
+
+\begin{bug}
+ improper alignment of x tick labels which have different baselines or different heights.
+
+ Idea: introduce \verb|\strut|
+
+ \url{https://sourceforge.net/tracker/?func=detail&aid=3516368&group_id=224188&atid=1060656}
+\end{bug}
+
+\begin{bug}[prio=9,closed]
+ SCALING PROBLEMS in 3d:
+
+ \begin{itemize}
+ \item
+ the plot box ratio and axis equal feature both need to imply \verb|scale mode=scale uniformly|. But it is still wrong; even if one activates the correct scale mode.
+
+ The problem: the axis equal stuff operates on the projected unit vectors and applies different scalings.
+ \item combining plot box ratio and explicit limits seems to corrupt the display (?)
+ \end{itemize}
+\end{bug}
+
+\begin{bug}
+ x tick scale label for style \verb|tiny| has an unsuitable shift
+\end{bug}
+
+\begin{bug}
+ the3d clip path is sometimes bad: perhaps it should be the bounding box instead!?
+
+ \includegraphics[width=\textwidth]{figures/pgfplots-surface-cutoff.png}
+\end{bug}
+
+\begin{bug}
+ Internal coordmath framework: it is not used everywhere
+\end{bug}
+
+\begin{bug}
+ stacked plots + log basis y + log does not work.
+\begin{minimal}
+\begin{tikzpicture}
+ \begin{axis}[ymode=log
+ , ybar stacked
+ , log basis y=10
+ ]
+ \addplot coordinates {(0,1e5)};
+ \addplot coordinates {(0,9e5)};
+ \end{axis}
+\end{tikzpicture}
+\end{minimal}
+ The problem is documented as FIXME in pgfplotsstackedpltos.code.tex
+
+ suggested fix: refactor the log and exp methods: always provide the requested basis explicitly, and provide some `prepare log basis' method to improve performance. Do not attach the log basis to the coord math.
+\end{bug}
+
+\begin{bug}
+ \verb|log number format code| is a global variable and cannot be set for individual axes.
+
+ This applies to \verb|log ticks with fixed point| as well.
+\end{bug}
+
+\begin{bug}
+ One cannot manually load a table inside of a pgfplots axis if it contains empty lines: the scanline callback is active
+\end{bug}
+
+\begin{bug}
+ \verb|ybar legend| does not contain \verb|ybar| (sourceforge 3482770)
+\end{bug}
+
+\begin{bug}
+ \verb|refstyle| does only include partial information of the reference style. (sourceforge 3482770)
+\end{bug}
+
+\begin{bug}
+ Using square brackets as first char inside of \verb|\legend| leads to a failure: \verb|\legend{[\ion{Ne}{2}],...}|.
+
+ Cause: the \verb|\legend| command does not properly insert \verb|[]| in front of every entry (as it ought to).
+\end{bug}
+
+\begin{bug}
+ Adding \verb|error bars/.cd| to \verb|\addplot| options causes the \verb|\ref| image to fail.
+
+ The problem is the key filtering apparently: it discards the \verb|/pgfplots/.cd| but leaves the \verb|error bars/.cd|.
+\end{bug}
+
+\begin{bug}
+ quiver plots: the clip path does not respect arrow paths
+\end{bug}
+
+\begin{bug}
+
+ The default label placement for axis lines=center in 3d appears to be wrong
+\begin{verbatim}
+\begin{tikzpicture}
+\begin{axis}[
+ axis lines=center,
+ axis on top,
+ xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
+ domain=0:1,
+ y domain=0:2*pi,
+ xmin=-1.5, xmax=1.5,
+ ymin=-1.5, ymax=1.5, zmin=0.0,
+ mesh/interior colormap=
+ {blueblack}{color=(black) color=(blue)},
+ colormap/blackwhite,
+ samples=10,
+ samples y=40,
+ z buffer=sort,
+ ]
+ \addplot3[surf]
+ ({x*cos(deg(y))},{x*sin(deg(y))},{x});
+\end{axis}
+\end{tikzpicture}
+\end{verbatim}
+
+ Potential fixes: (a) redefine \verb|right of origin| and its friends for 3d; (b) do not use the \verb|right of origin| things, prefer \verb|rel axis cs=1,0.5,0.5|. Problem: \verb|rel axis cs| must know where the fractions to find the origin (keep in mind that a rel axis value of $0$ means ``lower end''). Perhaps some ``constant'' value should expand to the fraction for zero?
+\end{bug}
+
+\begin{bug}
+ Alignment bug: axis x line=middle combined with a yshift shifts the xlabel incorrectly:
+\begin{minimal}
+\documentclass{report}
+\usepackage{pgfplots}
+\pgfplotsset{compat=1.3}
+
+\begin{document}
+ \begin{tikzpicture}
+ \draw (0,0) circle (5pt);
+ \begin{scope}[yshift=-3cm]
+ \begin{axis}[width=10cm,height=3cm,xlabel={$x$},
+ axis x line = middle]
+ \addplot coordinates {
+ (0,1) (1,-1) (2,1)
+ };
+ \end{axis}
+ \end{scope}
+ \end{tikzpicture}
+\end{document}
+\end{minimal}
+ Using \verb|xlabel style = {yshift=3cm}| in the plot will correctly
+position the x label (to its default position).
+\end{bug}
+
\begin{bug}
Using \verb|hide axis| or \verb|axis lines=none| causes the axis to vanish -- but it will still consume space in the bounding box!
@@ -867,6 +996,7 @@ Thanks!
See \verb|unittest_hideaxis*|.
+ Seems to be better now (with the axis equal scaling fix)
\end{bug}
\begin{bug}[+]
@@ -881,7 +1011,7 @@ Thanks!
\verb|https://sourceforge.net/tracker/index.php?func=detail&aid=3457210&group_id=224188&atid=1060656|
\end{bug}
-\begin{bug}
+\begin{bug}[+]
nodes near coords is broken for layer branch
\end{bug}
@@ -893,7 +1023,7 @@ Thanks!
xbar and nodes near coords does not automatically align the nodes, see \verb|http://tex.stackexchange.com/questions/31701/pgfplots-nodes-near-coords-on-xbar-chart-is-off|
\end{bug}
-\begin{bug}
+\begin{bug}[+]
view direction is imprecise. It seems as if the $z$ direction is wrong.
See the recent commits on branch \verb|mesh_bg_colormap|
@@ -913,7 +1043,7 @@ Thanks!
\verb|\pgfplotsforeachungrouped| cannot be combined with three or more arguments like \verb|\foreach|
\end{bug}
-\begin{bug}
+\begin{bug}[+]
If one specifies \verb|\scope| within an axis, the plots (partially) use their variables, but legends do not.
\begin{minimal}
\documentclass{article}
@@ -2062,12 +2192,26 @@ and you can remark that colour filling overlaps x- and y-axis ! So I suggest tha
\begin{bugtracker}
\begin{feature}
+ Layered graphics: consider drawing tick lines which are on the ``outer part'' of the axis on the foreground layer.
+
+ See
+ \verb|http://tex.stackexchange.com/questions/31708/draw-a-bivariate-normal-distribution-in-tikz/31713#31713| for a motivation (the tick lines are hidden by the surface)
+\end{feature}
+
+\begin{feature}
+ filled contour plots (prototype is 10\% ready)
+\end{feature}
+
+\begin{feature}
+ allow support for units in \verb|bar width| and \verb|bar shift| (compare the implementation for circles/ellipses)
+\end{feature}
+
+\begin{feature}[+]
improve support for circle / ellipse paths inside of an axis
compare \url{http://www.digipedia.pl/usenet/thread/16719/198}
\url{http://sourceforge.net/mailarchive/forum.php?thread_name=D595FD68-AFAB-4C1C-8B9D-A2F84D1A0598\%40mac.com&forum_name=pgfplots-features}
-
\end{feature}
\begin{feature}
@@ -2096,13 +2240,15 @@ and you can remark that colour filling overlaps x- and y-axis ! So I suggest tha
provide a way to provide more customization to stacked plots as in
\verb|http://tex.stackexchange.com/questions/13627/pgfplots-multiple-shifted-stacked-plots-in-one-diagram|
+
+ (stacked and clustered bar charts)
\end{feature}
\begin{feature}
the \verb|empty line| feature should produce a log notice when it finds an empty line in compat mode.
\end{feature}
-\begin{feature}
+\begin{feature}[+]
smith charts: provide the same as now, but mirrored (concentric from left end rather then right end)
\end{feature}
@@ -2218,7 +2364,7 @@ If there would be a search path like \verb|\graphicspath| for graphics it would
\end{feature}
-\begin{feature}[-]
+\begin{feature}[+]
plot graphics for 3D axes.
\end{feature}
@@ -2242,6 +2388,10 @@ If there would be a search path like \verb|\graphicspath| for graphics it would
discontinuity in the middle of a plot
(as an example see the phase diagram of water
\url{http://pruffle.mit.edu/3.00/Lecture_29_web/img20.gif})
+
+ \url{http://peltiertech.com/images/2011-11/Ybroken.png}
+
+ \url{http://tex.stackexchange.com/questions/46422/axis-break-in-pgfplots}
\end{feature}
\begin{feature}[-]
diff --git a/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample.pdf b/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample.pdf
index 618f9baa13a..0e6485c087c 100644
--- a/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample.pdf
+++ b/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample.pdf
Binary files differ
diff --git a/Master/texmf-dist/scripts/lua/pgfplots/pgfplots.lua b/Master/texmf-dist/scripts/lua/pgfplots/pgfplots.lua
new file mode 100644
index 00000000000..8242222e8d6
--- /dev/null
+++ b/Master/texmf-dist/scripts/lua/pgfplots/pgfplots.lua
@@ -0,0 +1,30 @@
+
+pgfplotsGetLuaBinaryStringFromCharIndicesChunkSize = 7000;
+
+-- Takes a table containing an arbitrary number of integers in the range 0..255 and converts it
+-- into a binary stream of the corresponding binary chars.
+--
+-- @param charIndices a table containing 0...N arguments; each in the range 0..255
+--
+-- @return a string containing binary content, one byte for each input integer.
+function pgfplotsGetLuaBinaryStringFromCharIndices(charIndices)
+ -- unpack extracts only the indices (we can't provide a table to string.char).
+ -- note that pdf.immediateobj has been designed to avoid sanity checking for invalid UTF strings -
+ -- in other words: it accepts binary strings.
+ --
+ -- unfortunately, this here fails for huge input tables:
+ -- pgfplotsretval=string.char(unpack(charIndices));
+ -- we have to create it incrementally using chunks:
+ local len = #charIndices;
+ local chunkSize = pgfplotsGetLuaBinaryStringFromCharIndicesChunkSize;
+ local buf = {};
+ -- ok, append all full chunks of chunkSize first:
+ local numFullChunks = math.floor(len/chunkSize);
+ for i = 0, numFullChunks-1, 1 do
+ table.insert(buf, string.char(unpack(charIndices, 1+i*chunkSize, (i+1)*chunkSize)));
+ end
+ -- append the rest:
+ table.insert(buf, string.char(unpack(charIndices, 1+numFullChunks*chunkSize)));
+ return table.concat(buf);
+end
+
diff --git a/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.tar.bz2 b/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.tar.bz2
index d1098669d65..fcc9515496f 100644
--- a/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.tar.bz2
+++ b/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.tar.bz2
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2 b/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2
index a03b0759d33..aa64b8de71f 100644
--- a/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2
+++ b/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2
Binary files differ
diff --git a/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplots.tex b/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplots.tex
index 1dbd5495cab..ea1f5f3eda4 100644
--- a/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplots.tex
+++ b/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplots.tex
@@ -24,6 +24,12 @@
%
%--------------------------------------------
+\writestatus{loading}{ConTeXt User Module / Pgfplots}
+
+\unprotect
+
+\startmodule [pgfplots]
+
\usemodule[tikz]
\usetikzlibrary[plotmarks]
@@ -61,4 +67,7 @@
\catcode`\|=\tikzbarcode
\catcode`\!=\tikzexclaimcode
+\stopmodule
+
+\protect
\endinput
diff --git a/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplotstable.tex b/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplotstable.tex
index 0732df60c10..7351363a09b 100644
--- a/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplotstable.tex
+++ b/Master/texmf-dist/tex/context/third/pgfplots/t-pgfplotstable.tex
@@ -21,6 +21,21 @@
%
%--------------------------------------------
+\writestatus{loading}{ConTeXt User Module / Pgfplotstable}
+
+\unprotect
+
+\startmodule [pgfplotstable]
+
\usemodule[pgfplots]
+% FIXME :
+%\def\pgfplots@texdist@protect{\protect}%
+
+\input pgfplotstable.code.tex
+
+
+\stopmodule
+
+\protect
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.surfshading.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.surfshading.code.tex
index c45b5a613f0..63f24068c41 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.surfshading.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.surfshading.code.tex
@@ -56,6 +56,13 @@
/pgfplots/surf shading/north east corner/.initial={\pgfqpoint{6cm}{6cm}},%
/pgfplots/surf shading/anchor/.initial=\pgfpointorigin,%
/pgfplots/surf shading/shading type/.initial=5,% triangles in form of lattice
+ %
+ % can only have values '' (empty) for binary encoding or
+ % ASCIIHexEncode for base 16 encoding. Use this if some driver
+ % cannot produce binary encoding. This is undocumented; for use in
+ % emergency only.
+ /pgfplots/surf shading/pdf stream filter/.initial=,%
+ %
/pgfplots/surf shading/precision/.is choice,
/pgfplots/surf shading/precision/pdf/.code={%
% Lossless coordinate output.
@@ -129,7 +136,15 @@
\newcount\c@pgfplotslibrarysurf@no
% driver specific:
-\def\pgfplotslibrarysurf@initstream{}
+\def\pgfplotslibrarysurf@initstream{%
+ \edef\pgfplots@loc@TMPa{\pgfkeysvalueof{/pgfplots/surf shading/pdf stream filter}}%
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \else
+ \let\pgfplotslibrarysurf@filter@encode=\pgfplots@loc@TMPa
+ \let\pgfplotslibrarysurf@filter@decode=\pgfplotslibrarysurf@filter@encode
+ \fi
+}
+
\def\pgfplotslibrarysurf@advancestreamlen#1{}%
\def\pgfplotslibrarysurfstreamstart{%
@@ -139,9 +154,9 @@
\pgfplotsapplistXglobalnewempty\pgfplotslibrarysurf@binarystream@accum
\pgfplotslibrarysurf@initstream
\ifx\pgfplotslibrarysurf@filter@encode\pgfutil@empty
- \else
- \pgfkeysalso{/pgfplots/bin/\pgfplotslibrarysurf@filter@encode}%
+ \def\pgfplotslibrarysurf@filter@encode{binary encoding}%
\fi
+ \pgfkeysalso{/pgfplots/bin/\pgfplotslibrarysurf@filter@encode}%
\ifcase\pgfplotslibrarysurf@type\relax
% 0
\pgfplotslibrarysurf@initstream@wrongtype
@@ -172,7 +187,7 @@
\fi
}%
\def\pgfplotslibrarysurf@initstream@wrongtype{%
- \pgfplots@error{CRITICAL: shader=interp: got unsupported pdf shading type '\pgfplotslibrarysurf@type'. This may correct your pdf!}%
+ \pgfplots@error{CRITICAL: shader=interp: got unsupported pdf shading type '\pgfplotslibrarysurf@type'. This may corrupt your pdf!}%
}%
\def\pgfplotslibrarysurfstreamend{%
\pgfplotsapplistXgloballet\pgfplotslibrarysurf@binarystream=\pgfplotslibrarysurf@binarystream@accum
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
index 7e7e5232fc0..146153fca9b 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
@@ -134,8 +134,9 @@
\endgroup
}%
\pgfkeysdef{/pgfplots/#1 coord inv trafo}{%
+ \edef\pgfplotstempjuliandatenumeric{##1}%
\begingroup
- \pgfplotslibdateplot@number@to@julian@and@time##1\julianto{\c@pgf@counta}\hourto\Hour\minuteto\Minute%
+ \expandafter\pgfplotslibdateplot@number@to@julian@and@time\pgfplotstempjuliandatenumeric\julianto{\c@pgf@counta}\hourto\Hour\minuteto\Minute%
\advance\c@pgf@counta by\pgfplots@calender@ZEROSHIFT\relax
\expandafter\pgfcalendarjuliantodate\expandafter{\the\c@pgf@counta}\year\month\day
\xdef\pgfplotslibdateplot@TMP{%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex
index 227f5c1a5a4..4923e310c5b 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.external.code.tex
@@ -32,8 +32,18 @@
%
\pgfplotsiffileexists{tikzlibraryexternal.code.tex}{%
- \usetikzlibrary{external}%
+ \pgfplots@ifneedspgfcompabitibilitycode@has@pgf@one@zero@zero{%
+ \def\pgfplots@glob@TMPa{0}%
+ }{%
+ \def\pgfplots@glob@TMPa{1}%
+ }%
}{%
+ \def\pgfplots@glob@TMPa{0}%
+}%
+\if1\pgfplots@glob@TMPa
+ \usetikzlibrary{external}%
+\else
+ \immediate\write16{Package pgfplots external lib: loading complementary code for your PGF version...}
% Backwards compatibility:
\let\pgfplots@backw@compat@AtBeginDocument=\AtBeginDocument
\def\AtBeginDocument#1{}%
@@ -41,6 +51,6 @@
\let\AtBeginDocument=\pgfplots@backw@compat@AtBeginDocument
%
\input pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
-}%
+\fi
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
index f3e4674f9e6..79990ec1fb8 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
@@ -888,7 +888,7 @@
\divide\pgf@ya by4
\divide\pgf@yb by4
\pgfplotscoordmath{meta}{op}{multiply}{{\pgfmathresult}{\pgfplots@loc@scale}}%
- \edef\pgfplotspatchclass@rect@M{{\the\pgf@xa}{\the\pgf@ya}{\pgfmathresult}\ifx\pgfplotspatchvertexdepth\pgfutil@empty\else \pgf@sys@tonumber\pgf@yb\fi}%
+ \edef\pgfplotspatchclass@rect@M{{\the\pgf@xa}{\the\pgf@ya}{\pgfmathresult}\ifx\pgfplotspatchvertexdepth\pgfutil@empty\else \pgf@sys@tonumber\pgf@yb\fi:}%
%
\let\pgfplotsplothandlermesh@patchclass@=\pgfplotsplothandlermesh@patchclass
\def\pgfplotsplothandlermesh@patchclass{triangle}%
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}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.smithchart.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.smithchart.code.tex
index 7d24c53216d..e1561bb96ac 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.smithchart.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.smithchart.code.tex
@@ -213,6 +213,30 @@
%font=\tiny,
}
},
+ yticklabel around circle/.style={
+ ytick align=center,
+ yticklabel style={
+ rotate=90,
+ sloped like y axis={%
+ execute for upside down={\tikzset{anchor=south west}},
+ %allow upside down,
+ reset nontranslations=false},
+ anchor=south east,
+ %font=\tiny,
+ }
+ },
+ yticklabel around circle*/.style={
+ ytick align=center,
+ yticklabel style={
+ rotate=90,
+ sloped like y axis={%
+ execute for upside down={\tikzset{anchor=north west}},
+ %allow upside down,
+ reset nontranslations=false},
+ anchor=north east,
+ %font=\tiny,
+ }
+ }
}
\def\pgfplots@smithchartaxis@activate{%
@@ -259,7 +283,7 @@
\fi
}%
\def\axisdefaultheight{\axisdefaultwidth}%
- \let\pgfplots@initsizes=\pgfplots@initsizes@smithchart
+ \let\pgfplots@BB@for@plotbox@get@unit@scales@for@limits=\pgfplots@BB@for@plotbox@get@unit@scales@for@limits@smithchart
%\let\pgfplots@limits@ready=\pgfplots@limits@ready@smithchart
%\let\pgfplots@show@ticklabel@=\pgfplots@show@ticklabel@@smithchart
%\def\pgfplots@xtick@disable@last@tick{0}%
@@ -1513,134 +1537,17 @@
\fi
}%
-\def\pgfplots@initsizes@smithchart{%
- % I copy-pasted most of this code, up to just one position where
- % I introduced the modified scaling for smithchart axes
- %----------------------------------
- % INIT.
- %
- %
- \def\pgfplots@minmax@reg@forbidden{\pgfplots@error{Sorry, an internal logic error occured during smithchart processing (a routine tried to access \string\pgfplots@xmin@reg\space or its variants). Please report this as bug, sorry}}%
- \iffalse
- \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
- \else
- \let\pgfplots@xmin@reg=\pgfplots@minmax@reg@forbidden
- \let\pgfplots@xmax@reg=\pgfplots@minmax@reg@forbidden
- \let\pgfplots@ymin@reg=\pgfplots@minmax@reg@forbidden
- \let\pgfplots@ymax@reg=\pgfplots@minmax@reg@forbidden
- \let\pgfplots@zmin@reg=\pgfplots@minmax@reg@forbidden
- \let\pgfplots@zmax@reg=\pgfplots@minmax@reg@forbidden
- \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 smithchart 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=2 pt % radius
- \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
- %
- \edef\pgfplots@tmpXscale{\pgfplots@tmpXscale pt}%
- \edef\pgfplots@tmpYscale{\pgfplots@tmpYscale pt}%
- %
- \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}{}%
- \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
- \fi
- %
- % FIXME : unit vector ratio / axis equal
- %
-}
+\def\pgfplots@BB@for@plotbox@get@unit@scales@for@limits@smithchart#1#2#3{%
+ % In a smith chart, the size of the image is unrelated to the
+ % involved data limits.
+ %
+ % The factor 2 is because we want to fit the DIAMETER into the
+ % prescribed dimensions, not just the radius.
+ \def\pgfmathresult{2}%
+ \let#1=\pgfmathresult
+ \let#2=\pgfmathresult
+ \def#3{1}%
+}%
\def\pgfplots@handle@invalid@range@defaultlimits@smithchart{%
\pgfplotscoordmath{x}{parsenumber}{0}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.ternary.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.ternary.code.tex
index dfb520af190..7000f8c13cf 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.ternary.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.ternary.code.tex
@@ -86,11 +86,14 @@
\def\pgfplots@drawaxis@innerlines@onorientedsurf##1##2##3{}%
\let\pgfplots@draw@axis@post=\pgfplots@draw@axis@post@ternary
\let\pgfplots@initsizes=\pgfplots@initsizes@ternary
+ \let\pgfplots@limits@ready=\pgfplots@limits@ready@ternary
\let\pgfplotspoint@initialisation@axes=\pgfplotspoint@initialisation@axes@ternary
\let\pgfplotspoint@initialisation@units=\pgfplotspoint@initialisation@units@ternary
\let\pgfplots@initsizes@setunitvector=\pgfplots@initsizes@setunitvector@ternary
+ \let\pgfplots@computeunitvectorlengths=\pgfplots@computeunitvectorlengths@ternary
\let\pgfplotspointouternormalvectorofaxis@=\pgfplotspointouternormalvectorofaxis@ternary
\let\pgfplots@prepare@ZERO@coordinates=\pgfplots@prepare@ZERO@coordinates@ternary
+ \def\pgfplots@scaleaxes@to@BB@##1##2{}%
\let\pgfplotsgetnormalforcurrentview=\relax
\def\pgfplots@drawtickgridlines@INSTALLCLIP@onorientedsurf##1{}%
\let\pgfplots@clippath@prepare@for@axistype=\pgfplots@clippath@prepare@for@axistype@ternary
@@ -280,10 +283,6 @@
\else
\pgfplots@error{Sorry, 'axis type=ternary' needs a three dimensional axes. Make sure you supplied three dimensional coordinates (using \string\addplot3, for example). This error is critical; I can't recover}%
\fi
-%\message{ternary with limits x=[\pgfplots@xmin:\pgfplots@xmax], y=[\pgfplots@ymin:\pgfplots@ymax]; z=[\pgfplots@zmin:\pgfplots@zmax].}%
- \pgfplots@ternary@init@map@to@unit x
- \pgfplots@ternary@init@map@to@unit y
- \pgfplots@ternary@init@map@to@unit z
%
\pgfplots@initsizes@get@width@withoutlabels
\pgf@x=\pgfmathresult
@@ -293,6 +292,17 @@
%
}%
+\let\pgfplots@limits@ready@original=\pgfplots@limits@ready
+
+\def\pgfplots@limits@ready@ternary{%
+ \pgfplots@limits@ready@original
+ %
+%\message{ternary with limits x=[\pgfplots@xmin:\pgfplots@xmax], y=[\pgfplots@ymin:\pgfplots@ymax]; z=[\pgfplots@zmin:\pgfplots@zmax].}%
+ \pgfplots@ternary@init@map@to@unit x%
+ \pgfplots@ternary@init@map@to@unit y%
+ \pgfplots@ternary@init@map@to@unit z%
+}%
+
\def\pgfplots@ternary@init@map@to@unit#1{%
\begingroup
\pgfmath@basic@subtract@
@@ -311,7 +321,7 @@
\def\pgfplots@initsizes@setunitvector@ternary#1#2#3#4{%
% ternary axis are DIFFERENT here.
% They don't use the (xx,xy), (yx,yy), (zx,zy) vectors, so we can
- % use them to realize *cartesian* coordinates.
+ % use them to implement *cartesian* coordinates.
%
% Thus, any \draw (0,0) inside of a ternary axis will yield
% cartesian coordinates.
@@ -343,6 +353,17 @@
{\global\pgfplots@ternary@next@is@unitintervaltrue\pgfplotsqpointxyz@ternary001}%
\fi
\expandafter\xdef\csname pgfplotspoint#1axis\endcsname{\noexpand\pgf@x=\the\pgf@x\space\noexpand\pgf@y=\the\pgf@y\space}%
+ %
+%\message{-> got unitvector(#1) = (\the\csname pgf@#1x\endcsname, \the\csname pgf@#1y\endcsname).}%
+}%
+
+\def\pgfplots@computeunitvectorlengths@ternary{%
+ \pgfplots@computeunitvectorlengths@ternary@ x%
+ \pgfplots@computeunitvectorlengths@ternary@ y%
+ \pgfplots@computeunitvectorlengths@ternary@ z%
+}
+\def\pgfplots@computeunitvectorlengths@ternary@#1{%
+ \csname pgfplotspoint#1axis\endcsname
\pgfmathveclen{\pgf@x}{\pgf@y}%
\expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
\pgfplotsmath@ifzero{\pgfmathresult}{%
@@ -353,7 +374,6 @@
}%
\expandafter\xdef\csname pgfplotspoint#1axislength\endcsname{\pgfplots@x@veclength pt}%
%
-%\message{-> got unitvector(#1) = (\the\csname pgf@#1x\endcsname, \the\csname pgf@#1y\endcsname).}%
}%
\newif\ifpgfplots@ternary@next@is@unitinterval
diff --git a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex
index 34cb67bfe02..3b964264327 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructure.code.tex
@@ -417,14 +417,14 @@
% -> iterate through argument until \pgfplotslistforeachungrouped@EOI
% comes.
\long\def\pgfplotslistforeachungrouped@#1#2\pgfpl@@#3{%
- \def\pgfplotslist@loc@TMPa{#3}%
+ \t@pgfplots@tokc={#3}% this allows '#' inside of '#3'
+ \edef\pgfplotslist@loc@TMPa{\the\t@pgfplots@tokc}%
\ifx\pgfplotslist@loc@TMPa\pgfplotslistforeachungrouped@EOI
% ok, terminate loop.
\let\pgfplotslistforeachungrouped@next=\relax
\else
% perform loop iteration ...
- \t@pgfplots@tokc={#3}%
- \edef#1{\the\t@pgfplots@tokc}% this allows '#' inside of '#3'
+ \let#1=\pgfplotslist@loc@TMPa
#2\relax
% and continue iterating.
\def\pgfplotslistforeachungrouped@next{\pgfplotslistforeachungrouped@{#1}{#2}}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
index 1cde825708d..91677f6e15e 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
@@ -914,6 +914,12 @@
\pgfkeyssetvalue{/pgfplots/table/@cell content}{#1&}%
\fi
},
+ % this can be omitted to omit the header row:
+ /pgfplots/table/output empty row/.style={%
+ /pgfplots/table/typeset cell/.code={%
+ \pgfkeyslet{/pgfplots/table/@cell content}\pgfutil@empty%
+ }%
+ },
/pgfplots/table/reset styles/.style={
/pgfplots/table/every table/.code=,
/pgfplots/table/every odd column/.code=,
@@ -1930,8 +1936,11 @@
\noexpand\def\noexpand\pgfplotstable@before{\the\t@pgfplots@toka}%
\noexpand\def\noexpand\pgfplotstable@after{\the\t@pgfplots@tokb}%
}%
+ \pgfkeysgetvalue{/pgfplots/table/typeset cell/.@cmd}\pgfplots@loc@TMPa
+ \global\let\pgfplots@glob@TMPd=\pgfplots@loc@TMPa
\endgroup
\pgfplots@glob@TMPc
+ \let\pgfplotstable@headrow@typesetcell=\pgfplots@glob@TMPd
% insert 'before row' here:
\t@pgfplots@toka=\expandafter{\pgfplotstable@before}%
\t@pgfplots@tokb=\expandafter{\pgfplotstable@curline}%
@@ -1942,8 +1951,7 @@
%
\advance\c@pgfplotstable@colindex by1\relax
% typeset the cell:
- \pgfkeysgetvalue{/pgfplots/table/typeset cell/.@cmd}\pgfplots@loc@TMPa
- \expandafter\pgfplots@loc@TMPa\pgfplotstable@colname@out\pgfeov
+ \expandafter\pgfplotstable@headrow@typesetcell\pgfplotstable@colname@out\pgfeov
\pgfkeysgetvalue{/pgfplots/table/@cell content}\pgfmathresult
%
% append this cell:
@@ -2693,7 +2701,7 @@
\else
\ifx\pgfplotstable@variance@table\pgfutil@empty
\t@pgfplots@toka=\expandafter{\pgfplotstable@table}%
- \t@pgfplots@tokb=\expandafter{\pgfplotstable@variance@table}%
+ \t@pgfplots@tokb=\expandafter{\pgfplotstable@variance@colname}%
\edef\pgfplots@loc@TMPa{{\the\t@pgfplots@tokb}\noexpand\of{\the\t@pgfplots@toka}}%
\expandafter\pgfplotstablegetcolumn\pgfplots@loc@TMPa\to\pgfplotstable@VARIANCE
\else
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
index 74cb909c646..48bb178afbc 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
@@ -19,15 +19,17 @@
% check whether we need to load supplementary code.
% The development of pgfplots and pgf is intermingled, so pgfplots
% always uses up-to-date pgf CVS versions - the relevant complements between
-% PGF 2.00 and PGF CVS are loaded here:
+% PGF 2.10 and PGF CVS are loaded here:
%
% #1: for backwards compatibility
% #2: for normal processing.
-\def\pgfplots@ifneedspgfcompabitibilitycode#1#2{%
+\def\pgfplots@ifneedspgfcompabitibilitycode@has@pgf@one@zero@zero#1#2{%
%\pgfkeysifdefined{/pgf/number format/sci precision/.@cmd}{#2}{#1}%
\pgfutil@ifundefined{pgfplothandlerjumpmarkmid}{#1}{#2}%
}%
+\let\pgfplots@ifneedspgfcompabitibilitycode=\pgfplots@ifneedspgfcompabitibilitycode@has@pgf@one@zero@zero
+
\pgfplots@ifneedspgfcompabitibilitycode
{%
\immediate\write16{Package pgfplots: loading complementary code for your PGF version...}
@@ -37,6 +39,8 @@
\input pgfplotsoldpgfsupp_pgfmathfloat.code.tex
\input pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
\input pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
+ \input pgfplotsoldpgfsupp_pgfcorelayers.code.tex
+ \input pgfplotsoldpgfsupp_pgfcorescopes.code.tex
}%
{%
\pgfplots@iffileexists{pgflibraryfpu.code.tex}{%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
index 64570e7fdc3..6a9a4cc2b5a 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
@@ -1,3 +1,12 @@
+% ======================================================
+% compatibility with PGF 2.10
+% ======================================================
+\def\pgfdeclarelayer#1{%
+ \pgfutil@ifundefined{pgf@layerbox@#1}{%
+ \expandafter\pgf@newbox\csname pgf@layerbox@#1\endcsname%
+ \expandafter\pgf@newbox\csname pgf@layerboxsaved@#1\endcsname%
+ }{}%
+}
% ======================================================
% compatibility with PGF 2.0
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex
index ae77a8e84fc..5ad04db77bb 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
@@ -27,7 +27,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.17 2010/09/01 08:56:40 ludewich Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreexternal.code.tex,v 1.19 2012/06/18 20:39:58 ludewich Exp $
@@ -127,10 +127,32 @@
\ifpgfexternal@aux@in@dpth
\csname newwrite\endcsname\w@pgfexternal@auxout
\fi
+ \pgfexternal@geometry@compatibility
\fi%
\gdef\pgfrealjobname##1{}% avoid multiple calls.
}
+\def\pgfexternal@geometry@compatibility{%
+ % check if \usepackage{geometry} is loaded:
+ \pgfutil@ifundefined{geometry}{%
+ }{%
+ % The geometry package hooks into \begin{document}, evaluates
+ % its driver -- and generates \special instructions to set the
+ % paper size.
+ %
+ % Unfortunately, this confuses dvips utterly - and perhaps
+ % other drivers as well.
+ %
+ % Thus, if we currently about to generate some external
+ % graphics, we WANT to disable geometry (it has no purpose in
+ % this context anyway).
+ %
+ % This here works well:
+ \immediate\write16{Package TikZ externalization: calling \string\geometry{driver=none} during externalization.^^J}%
+ \geometry{driver=none}%
+ }%
+}%
+
\def\pgfexternal@nofiles{%
% replace \relax. The \nofiles macros does
% \let\makeglossary=\relax
@@ -258,13 +280,23 @@
\endgroup
}
-% Defines \pgfexternaldepth to be the depth of the external picture
-% '#1' and \pgfexternaltrimleft / \pgfexternaltrimright to be the 'hbaseline' shift.
-%
+% Reads the .dpth file which contains meta data of the external
+% picture.
+%
+% This command handles the following stuff:
+% - it defines \pgfexternaldepth . The macro contains the contents of
+% a line which does not start with a control sequence (for example a
+% line containing '50pt')
+% - it defines \pgfexternaltrimleft and \pgfexternaltrimright
+% - it checks if the .dpth file contains content stored by means of
+% \pgfexternalstorecommand. If so, the argument of
+% \pgfexternalstorecommand will be restored.
+% - anything else will be appended to the main .aux file, assuming that
+% it contains \label or \ref information (only if the LaTeX switch
+% \if@filesw is \iftrue).
%
-% Furthermore, it handles any auxiliary information stored in the
-% .dpth file (it appends it to the main aux file).
%
+% #1: the image file name (such that #1.dpth exists)
\def\pgfexternalreaddpth#1{%
% no \begingroup. Handle that manually:
\edef\pgfexternalreaddpth@restore{%
@@ -311,6 +343,10 @@
% the .aux file.
%
\expandafter\ifx\pgf@first\pgfexternal@restore
+ % if the first line in the .dpth file starts with the
+ % magic string \pgfexternal@restore, the complete line
+ % will be executed as-is. Example:
+ % \pgfexternal@restore{\def\somevalue{1}}
#1%
\else
% do NOT execute #1! many LaTeX commands don't support it (\label for example)
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorelayers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorelayers.code.tex
new file mode 100644
index 00000000000..bd8a45071ee
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorelayers.code.tex
@@ -0,0 +1,212 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% This file is a copy of some part of PGF/Tikz.
+%%% It has been copied here to provide :
+%%% - compatibility with older PGF versions
+%%% - availability of PGF contributions by Christian Feuersaenger
+%%% which are necessary or helpful for pgfplots.
+%%%
+%%% For reasons of simplicity, I have copied the whole file, including own contributions AND
+%%% PGF parts. The copyrights are as they appear in PGF.
+%%%
+%%% Note that pgfplots has compatible licenses.
+%%%
+%%% This copy has been modified in the following ways:
+%%% - nested \input commands have been updated
+%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
+
+
+
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.4 2011/10/02 17:36:05 ludewich Exp $
+
+
+% Creates a new pgf layer
+%
+% #1 = layer name
+%
+% Declares a new layer for pgf.
+%
+% Example:
+%
+% \pgfdeclarelayer{background}
+
+\def\pgfdeclarelayer#1{%
+ \pgfutil@ifundefined{pgf@layerbox@#1}{%
+ \expandafter\pgf@newbox\csname pgf@layerbox@#1\endcsname%
+ \expandafter\pgf@newbox\csname pgf@layerboxsaved@#1\endcsname%
+ }{}%
+}
+\let\pgf@newbox=\newbox % avoid plain TeX outer problem
+
+% Sets the layers that compose the picture
+%
+% #1 = List of layers
+%
+% Description:
+%
+% Sets the list of layers that make up the picture. The layers will be
+% put on top of each other in the order given.
+%
+% This command can also be given inside of a picture in which case it
+% applies only to that very picture.
+%
+% Example:
+%
+% \pgfsetlayers{background,main}
+
+\def\pgfsetlayers#1{\edef\pgf@layerlist{#1}}
+\pgfsetlayers{main}
+
+% Adds code to a layer
+%
+% #1 = layer name
+%
+% Note:
+%
+% You cannot add anything to the ``main'' layer using this command.
+%
+% Example:
+%
+% \begin{pgfonlayer}{background}
+% \fill[red] (0,0) -- (1,1);
+% \end{pgfonlayer}
+
+\def\pgfonlayer@name{main}
+
+\def\pgfonlayer#1{%
+ \pgfutil@ifundefined{pgf@layerbox@#1}{%
+ \PackageError{pgf}{Sorry, the requested layer '#1' could not be found. Maybe you misspelled it?}{}%
+ \bgroup
+ \begingroup
+ }{%
+ \begingroup
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfonlayer@name
+ % we are already on this layer.
+ \def\pgf@temp{%
+ \bgroup
+ \begingroup
+ }%
+ \else
+ \let\pgfonlayer@name=\pgf@temp
+ \pgfonlayer@assert@is@active
+ \def\pgf@temp{%
+ \expandafter\global\expandafter%
+ \setbox\csname pgf@layerbox@#1\endcsname=\hbox to 0pt%
+ \bgroup%
+ \expandafter\box\csname pgf@layerbox@#1\endcsname%
+ \begingroup%
+ }%
+ \fi
+ \pgf@temp
+ }%
+}
+\def\endpgfonlayer{%
+ \endgroup%
+ \hss
+ \egroup%
+ \endgroup
+}
+
+\let\startpgfonlayer=\pgfonlayer
+\let\stoppgfonlayer=\endpgfonlayer
+
+\def\pgfdiscardlayername{discard}
+
+\def\pgfonlayer@assert@is@active{%
+ \ifx\pgfonlayer@name\pgfdiscardlayername
+ % this special layer name can be used as /dev/null without
+ % warning.
+ \else
+ \begingroup
+ \def\pgfonlayer@isactive{0}%
+ \expandafter\pgf@assert@layer@is@active@loop\pgf@layerlist,,\relax%
+ \if0\pgfonlayer@isactive
+ \pgfonlayer@assert@fail
+ \fi
+ \endgroup
+ \fi
+}%
+\def\pgfonlayer@assert@fail{%
+ \PackageError{pgf}{Sorry, the requested layer '\pgfonlayer@name' is not
+ part of the layer list. Please verify that you provided
+ \string\pgfsetlayers\space and that '\pgfonlayer@name' is part of this list}{}%
+}%
+\def\pgf@assert@layer@is@active@loop#1,#2,\relax{%
+ \edef\pgf@test{#1}%
+ \ifx\pgf@test\pgfonlayer@name
+ \def\pgfonlayer@isactive{1}%
+ \else
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@assert@layer@is@active@loop#2,\relax%
+ \fi%
+ \fi
+}
+
+% Hooks into the scoping:
+
+\def\pgf@insertlayers{%
+ \expandafter\pgf@dolayer\pgf@layerlist,,\relax%
+}
+\def\pgf@maintext{main}%
+\def\pgf@dolayer#1,#2,\relax{%
+ \def\pgf@test{#1}%
+ \ifx\pgf@test\pgf@maintext%
+ \box\pgf@layerbox@main%
+ \else%
+ \pgfsys@beginscope%
+ \expandafter\box\csname pgf@layerbox@#1\endcsname%
+ \pgfsys@endscope%
+ \fi%
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@dolayer#2,\relax%
+ \fi%
+}
+
+\def\pgf@savelayers{%
+ \expandafter\pgf@dosavelayer\pgf@layerlist,,\relax%
+}
+\def\pgf@dosavelayer#1,#2,\relax{%
+ \def\pgf@test{#1}%
+ \ifx\pgf@test\pgf@maintext%
+ \else%
+ \setbox\csname pgf@layerboxsaved@#1\endcsname=\box\csname pgf@layerbox@#1\endcsname%
+ \fi%
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@dosavelayer#2,\relax%
+ \fi%
+}
+
+\def\pgf@restorelayers{%
+ \expandafter\pgf@dorestorelayer\pgf@layerlist,,\relax%
+}
+\def\pgf@dorestorelayer#1,#2,\relax{%
+ \def\pgf@test{#1}%
+ \ifx\pgf@test\pgf@maintext%
+ \else%
+ \global\setbox\csname pgf@layerbox@#1\endcsname=\box\csname pgf@layerboxsaved@#1\endcsname%
+ \fi%
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@dorestorelayer#2,\relax%
+ \fi%
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorescopes.code.tex
new file mode 100644
index 00000000000..5c9a407b9c6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcorescopes.code.tex
@@ -0,0 +1,603 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% This file is a copy of some part of PGF/Tikz.
+%%% It has been copied here to provide :
+%%% - compatibility with older PGF versions
+%%% - availability of PGF contributions by Christian Feuersaenger
+%%% which are necessary or helpful for pgfplots.
+%%%
+%%% For reasons of simplicity, I have copied the whole file, including own contributions AND
+%%% PGF parts. The copyrights are as they appear in PGF.
+%%%
+%%% Note that pgfplots has compatible licenses.
+%%%
+%%% This copy has been modified in the following ways:
+%%% - nested \input commands have been updated
+%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
+
+
+
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.37 2011/10/01 16:25:25 ludewich Exp $
+
+% Globals
+
+\newbox\pgfpic
+\newbox\pgf@hbox
+
+\newbox\pgf@layerbox@main
+
+\newcount\pgf@picture@serial@count
+
+
+
+% This if decides whether the position of pictures on the page is
+% protocolled or not. Normally,
+% this is switched off as it works only with certain drivers and it
+% causes external files to be written. When switched on, the position
+% of pgfpictures are protocolled and can be referenced using
+% \pgfsys@getposition{XXX} where XXX is the value of \pgfpictureid
+% inside the picture.
+\newif\ifpgfrememberpicturepositiononpage
+
+
+
+
+% Scopes
+
+
+% Pgf scope environment. All changes of the graphic state are local to
+% the scope.
+%
+% Example:
+%
+% \begin{pgfscope}
+% \pgfsetlinewidth{3pt}
+% \pgfline{\pgfxy(0,0)}{\pgfxy(3,3)}
+% \end{pgfscope}
+
+\def\pgfscope{%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ \pgfsys@beginscope%
+ \pgf@resetpathsizes%
+ \edef\pgfscope@linewidth{\the\pgflinewidth}%
+ \begingroup}
+\def\endpgfscope{%
+ \endgroup%
+ \global\pgflinewidth=\pgfscope@linewidth%
+ \pgfsys@endscope}
+
+
+
+
+% Quickly insert a box can contain normal TeX text at the origin.
+%
+% #1 = box of width/height and depth 0pt
+%
+% Example:
+%
+% \pgfqbox{\mybox}
+
+\def\pgfqbox#1{%
+ \pgfsys@hbox#1%
+}
+
+
+% Insert a box that can contain normal TeX text at the origin, but
+% with the current coordinate transformation matrix synced with the
+% low-level transformation matrix.
+%
+% #1 = box of width/height and depth 0pt
+%
+% In essence, this command does the same as if you first said
+% \pgflowlevelsynccm and then \pgfqbox. However, pgf will use a
+% ``TeX-translation'' for the translation part of the transformation
+% cm. This will ensure that hyperlinks ``survive'' at least
+% translations.
+%
+% Example:
+%
+% \pgfqboxsynced{\mybox}
+
+\def\pgfqboxsynced#1{%
+ \pgfsys@hboxsynced#1%
+}
+
+
+% Puts some text in a box and inserts it with the current
+% transformations applied.
+%
+% #1 = List of optional positioning. Possible values are ``left'', ``right'',
+% ``top'', ``bottom'' and ``base''.
+% #2 = TeX text. May contain verbatims.
+%
+% Example:
+%
+% \pgftransformshift{\pgfpoint{1cm}{0cm}}
+% \pgftext{Hello World!}
+
+\def\pgftext{\pgfutil@ifnextchar[\pgf@text{\pgf@text[]}}%
+\def\pgf@text[#1]{%
+ \def\pgf@text@options{#1}%
+ \pgf@maketext\pgf@after@text}
+\def\pgf@after@text{%
+ {%
+ \def\pgf@text@hshift{center}%
+ \def\pgf@text@vshift{center}%
+ \expandafter\pgf@text@setkeys\expandafter{\pgf@text@options}%
+ \csname pgf@halign\pgf@text@hshift\endcsname%
+ \csname pgf@valign\pgf@text@vshift\endcsname%
+ % Protocol sizes:
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{0pt}{\dp\pgf@hbox}}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\wd\pgf@hbox}{\dp\pgf@hbox}}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{0pt}{\ht\pgf@hbox}}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \pgf@process{\pgfpointtransformed{\pgfqpoint{\wd\pgf@hbox}{\ht\pgf@hbox}}}%
+ \pgf@protocolsizes{\pgf@x}{\pgf@y}%
+ \pgfqboxsynced{\pgf@hbox}%
+ }%
+}
+\def\pgf@text@setkeys{\pgfqkeys{/pgf/text}}%
+
+\pgfkeys{/pgf/text/left/.code=\def\pgf@text@hshift{left}}
+\pgfkeys{/pgf/text/center/.code=}
+\pgfkeys{/pgf/text/right/.code=\def\pgf@text@hshift{right}}
+\pgfkeys{/pgf/text/top/.code=\def\pgf@text@vshift{top}}
+\pgfkeys{/pgf/text/bottom/.code=\def\pgf@text@vshift{bottom}}
+\pgfkeys{/pgf/text/base/.code=\def\pgf@text@vshift{base}}
+\pgfkeys{/pgf/text/at/.cd,.code=\pgftransformshift{#1},.value required}
+\pgfkeys{/pgf/text/x/.cd,.code=\pgftransformxshift{#1},.value required}
+\pgfkeys{/pgf/text/y/.cd,.code=\pgftransformyshift{#1},.value required}
+\pgfkeys{/pgf/text/rotate/.cd,.code=\pgftransformrotate{#1},.value required}
+
+\def\pgf@halignleft{}% do nothing
+\def\pgf@haligncenter{\pgftransformxshift{+-.5\wd\pgf@hbox}}
+\def\pgf@halignright{\pgftransformxshift{+-\wd\pgf@hbox}}%
+\def\pgf@valignbase{}% do nothing
+\def\pgf@valignbottom{\pgftransformyshift{+\dp\pgf@hbox}}%
+\def\pgf@valigncenter{\pgftransformyshift{+.5\dp\pgf@hbox}\pgftransformyshift{+-.5\ht\pgf@hbox}}%
+\def\pgf@valigntop{\pgftransformyshift{+-\ht\pgf@hbox}}%
+
+
+% Internal function for creating a hbox.
+\def\pgf@maketext#1{%
+ \def\pgf@@maketextafter{#1}%
+ \setbox\pgf@hbox=\hbox\bgroup%
+ \pgfinterruptpicture%
+ \bgroup%
+ \aftergroup\pgf@collectresetcolor%
+ \let\next=%
+}
+\def\pgf@collectresetcolor{%
+ \pgfutil@ifnextchar\reset@color%
+ {\reset@color\afterassignment\pgf@collectresetcolor\let\pgf@temp=}%
+ {\pgf@textdone}%
+}
+\def\pgf@textdone{%
+ \endpgfinterruptpicture%
+ \egroup%
+ \pgf@@maketextafter%
+}
+
+\long\def\pgf@makehbox#1{%
+ \setbox\pgf@hbox=\hbox{{%
+ \pgfinterruptpicture%
+ #1%
+ \endpgfinterruptpicture%
+ }}}
+
+
+
+% Picture environment
+%
+% Example:
+%
+% \begin{pgfpicture}
+% \pgfsetendarrow{\pgfarrowto}
+% \pgfpathmoveto{\pgfpointxy{-0.9}{0.2}}
+% \pgfpathlineto{\pgfpointxy{0.9}{0.4}}
+% \pgfusepath{stroke}
+% \end{pgfpicture}
+
+\newif\ifpgfpicture
+
+\def\pgfresetboundingbox{%
+ \global\pgf@picmaxx=-16000pt\relax%
+ \global\pgf@picminx=16000pt\relax%
+ \global\pgf@picmaxy=-16000pt\relax%
+ \global\pgf@picminy=16000pt\relax%
+}%
+
+\def\pgfpicture{%
+ \begingroup%
+ \pgfpicturetrue%
+ \global\advance\pgf@picture@serial@count by1\relax%
+ \edef\pgfpictureid{pgfid\the\pgf@picture@serial@count}%
+ \let\pgf@nodecallback=\pgfutil@gobble%
+ \pgf@picmaxx=-16000pt\relax%
+ \pgf@picminx=16000pt\relax%
+ \pgf@picmaxy=-16000pt\relax%
+ \pgf@picminy=16000pt\relax%
+ \pgf@relevantforpicturesizetrue%
+ \pgf@resetpathsizes%
+ \pgfutil@ifnextchar\bgroup\pgf@oldpicture\pgf@picture}
+\def\pgf@oldpicture#1#2#3#4{%
+ \pgfmathsetlength\pgf@picminx{#1}%
+ \pgfmathsetlength\pgf@picminy{#2}%
+ \pgfmathsetlength\pgf@picmaxx{#3}%
+ \pgfmathsetlength\pgf@picmaxy{#4}%
+ \pgf@relevantforpicturesizefalse%
+ \pgf@picture}
+
+\def\pgf@picture{%
+ \setbox\pgfpic\hbox to0pt\bgroup%
+ \begingroup%
+ \pgfsys@beginpicture%
+ \pgfsys@beginscope%
+ \begingroup%
+ \pgfsetcolor{.}%
+ \pgfsetlinewidth{0.4pt}%
+ \pgftransformreset%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ \begingroup%
+ \let\pgf@setlengthorig=\setlength%
+ \let\pgf@addtolengthorig=\addtolength%
+ \let\pgf@selectfontorig=\selectfont%
+ \let\setlength=\pgf@setlength%
+ \let\addtolength=\pgf@addtolength%
+ \let\selectfont=\pgf@selectfont%
+ \nullfont\spaceskip0pt\xspaceskip0pt%
+ \setbox\pgf@layerbox@main\hbox to0pt\bgroup%
+ \begingroup%
+ }
+\def\endpgfpicture{%
+ \ifpgfrememberpicturepositiononpage%
+ \hbox to0pt{\pgfsys@markposition{\pgfpictureid}}%
+ \fi%
+ % ok, now let's position the box
+ \ifdim\pgf@picmaxx=-16000pt\relax%
+ % empty picture. make size 0.
+ \global\pgf@picmaxx=0pt\relax%
+ \global\pgf@picminx=0pt\relax%
+ \global\pgf@picmaxy=0pt\relax%
+ \global\pgf@picminy=0pt\relax%
+ \fi%
+ % Shift baseline outside:
+ \pgf@relevantforpicturesizefalse%
+ \pgf@process{\pgf@baseline}%
+ \xdef\pgf@shift@baseline{\the\pgf@y}%
+ %
+ \pgf@process{\pgf@trimleft}%
+ \global\advance\pgf@x by-\pgf@picminx
+ % prepare \hskip\pgf@trimleft@final.
+ % note that \pgf@trimleft@final is also queried
+ % by the pgf image externalization.
+ \xdef\pgf@trimleft@final{-\the\pgf@x}%
+ %
+ \pgf@process{\pgf@trimright}%
+ \global\advance\pgf@x by-\pgf@picmaxx
+ % prepare \hskip\pgf@trimright@final.
+ % note that \pgf@trimright@final is also queried
+ % by the pgf image externalization.
+ \xdef\pgf@trimright@final{\the\pgf@x}%
+ %
+ \pgf@remember@layerlist@globally
+ \endgroup%
+ \hss%
+ \egroup%
+ \pgf@restore@layerlist@from@global
+ \pgf@insertlayers%
+ \endgroup%
+ \pgfsys@discardpath%
+ \endgroup%
+ \pgfsys@endscope%
+ \pgfsys@endpicture%
+ \endgroup%
+ \hss
+ \egroup%
+ \pgfsys@typesetpicturebox\pgfpic%
+ \endgroup%
+}
+
+\def\pgf@remember@layerlist@globally{%
+ \global\let\pgf@layerlist@=\pgf@layerlist
+}%
+\def\pgf@restore@layerlist@from@global{%
+ \let\pgf@layerlist=\pgf@layerlist@
+}%
+\def\pgf@insertlayers{%
+ \box\pgf@layerbox@main%
+}
+
+\def\pgf@selectfont{\pgf@selectfontorig\nullfont}
+
+\def\pgf@setlength#1#2{% these will be used only when \nullfont is active
+ \begingroup% keep font setting local
+ \pgfutil@selectfont% restore font
+ \pgf@setlengthorig#1{#2}% calculate dimension (possibly using calc)
+ \expandafter%
+ \endgroup%
+ \expandafter#1\expandafter=\the#1\relax}
+\def\pgf@addtolength#1#2{%
+ \begingroup% keep font setting local
+ \pgfutil@selectfont% restore font
+ \pgf@addtolengthorig#1{#2}% calculate dimension (possibly using calc)
+ \expandafter%
+ \endgroup%
+ \expandafter#1\expandafter=\the#1\relax}
+
+
+% Sets the baseline at the y-coordinate of a given point
+%
+% #1 = point
+%
+% Sets the baseline of the picture to the y-coordinate of a given
+% point. However, the point will be evaluated *at the end of the
+% picture*.
+%
+% Example:
+%
+% \pgfsetbaselinepointlater{\pgfpointanchor{mynode}{base}}
+
+\def\pgfsetbaselinepointlater#1{\def\pgf@baseline{#1}}
+
+
+% Sets the baseline at the y-coordinate of a given point, now
+%
+% #1 = point
+%
+% Sets the baseline of the picture to the y-coordinate of a given
+% point.
+%
+% Example:
+%
+% \pgfsetbaselinepointnow{\pgfpoint{1cm}{2pt}}
+
+\def\pgfsetbaselinepointnow#1{%
+ \pgf@process{#1}%
+ \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfsetbaselinepointlater{\pgf@setter@baseline}%
+}
+
+\def\pgf@default@text{default}%
+
+% Sets the baseline
+%
+% #1 = baseline
+%
+% Sets the baseline of the picture. Default is the lower border, which
+% is the same as \pgf@picminy
+%
+% Example:
+%
+% \pgfsetbaseline{1cm+2pt}
+% \pgfsetbaseline{default}% resets to default value
+
+\def\pgfsetbaseline#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsetbaseline{\pgf@picminy}%
+ \else
+ \pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}%
+ \fi
+}
+\pgfsetbaseline{\pgf@picminy}
+
+% controls how the image externalization implements trim:
+\newif\ifpgf@trim@lowlevel
+\pgfkeys{
+ /pgf/trim lowlevel/.is if=pgf@trim@lowlevel,
+ /pgf/trim lowlevel/.default=true,
+}
+
+% Same as the y-baseline for horizontal alignment.
+% The effect is different, though: it is some kind of trimming which
+% leaves the bounding box intact.
+\def\pgfsettrimleftpointlater#1{\def\pgf@trimleft{#1}}
+\def\pgfsettrimleftpointnow#1{%
+ \pgf@process{#1}%
+ \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfsettrimleftpointlater{\pgf@setter@baseline}%
+}
+% \pgfsettrimleft{<x coord>}
+% or
+% \pgfsettrimleft{default}
+\def\pgfsettrimleft#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimleft{\pgf@picminx}
+ \else
+ \pgfsettrimleftpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
+}
+\pgfsettrimleft{\pgf@picminx}
+
+\def\pgfsettrimrightpointlater#1{\def\pgf@trimright{#1}}
+\def\pgfsettrimrightpointnow#1{%
+ \pgf@process{#1}%
+ \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
+ \pgfsettrimrightpointlater{\pgf@setter@baseline}%
+}
+% \pgfsettrimright{<x coord>}
+% or
+% \pgfsettrimright{default}
+\def\pgfsettrimright#1{%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgf@default@text
+ \pgfsettrimright{\pgf@picmaxx}%
+ \else
+ \pgfsettrimrightpointlater{\pgfpoint{#1}{0pt}}%
+ \fi
+}
+\pgfsettrimright{\pgf@picmaxx}
+
+
+% Interrupt path
+%
+% Description:
+%
+% The environment can be used to insert some drawing commands while
+% constructing a path. The drawing commands inside the environment
+% will not interfere with the path being constructed ``outside.''
+% However, you must ward against graphic state changes using a scope.
+%
+% Example: Draw two parallel lines
+%
+% \pgfmoveto{\pgfpoint{0cm}{0cm}}
+% \begin{pgfinterruptpath}
+% \pgfmoveto{\pgfpoint{1cm}{0cm}}
+% \pgfmoveto{\pgfpoint{1cm}{1cm}}
+% \pgfusepath{stroke}
+% \end{pgfinterruptpath}
+% \pgflineto{\pgfpoint{0cm}{1cm}}
+% \pgfusepath{stroke}
+
+\def\pgfinterruptpath
+{%
+ \begingroup%
+ % save all sorts of things...
+ \edef\pgf@interrupt@savex{\the\pgf@path@lastx}%
+ \edef\pgf@interrupt@savey{\the\pgf@path@lasty}%
+ \pgf@getpathsizes\pgf@interrupt@pathsizes%
+ \pgfsyssoftpath@getcurrentpath\pgf@interrupt@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ \edef\pgfscope@linewidth{\the\pgflinewidth}%
+ \let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto%
+ \begingroup%
+}
+\def\endpgfinterruptpath
+{%
+ \endgroup%
+ \global\pgflinewidth=\pgfscope@linewidth%
+ \pgfsyssoftpath@setcurrentpath\pgf@interrupt@path%
+ \pgf@setpathsizes\pgf@interrupt@pathsizes%
+ \global\pgf@path@lastx=\pgf@interrupt@savex%
+ \global\pgf@path@lasty=\pgf@interrupt@savey%
+ \global\let\pgfsyssoftpath@lastmoveto=\pgf@interrupt@lastmoveto%
+ \endgroup%
+}
+
+
+
+% Interrupt bounding box
+%
+% Description:
+%
+% The environment can be used to temporarily setup a new bounding box
+% computation. The bounding box will be made empty at the beginning of
+% the environment and will be reset to its old value after the
+% environment.
+%
+% Example:
+%
+% \begin{pgfinterruptboundinbox}
+% \pgfmoveto{\pgfpoint{1cm}{0cm}}
+% \pgfmoveto{\pgfpoint{1cm}{1cm}}
+% \pgfusepath{stroke}
+% \end{pgfinterruptboundinbox}
+
+\def\pgfinterruptboundingbox
+{%
+ \begingroup%
+ \edef\pgf@interrupt@savemaxx{\the\pgf@picmaxx}%
+ \edef\pgf@interrupt@saveminx{\the\pgf@picminx}%
+ \edef\pgf@interrupt@savemaxy{\the\pgf@picmaxy}%
+ \edef\pgf@interrupt@saveminy{\the\pgf@picminy}%
+ \pgf@picmaxx=-16000pt\relax%
+ \pgf@picminx=16000pt\relax%
+ \pgf@picmaxy=-16000pt\relax%
+ \pgf@picminy=16000pt\relax%
+ \pgf@size@hookedfalse%
+ \let\pgf@path@size@hook=\pgfutil@empty%
+}
+\def\endpgfinterruptboundingbox
+{%
+ \global\pgf@picmaxx=\pgf@interrupt@savemaxx%
+ \global\pgf@picmaxy=\pgf@interrupt@savemaxy%
+ \global\pgf@picminx=\pgf@interrupt@saveminx%
+ \global\pgf@picminy=\pgf@interrupt@saveminy%
+ \endgroup%
+}
+
+
+
+
+
+% Interrupts a picture
+%
+% Description:
+%
+% This environment interrupts a picture and temporarily returns to
+% normal TeX mode. All sorts of things are saved and restored by this
+% environment.
+%
+% WARNING: Using this environment in conjuction with low level
+% transformations can *strongly* upset the typesetting. Typically, the
+% contents of this environment should have size/height/depth 0pt in
+% the end.
+%
+% WARNING: This environment should only be used inside typesetting a
+% box and this box must in turn be inserted using \pgfqbox.
+%
+% Example: Draw two parallel lines
+%
+% \pgfmoveto{\pgfpoint{0cm}{0cm}}
+% \setbox\mybox=\hbox{
+% \begin{pgfinterruptpicture}
+% This is normal text.
+% \begin{pgfpicture} % a subpicture
+% \pgfmoveto{\pgfpoint{1cm}{0cm}}
+% \pgfmoveto{\pgfpoint{1cm}{1cm}}
+% \pgfusepath{stroke}
+% \end{pgfpicture}
+% More text.
+% \end{pgfinterruptpicture}
+% }
+% \ht\mybox=0pt
+% \wd\mybox=0pt
+% \dp\mybox=0pt
+% \pgfqbox{\mybox}%
+% \pgfpathlineto{\pgfpoint{0cm}{1cm}}
+% \pgfusepath{stroke}
+
+\def\pgfinterruptpicture
+{%
+ \begingroup%
+ \pgfinterruptboundingbox%
+ \pgftransformreset%
+ \pgfinterruptpath%
+ \ifx\pgf@selectfontorig\@undefined%
+ \else%
+ \let\setlength\pgf@setlengthorig%
+ \let\addtolength\pgf@addtolengthorig%
+ \let\selectfont\pgf@selectfontorig%
+ \fi%
+ \pgfutil@selectfont%
+ \pgfpicturefalse%
+ \let\pgf@positionnodelater@macro\relax%
+ \pgf@savelayers%
+}
+\def\endpgfinterruptpicture
+{%
+ \pgf@restorelayers%
+ \endpgfinterruptpath%
+ \endpgfinterruptboundingbox%
+ \endgroup%
+}
+
+\let\pgf@savelayers=\relax
+\let\pgf@restorelayers=\relax
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex
index 02fe32acd2b..c933914a9c4 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeys.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
@@ -466,8 +466,7 @@
#1% ok, always true if the USER explicitly provided the full key path.
\fi
}%
-\def\pgfkeysaddhandlyonlyexistingexception#1{\expandafter\def\csname pgfk@excpt@#1\endcsname{1}}%
-
+\def\pgfkeysaddhandleonlyexistingexception#1{\expandafter\def\csname pgfk@excpt@#1\endcsname{1}}%
\def\pgfkeys@unknown{%
\pgfkeysifdefined{\pgfkeyscurrentpath/.unknown/.@cmd}%
@@ -1051,13 +1050,13 @@
\let\pgfkeys@case@three=\pgfkeys@case@three@handle@restricted
\let\pgfkeys@ifexecutehandler=\pgfkeys@ifexecutehandler@handlefullorexisting
},
- /handler config/only existing/add exception/.code={\pgfkeysaddhandlyonlyexistingexception{#1}},
+ /handler config/only existing/add exception/.code={\pgfkeysaddhandleonlyexistingexception{#1}},
}%
-\pgfkeysaddhandlyonlyexistingexception{.cd}%
-\pgfkeysaddhandlyonlyexistingexception{.try}%
-\pgfkeysaddhandlyonlyexistingexception{.retry}%
-\pgfkeysaddhandlyonlyexistingexception{.lastretry}%
-\pgfkeysaddhandlyonlyexistingexception{.unknown}%
+\pgfkeysaddhandleonlyexistingexception{.cd}%
+\pgfkeysaddhandleonlyexistingexception{.try}%
+\pgfkeysaddhandleonlyexistingexception{.retry}%
+\pgfkeysaddhandleonlyexistingexception{.lastretry}%
+\pgfkeysaddhandleonlyexistingexception{.unknown}%
\input pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
index 5d9ad0a5504..51a3f911a57 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
index 5183f85fc8e..be3a2179c6b 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
@@ -591,6 +591,7 @@
\let\pgfmath@basic@lessthan@=\pgfmathlessthan@
\let\pgfmath@basic@greaterthan@=\pgfmathgreaterthan@
\let\pgfmath@basic@equalto@=\pgfmathequalto@
+\let\pgfmath@basic@equal@=\pgfmathequal@
\let\pgfmath@basic@true@=\pgfmathtrue@
\let\pgfmath@basic@false@=\pgfmathfalse@
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
index e95a9a9957c..22127f8f1d3 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex
index 4d59a1cba1b..d553f4c4272 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex
index 75a23d73422..c9eacad8bf6 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex
index e3280455bb4..51a4122f811 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
index 2f2ce4d9716..4a795f89cd5 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
@@ -30,7 +30,28 @@
% This file contains methods for basic floating point arithmetics, rounding
% to arbitrary precision and number pretty printing.
%
-% Version 1.0 2008/09/17
+
+
+\pgfkeys{
+ % The bug 3430171 (wrong minus sign spacing in pgfmathprintnumber)
+ % has been fixed in 2.10 CVS. Since it changes the spacing, its
+ % effects can be undone with this compatibility switch.
+ /pgf/compat/number printer/.is choice,
+ /pgf/compat/number printer/2.10/.code={%
+ \def\pgfmathprintnumber@begingroup{\bgroup}%
+ \def\pgfmathprintnumber@endgroup{\egroup}%
+ },
+ % I do not know the version number of the next release at this
+ % time. Please be so kind and KEEP THIS NAME INTACT. Add an alias
+ % if needed.
+ /pgf/compat/number printer/next after 2.10/.code={%
+ \def\pgfmathprintnumber@begingroup{\begingroup}%
+ \def\pgfmathprintnumber@endgroup{\endgroup}%
+ },
+ % activate the fix by default.
+ /pgf/compat/number printer/next after 2.10,%
+}
+
\global\newif\ifpgfmathfloatcomparison
\newif\ifpgfmathfloatroundhasperiod
@@ -817,23 +838,23 @@
% #1: the part before the exponent code
% #2: the part for the exponent code.
\def\pgfmathfloatrounddisplaystyle@shared@impl@#1#2{%
- \begingroup
+ \pgfmathprintnumber@begingroup
\toks0={#1}%
\toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}%
\xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 }%
- \endgroup
+ \pgfmathprintnumber@endgroup
\let\pgfmathresult=\pgfmathfloat@glob@TMP
}%
% Same as \pgfmathfloatrounddisplaystyle@shared@impl@, but it also
% inserts the '@dec sep mark' at the end.
\def\pgfmathfloatrounddisplaystyle@shared@impl@@#1#2{%
- \begingroup
+ \pgfmathprintnumber@begingroup
\toks0={#1}%
\toks1=\expandafter{\pgfmathfloatrounddisplaystyle@e@mark #2}%
\pgfkeysgetvalue{/pgf/number format/@dec sep mark}\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK
\toks2=\expandafter{\pgfmathprintnumber@fixed@styleDEFAULT@DEC@SEP@MARK}%
\xdef\pgfmathfloat@glob@TMP{\the\toks0 \the\toks1 \the\toks2 }%
- \endgroup
+ \pgfmathprintnumber@endgroup
\let\pgfmathresult=\pgfmathfloat@glob@TMP
}
@@ -848,11 +869,11 @@
}
\def\pgfmathfloatrounddisplaystyle@e#1#2e#3\relax{%
\ifnum#3<0\relax
- \begingroup
+ \pgfmathprintnumber@begingroup
\count0=#3\relax
\multiply\count0 by-1
\xdef\pgfmathfloat@glob@TMP{e{-}\the\count0}%
- \endgroup%
+ \pgfmathprintnumber@endgroup%
\let\pgfmathresult=\pgfmathfloat@glob@TMP
\else
\def\pgfmathresult{e{+}#3}%
@@ -862,11 +883,11 @@
}
\def\pgfmathfloatrounddisplaystyle@E#1#2e#3\relax{%
\ifnum#3<0\relax
- \begingroup
+ \pgfmathprintnumber@begingroup
\count0=#3\relax
\multiply\count0 by-1
\xdef\pgfmathfloat@glob@TMP{E{-}\the\count0}%
- \endgroup%
+ \pgfmathprintnumber@endgroup%
\let\pgfmathresult=\pgfmathfloat@glob@TMP
\else
\def\pgfmathresult{E{+}#3}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
index 550951ca3b5..cbd3b957c6e 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
index d49d8d634c4..17feb576361 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
@@ -47,6 +47,7 @@
\toksdef\t@tikzexternal@tmpb=1
\newif\iftikzexternal@nestedflag
+\newif\iftikzexternal@verboseuptodate
\newif\iftikzexternal@verboseio
\newif\iftikzexternal@genfigurelist
\newif\iftikzexternal@onlynamed
@@ -170,9 +171,11 @@
verbose IO/.default=true,
verbose IO=true,
verbose optimize/.is if=tikzexternal@verbose@optimize,
+ verbose up to date/.is if=tikzexternal@verboseuptodate,
verbose/.style={
verbose IO=#1,
verbose optimize=#1,
+ verbose up to date=#1,
},
shell escape/.initial=-shell-escape,
read main aux/.is if=pgfexternalreadmainaux,
@@ -271,6 +274,18 @@
\expandafter\gdef\csname c@tikzext@no@#1\endcsname{0}%
},%
prefix/.code={\tikzsetexternalprefix{#1}},
+ up to date check/.is choice,
+ up to date check/simple/.code={\def\tikzexternal@uptodate@mode{0}},
+ % md5 relies on \pdfmdfivesum of pdftex. It uses 'diff' as fallback if we do not have that command.
+ up to date check/md5/.code={%
+ \pgfutil@ifundefined{pdfmdfivesum}{%
+ \pgfkeys{/tikz/external/up to date check=diff}%
+ }{%
+ \def\tikzexternal@uptodate@mode{1}%
+ }%
+ },
+ up to date check/diff/.code={\def\tikzexternal@uptodate@mode{2}},
+ up to date check=md5,
}
\def\tikzsetfigurename#1{\pgfkeyssetvalue{/tikz/external/figure name}{#1}}%
@@ -1103,7 +1118,7 @@
}%
\long\def\tikzexternal@optimize@away@latex@env@close#1{%
\iftikzexternal@verbose@optimize
- \immediate\write16{The complete contents of \string\begin{tikzexternal@optimize@away@latex@env@} up to the next \end{tikzexternal@optimize@away@latex@env@} has been optimized away because it does not contribute to exported PDF. Use '/tikz/external/optimize=false' to disable this.}%
+ \immediate\write16{The complete contents of \string\begin{tikzexternal@optimize@away@latex@env@} up to the next \end{tikzexternal@optimize@away@latex@env@} has been optimized away because it does not contribute to the exported PDF. Use '/tikz/external/optimize=false' to disable this.}%
\fi
\endgroup
% we still need to invoke \end{<name>} in latex because \begin{<name>}
@@ -1181,7 +1196,8 @@
\def\tikzexternal@forcegraphics{%
\tikzexternal@TEXDIALECT@collectpicture\tikzexternal@forcegraphics@@
}
-\long\def\tikzexternal@forcegraphics@@#1{%
+\long\def\tikzexternal@forcegraphics@@#1{\tikzexternal@forcegraphics@@@}%
+\def\tikzexternal@forcegraphics@@@{%
\expandafter\pgfincludeexternalgraphics\expandafter{\tikzexternal@curfilename}%
\tikzexternal@closeenvironments
}
@@ -1191,7 +1207,8 @@
\def\tikzexternal@listmodepicture{%
\tikzexternal@TEXDIALECT@collectpicture\tikzexternal@listmodepicture@@
}
-\long\def\tikzexternal@listmodepicture@@#1{%
+\long\def\tikzexternal@listmodepicture@@#1{\tikzexternal@listmodepicture@@@}
+\def\tikzexternal@listmodepicture@@@{%
\pgfkeysvalueof{/tikz/external/image discarded text}%
\tikzexternal@closeenvironments
}
@@ -1199,15 +1216,21 @@
% check if there is already a file.
% In that case, use it. If not, skip it.
\def\tikzexternal@list@and@makefile@mode@picture{%
+ \tikzexternal@TEXDIALECT@collectpicture\tikzexternal@list@and@makefile@mode@picture@
+}%
+\long\def\tikzexternal@list@and@makefile@mode@picture@#1{%
+ %
+ \tikzexternal@check@uptodate@mode{#1}%
+ %
\gdef\pgf@filename{}%
\xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
\pgf@tempa
\ifx\pgf@filename\pgfutil@empty%
% Note: since we have no 'GRAB' mode, we do not have to deal with optimization.
% there is no graphics.
- \expandafter\tikzexternal@listmodepicture
+ \expandafter\tikzexternal@listmodepicture@@@
\else
- \expandafter\tikzexternal@forcegraphics
+ \expandafter\tikzexternal@forcegraphics@@@
\fi
}%
@@ -1309,7 +1332,7 @@
\endgroup
}%
\long\def\tikzexternal@externalizefig@systemcall@@#1{%
- \tikzexternal@externalizefig@systemcall@uptodatecheck%
+ \tikzexternal@externalizefig@systemcall@uptodatecheck{#1}%
\iftikzexternal@file@isuptodate
\iftikzexternal@verboseio
\immediate\write16{===== Image '\tikzexternal@curfilename' is up-to-date. ======}%
@@ -1376,6 +1399,99 @@
\fi
}
+\long\def\tikzexternal@computemdfivesum#1{%
+ \t@tikzexternal@tmpb={#1}%
+ \edef\tikzexternal@temp{\the\t@tikzexternal@tmpb}%
+ % \meaning results in a string of catcode 12 - which is expandable.
+ \edef\pgfretval{\pdfmdfivesum{\meaning\tikzexternal@temp}}%
+}
+\long\def\tikzexternal@computemdfivesum@diff@fallback#1{%
+ \t@tikzexternal@tmpb={#1}%
+ \edef\tikzexternal@temp{\the\t@tikzexternal@tmpb}%
+ % \meaning results in a string of catcode 12 - which is expandable.
+ \edef\pgfretval{\meaning\tikzexternal@temp}%
+}
+
+% Will be set dynamically, depending on 'up to date check'.
+%
+% It expands to code such that \tikzexternallastkey contains the
+% serialized version of '#1'.
+%
+% It is used as argument for \write{..}
+%
+% #1 the hash key to serialize.
+% \def\tikzexternal@hashfct@serialize
+\long\def\tikzexternal@hashfct@serialize@std#1{%
+ \noexpand\def\noexpand\tikzexternallastkey{#1}%
+}%
+
+% serializes using temporary token registers. Necessary if #1 contains
+% executable code.
+\long\def\tikzexternal@hashfct@serialize@tok#1{%
+ \noexpand\begingroup
+ % in order to allow '#' inside of the body, we have to use token registers:
+ \noexpand\toks0={#1}%
+ \noexpand\xdef\noexpand\tikzexternallastkey{\noexpand\the\noexpand\toks0 }%
+ \noexpand\endgroup
+}%
+
+\def\tikzexternal@check@uptodate@ext{.md5}
+
+% assigns the boolean \iftikzexternal@file@isuptodate
+\long\def\tikzexternal@check@uptodate@mode#1{%
+ \ifcase\tikzexternal@uptodate@mode
+ % up to date check=simple
+ % nothing to do -- file existance is checked anyway.
+ \let\tikzexternal@hashfct=\pgfutil@empty
+ \let\tikzexternal@hashfct@serialize=\pgfutil@empty
+ \or
+ % up to date check=md5
+ \let\tikzexternal@hashfct=\tikzexternal@computemdfivesum
+ \let\tikzexternal@hashfct@serialize=\tikzexternal@hashfct@serialize@std
+ \or
+ \let\tikzexternal@hashfct=\tikzexternal@computemdfivesum@diff@fallback
+ \let\tikzexternal@hashfct@serialize=\tikzexternal@hashfct@serialize@tok
+ \fi
+ \ifx\tikzexternal@hashfct\pgfutil@empty
+ \else
+ \tikzpicturedependsonfile{\tikzexternal@curfilename\tikzexternal@check@uptodate@ext}%
+ \tikzexternal@hashfct{#1}%
+ \let\tikzexternal@lastkey@new=\pgfretval
+ \begingroup
+ % no '@' token in this macro: avoid messing up the catcodes in input files:
+ \global\let\tikzexternallastkey=\pgfutil@empty
+ \openin\r@pgf@reada=\tikzexternal@curfilename\tikzexternal@check@uptodate@ext\relax %
+ \ifeof\r@pgf@reada
+ \else
+ % read first line...
+ \read\r@pgf@reada to\pgf@tempa
+ % ... and execute it.
+ \pgf@tempa
+ % it should contain a definition of \tikzexternallastkey.
+ \fi
+ \closein\r@pgf@reada
+ %
+ \let\tikzexternal@lastkey=\tikzexternallastkey
+ \pgfmath@smuggleone\tikzexternal@lastkey
+ \endgroup
+ % normalize catcodes. Unfortunately, they cannot be expected to be the same.
+ % \meaning will use catcode 12 for each token:
+ \edef\tikzexternal@lastkey@normalized{\meaning\tikzexternal@lastkey}%
+ \edef\tikzexternal@lastkey@new@normalized{\meaning\tikzexternal@lastkey@new}%
+ \iftikzexternal@verboseuptodate
+ \immediate\write16{Up-to-date check of \tikzexternal@curfilename: new \tikzexternal@lastkey@new@normalized; old \tikzexternal@lastkey@normalized.^^J}%
+ \fi
+ \ifx\tikzexternal@lastkey@normalized\tikzexternal@lastkey@new@normalized
+ \tikzexternal@file@isuptodatetrue
+ \else
+ \tikzexternal@file@isuptodatefalse
+ \immediate\openout\w@pgf@writea=\tikzexternal@curfilename\tikzexternal@check@uptodate@ext\relax%
+ \immediate\write\w@pgf@writea{\tikzexternal@hashfct@serialize{\tikzexternal@lastkey@new}}%
+ \immediate\closeout\w@pgf@writea
+ \fi
+ \fi
+}
+
% Checks whether the current picture needs to be externalized.
%
% This is the case if
@@ -1383,9 +1499,13 @@
% b) the picture has been invalidated manually.
%
% It returns \iftikzexternal@file@isuptodate accordingly.
-\def\tikzexternal@externalizefig@systemcall@uptodatecheck{%
+% #1: the picture-content
+\long\def\tikzexternal@externalizefig@systemcall@uptodatecheck#1{%
\tikzexternal@checkforceremake
\iftikzexternal@file@isuptodate
+ \tikzexternal@check@uptodate@mode{#1}%
+ \fi
+ \iftikzexternal@file@isuptodate
% check if there is already a file.
% In that case, use it. If that is not the case, generate it and include it afterwards.
\gdef\pgf@filename{}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
index b83ab9123e5..aca706b459f 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex
@@ -14,7 +14,7 @@
%%% - nested \input commands have been updated
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Do 29. Dez 12:39:03 CET 2011 %%%
+%%% Date of this copy: Fr 17. Aug 20:12:53 CEST 2012 %%%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex
index 7e2316ee45a..7bf4e86b27a 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex
@@ -34,6 +34,7 @@
\input pgfplotscolormap.code.tex
\input pgfplotsstackedplots.code.tex
\input pgfplotsplothandlers.code.tex
+\input pgfplots.scaling.code.tex
\input pgfplotscoordprocessing.code.tex
\input pgfplotsticks.code.tex
\input pgfplots.paths.code.tex
@@ -49,12 +50,12 @@
\newif\ifpgfplots@has@label@information
\newif\ifpgfplots@yislinear
\newif\ifpgfplots@zislinear
-\newif\ifpgfplots@unit@vector@rescale@keep@size
\newif\ifpgfplots@reverse@legend
\newif\ifpgfplots@transpose@legend
\newif\ifpgfplots@allow@reversal@of@rel@axis@cs
\newif\ifpgfplots@scanline@verbose
\newif\ifpgfplots@plot@graphics@autoadjustaxis
+\newif\ifpgfplots@scaleuniformly@warning
\newcount\pgfplots@numplots
\newdimen\pgfplots@xmin@reg
\newdimen\pgfplots@xmax@reg
@@ -68,7 +69,6 @@
\newif\ifpgfplots@clip
\newif\ifpgfplots@plot@coords@mathparser
\pgfplots@plot@coords@mathparsertrue
-\pgfplots@cliptrue
\newif\ifpgfplots@enlargelimits
\newif\ifpgfplots@enlargelimits@rel@thresh
\newif\ifpgfplots@enlargelimits@auto
@@ -121,6 +121,7 @@
\let\pgfnodepartimagebox=\pgfnodeparttextbox
\newif\ifpgfplotsplothandlermesh@internaldepth
\newif\ifpgfplotsplothandlermesh@hide@refined@edges
+\newif\ifpgfplots@has@cell@picture
\newif\ifpgfplots@collect@firstplot@astick
\newif\ifpgfplots@units@use
@@ -485,6 +486,16 @@
%
}%
+\newif\ifpgfplotsplothandlermesh@shownormals
+
+\pgfkeys{%
+ % <key name>/.define layer set={<layer list>}{<style definition>}
+ /handlers/.define layer set/.code 2 args={%
+ \pgfkeyssetvalue{\pgfkeyscurrentpath/list}{#1}%
+ \pgfkeysdef{\pgfkeyscurrentpath}{\pgfkeysalso{#2}}%
+ }%
+}
+
\pgfkeys{%
/pgfplots/search path for tikz/.search also={/tikz,/pgfplots},
/pgfplots/.is family,
@@ -497,6 +508,73 @@
/pgfplots/naming commands/.is family,
/pgfplots/shared with tikz/.is family,
/pgfplots/error bars/.is family,
+ %
+ % pgfplots uses the following (implicit) layers:
+ % context: & associated layer name: \\
+ % background path & axis background \\
+ % grid lines & axis grid \\
+ % tick lines & axis ticks \\
+ % axis lines & axis lines \\
+ % tick labels & axis tick labels \\
+ % plots & main \\
+ % axis descriptions & axis descriptions \\
+ % plot marks & (see 'mark layer')\\
+ % the 'axis on top' key will change that order by moving all plot- and mark-related paths upwards (they are drawn earlier).
+ % None of these layers is mandatory; each can be omitted.
+ % The magic layer name 'discard' can be used as /dev/null layer.
+ %
+ % the <layer set name> must be defined
+ % set layers={<layer set name>}
+ /pgfplots/set layers/.code={%
+ \def\pgfplots@loc@TMPa{#1}%
+ \def\pgfplots@loc@TMPb{none}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ \pgfkeysalso{%
+ /pgfplots/activate layers=false,
+ /pgfplots/set layers*={},
+ }%
+ \else
+ \pgfkeysalso{%
+ /pgfplots/activate layers=true,
+ /pgfplots/set layers*={#1},
+ }%
+ \pgfplotsifinaxis{%
+ \pgfkeysalso{/pgfplots/cell picture=if necessary}%
+ }{%
+ % we wrote it outside of an axis. In this case, we can
+ % assume that it prepares multiple axis - which
+ % REQUIRES to disable cell pictures.
+ \pgfkeysalso{/pgfplots/cell picture=false}%
+ }%
+ \fi
+ },
+ % 'activate layers=false' is the same as 'set layers=none'.
+ % However, 'activate layers=true' does not work unless a 'set layers'
+ % has been installed as well.
+ /pgfplots/activate layers/.is if=pgfplots@layered@graphics,
+ /pgfplots/activate layers/.default=true,
+ /pgfplots/set layers*/.code=\pgfplots@key@set@layers{#1},
+ /pgfplots/set layers*/.default={/pgfplots/layers/standard},
+ /pgfplots/@set layers arg/.initial=,
+ /pgfplots/layers/.search also=/pgfplots,
+ /pgfplots/layers/standard/.define layer set={axis background,axis grid,axis ticks,axis lines,axis tick labels,main,axis descriptions,axis foreground}{
+ grid style= {/pgfplots/on layer=axis grid},
+ tick style= {/pgfplots/on layer=axis ticks},
+ axis line style= {/pgfplots/on layer=axis lines},
+ label style= {/pgfplots/on layer=axis descriptions},
+ legend style= {/pgfplots/on layer=axis descriptions},
+ title style= {/pgfplots/on layer=axis descriptions},
+ colorbar style= {/pgfplots/on layer=axis descriptions},
+ ticklabel style= {/pgfplots/on layer=axis tick labels},
+ axis background@ style={/pgfplots/on layer=axis background},
+ 3d box foreground style={/pgfplots/on layer=axis foreground},
+ },
+ /pgfplots/layers/axis on top/.define layer set={axis background,main,axis grid,axis ticks,axis lines,axis tick labels,axis descriptions,axis foreground}{
+ /pgfplots/layers/standard
+ },
+ /pgfplots/on layer/.initial=,
+ % mark layer can be 'auto', 'like plot', or a layer name.
+ /pgfplots/mark layer/.initial=,
/pgfplots/every axis/.style={},
/pgfplots/every axis/.append code={\pgfplotsdeprecatedstylecheck{/tikz/every axis}},
/pgfplots/every axis/.belongs to family=/pgfplots/style commands,
@@ -1349,6 +1427,11 @@
/pgfplots/anchor/.belongs to family=/pgfplots,
/pgfplots/anchor/.store in= \pgfplots@anchorname,
/pgfplots/anchor=south west,
+ /pgfplots/cell picture/.is choice,
+ /pgfplots/cell picture/false/.code=\def\pgfplots@cell@picture@mode{0},
+ /pgfplots/cell picture/true/.code=\def\pgfplots@cell@picture@mode{1},
+ /pgfplots/cell picture/if necessary/.code=\def\pgfplots@cell@picture@mode{2},
+ /pgfplots/cell picture/true, % backwards compatibility
/pgfplots/log origin x/.is choice,
/pgfplots/log origin x/infty/.code={\def\pgfplots@log@origin@choice@x{0}},
/pgfplots/log origin x/0/.code={\def\pgfplots@log@origin@choice@x{1}},
@@ -1570,8 +1653,25 @@
/pgfplots/clip limits=true,
/pgfplots/clip limits/.belongs to family=/pgfplots,
/pgfplots/clip/.is if=pgfplots@clip,
+ /pgfplots/clip/.default=true,
+ /pgfplots/clip=true,
+ /pgfplots/clip mode/.is choice,
+ /pgfplots/clip mode/global/.code= \def\pgfplots@clipmode{1},
+ % this choice is implemented partially only (only for plots, not for
+ % graphical elements):
+ /pgfplots/clip mode/individual/.code= \def\pgfplots@clipmode{2},
+ /pgfplots/clip mode=global,
% will be used if it exists:
- %/pgfplots/axis background/.style={},
+ /pgfplots/axis background/.style={},
+ /pgfplots/axis background style/.style={/pgfplots/axis background/.append style={#1}},
+ %
+ % the 'axis background@' style is an optimization: it will only be
+ % used if 'axis background' is non-empty.
+ % The motivation is that once 'axis background' is non-empty, a
+ % background path will be generated whereas the 'axis background@'
+ % style can be changed at will.
+ /pgfplots/axis background@/.style={},
+ /pgfplots/axis background@ style/.style={/pgfplots/axis background@/.append style={#1}},
%
% 2d: 'unit vector ratio=2 1 is relative to y axis (x is twice as large as y)
% 3d: 'unit vector ratio=2 2 1 is relative to z axis (x and y are both twice as large as z)
@@ -1582,9 +1682,12 @@
/pgfplots/unit vector ratio={#1},
/pgfplots/unit rescale keep size=false,
},
- /pgfplots/unit rescale keep size/.is if=pgfplots@unit@vector@rescale@keep@size,
+ /pgfplots/unit rescale keep size/.is choice,
+ /pgfplots/unit rescale keep size/true/.code={\def\pgfplots@unit@vector@rescale@keep@size{1}},
+ /pgfplots/unit rescale keep size/false/.code={\def\pgfplots@unit@vector@rescale@keep@size{0}},
+ /pgfplots/unit rescale keep size/unless limits declared/.code={\def\pgfplots@unit@vector@rescale@keep@size{2}},
/pgfplots/unit rescale keep size/.default=true,
- /pgfplots/unit rescale keep size=true,
+ /pgfplots/unit rescale keep size=unless limits declared,
/pgfplots/axis equal/.is choice,
/pgfplots/axis equal/true/.style={
/pgfplots/unit vector ratio=1 1 1,
@@ -1672,27 +1775,32 @@
\def\pgfplots@loc@TMPb##1:##2\relax{%
\pgfkeysalso{%
/pgfplots/#1 filter/.append code={%
+ \pgfplots@warn@if@log@basis@unset{#1}{domain restriction}%
\let\pgfplots@restrict@to@domain@orig=\pgfmathresult
- \def\pgfplots@restrict@to@domain@tmp{#2}%
- \ifx\pgfplots@restrict@to@domain@tmp\pgfutil@empty
- % we don't have an expression.
+ \ifx\pgfmathresult\pgfutil@empty
+ % the input value is empty... skip it!
\else
- % evaluate the expression!
- \pgfmathparse{#2}%
+ \def\pgfplots@restrict@to@domain@tmp{#2}%
+ \ifx\pgfplots@restrict@to@domain@tmp\pgfutil@empty
+ % we don't have an expression.
+ \else
+ % evaluate the expression!
+ \pgfmathparse{#2}%
+ \fi
+ \pgfplotscoordmath{default}{parsenumber}{\pgfmathresult}%
+ \let\pgfplots@restrict@to@domain@tmp=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{if less than}
+ {\pgfplots@restrict@to@domain@tmp}{##1}% ##1 is the lower argument
+ {%
+ \edef\pgfmathresult{\if0#4inf\else ##1\fi}%
+ }{%
+ \pgfplotscoordmath{default}{if less than}
+ {##2}{\pgfplots@restrict@to@domain@tmp}
+ {\edef\pgfmathresult{\if0#4-inf\else ##2\fi}}
+ {\let\pgfmathresult=\pgfplots@restrict@to@domain@orig}%
+ }%
\fi
- \pgfplotscoordmath{default}{parsenumber}{\pgfmathresult}%
- \let\pgfplots@restrict@to@domain@tmp=\pgfmathresult
- %
- \pgfplotscoordmath{default}{if less than}
- {\pgfplots@restrict@to@domain@tmp}{##1}% ##1 is the lower argument
- {%
- \edef\pgfmathresult{\if0#4inf\else ##1\fi}%
- }{%
- \pgfplotscoordmath{default}{if less than}
- {##2}{\pgfplots@restrict@to@domain@tmp}
- {\edef\pgfmathresult{\if0#4-inf\else ##2\fi}}
- {\let\pgfmathresult=\pgfplots@restrict@to@domain@orig}%
- }%
}%
}%
}%
@@ -1829,6 +1937,21 @@
/pgfplots/scale mode/stretch to fill/.code={\def\pgfplots@scale@mode@choice{2}},
/pgfplots/scale mode/scale uniformly/.code={\def\pgfplots@scale@mode@choice{3}},
/pgfplots/scale mode/auto,
+ /pgfplots/scale uniformly strategy/.is choice,
+ % chooses one of the other choices depending on the target
+ % width/height:
+ /pgfplots/scale uniformly strategy/auto/.code= {\def\pgfplots@scaleuniformly@choice{0}},
+ % scales units only, but does not compensate limits:
+ /pgfplots/scale uniformly strategy/units only/.code= {\def\pgfplots@scaleuniformly@choice{1}},
+ % changes only vertical limits, no horizontal limits:
+ /pgfplots/scale uniformly strategy/change vertical limits/.code= {\def\pgfplots@scaleuniformly@choice{2}},
+ % changes X and Y limits, but not Z limits - adjusts scale accordingly:
+ /pgfplots/scale uniformly strategy/change horizontal limits/.code= {\def\pgfplots@scaleuniformly@choice{3}},
+ /pgfplots/scale uniformly strategy/auto,
+ /pgfplots/scale uniformly warning/.is if=pgfplots@scaleuniformly@warning,
+ /pgfplots/scale uniformly warning=false,
+ % number of iterations for the nonlinear method involved
+ /pgfplots/scale uniformly strategy iter/.initial=9,
/pgfplots/allow reversal of rel axis cs/.is if=pgfplots@allow@reversal@of@rel@axis@cs,%
/pgfplots/allow reversal of rel axis cs/.default=true,%
/pgfplots/allow reversal of rel axis cs=true,%
@@ -2789,6 +2912,21 @@
/pgfplots/mesh/cols/.initial=,
/pgfplots/mesh/scanline verbose/.is if=pgfplots@scanline@verbose,%
/pgfplots/mesh/scanline verbose/.default=true,
+ %
+ % this is currently only a debug feature. Perhaps it will never
+ % reach production state because of the lacking z buffering for
+ % this technique.
+ /pgfplots/mesh/show normals/.is if=pgfplotsplothandlermesh@shownormals,
+ /pgfplots/mesh/show normals/.default=true,
+ /pgfplots/mesh/show normals length factor/.initial=50,
+ /pgfplots/every patch normal/.style={-stealth,red},
+ %
+ /pgfplots/mesh/interior colormap/.code 2 args={%
+ \pgfplotscreatecolormap{#1}{#2}%
+ \pgfkeysalso{/pgfplots/mesh/interior colormap name=#1}%
+ },
+ /pgfplots/mesh/interior colormap name/.initial=,
+ /pgfplots/mesh/interior colormap thresh/.initial=0,
/pgfplots/mesh/check/.code={%
\pgfplotsutilifstringequal{#1}{false}{%
\def\pgfplots@mesh@checkmode{0}%
@@ -2849,6 +2987,7 @@
/pgfplots/shader/faceted interp/.code={\def\pgfplotsplothandlermesh@shader{3}},
/pgfplots/shader/faceted,
/pgfplots/faceted color/.initial=mapped color!80!black,
+ /pgfplots/marker layer/.initial=auto,
/pgfplots/clip marker paths/.is if=pgfplots@clip@marker@paths,
/pgfplots/clip marker paths/.default=true,
/pgfplots/axis on top/.is if=pgfplots@axis@on@top,
@@ -3195,6 +3334,7 @@
/pgfplots/compat/anchors/1.4/.style= {/pgfplots/compat/anchors/1.3},%
/pgfplots/compat/anchors/1.5/.style= {/pgfplots/compat/anchors/1.3},%
/pgfplots/compat/anchors/1.5.1/.style= {/pgfplots/compat/anchors/1.3},%
+ /pgfplots/compat/anchors/1.6/.style= {/pgfplots/compat/anchors/1.3},%
/pgfplots/compat/anchors/newest/.style= {/pgfplots/compat/anchors/1.3},%
/pgfplots/compat/anchors/default/.style={/pgfplots/compat/anchors/1.3},%
%
@@ -3202,10 +3342,11 @@
/pgfplots/compat/empty line/pre 1.3/.code={\pgfplots@emptyline@compattrue},% FIXME: WAS \global
/pgfplots/compat/empty line/1.3/.style= {/pgfplots/compat/empty line/pre 1.3},%
/pgfplots/compat/empty line/1.4/.code= {\pgfplots@emptyline@compatfalse},%
- /pgfplots/compat/empty line/1.5/.style= {/pgfplots/compat/empty line/1.4},%
- /pgfplots/compat/empty line/1.5.1/.style= {/pgfplots/compat/empty line/1.4},%
- /pgfplots/compat/empty line/newest/.style= {/pgfplots/compat/empty line/1.4},%
- /pgfplots/compat/empty line/default/.style={/pgfplots/compat/empty line/1.4},%
+ /pgfplots/compat/empty line/1.5/.style= {/pgfplots/compat/empty line/1.4},%
+ /pgfplots/compat/empty line/1.5.1/.style= {/pgfplots/compat/empty line/1.4},%
+ /pgfplots/compat/empty line/1.6/.style= {/pgfplots/compat/empty line/1.4},%
+ /pgfplots/compat/empty line/newest/.style= {/pgfplots/compat/empty line/1.4},%
+ /pgfplots/compat/empty line/default/.style= {/pgfplots/compat/empty line/1.4},%
%
/pgfplots/compat/path replacement/.is choice,
/pgfplots/compat/path replacement/pre 1.3/.code= {\pgfplots@path@replace@ellipsefalse},
@@ -3213,8 +3354,9 @@
/pgfplots/compat/path replacement/1.4/.style= {/pgfplots/compat/path replacement/pre 1.3},
/pgfplots/compat/path replacement/1.5/.style= {/pgfplots/compat/path replacement/pre 1.3},%
/pgfplots/compat/path replacement/1.5.1/.code= {\pgfplots@path@replace@ellipsetrue},%
- /pgfplots/compat/path replacement/newest/.style= {/pgfplots/compat/path replacement/1.5.1},%
- /pgfplots/compat/path replacement/default/.style={/pgfplots/compat/path replacement/pre 1.3},%
+ /pgfplots/compat/path replacement/1.6/.style= {/pgfplots/compat/path replacement/1.5.1},
+ /pgfplots/compat/path replacement/newest/.style= {/pgfplots/compat/path replacement/1.5.1},%
+ /pgfplots/compat/path replacement/default/.style= {/pgfplots/compat/path replacement/pre 1.3},%
%ellipse/.is if=pgfplots@path@replace@ellipse,
%
/pgfplots/compat/labels/.is choice,
@@ -3227,6 +3369,7 @@
/pgfplots/compat/labels/1.4/.style= {/pgfplots/compat/labels/1.3},%
/pgfplots/compat/labels/1.5/.style= {/pgfplots/compat/labels/1.3},%
/pgfplots/compat/labels/1.5.1/.style= {/pgfplots/compat/labels/1.3},%
+ /pgfplots/compat/labels/1.6/.style= {/pgfplots/compat/labels/1.3},%
/pgfplots/compat/labels/newest/.style= {/pgfplots/compat/labels/1.3},%
/pgfplots/compat/labels/default/.style= {/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility for labels :-(
%
@@ -3235,33 +3378,100 @@
/pgfplots/compat/scaling/.is choice,
/pgfplots/compat/scaling/pre 1.3/.code={%
\def\pgfplots@compat@scaling@zunitfix@enable{0}%
- \def\pgfplots@compat@scaling@coordmath{pgfbasic}},
+ \def\pgfplots@compat@scaling@coordmath{pgfbasic}%
+ \def\pgfplots@compat@scaling@coordmath@final{pgfbasic}%
+ },
/pgfplots/compat/scaling/1.3/.style={/pgfplots/compat/scaling/pre 1.3},
/pgfplots/compat/scaling/1.4/.code={%
\def\pgfplots@compat@scaling@zunitfix@enable{1}%
- \def\pgfplots@compat@scaling@coordmath{float}},
+ \def\pgfplots@compat@scaling@coordmath{float}%
+ \def\pgfplots@compat@scaling@coordmath@final{pgfbasic}%
+ },
/pgfplots/compat/scaling/1.5/.style={/pgfplots/compat/scaling/1.4},
/pgfplots/compat/scaling/1.5.1/.style={/pgfplots/compat/scaling/1.4},
- /pgfplots/compat/scaling/newest/.style={/pgfplots/compat/scaling/1.4},
+ /pgfplots/compat/scaling/1.6/.code={%
+ \def\pgfplots@compat@scaling@zunitfix@enable{1}%
+ \def\pgfplots@compat@scaling@coordmath{float}%
+ \def\pgfplots@compat@scaling@coordmath@final{float}%
+ },
+ /pgfplots/compat/scaling/newest/.style={/pgfplots/compat/scaling/1.6},
/pgfplots/compat/scaling/default/.style={/pgfplots/compat/scaling/1.4},
%
+ /pgfplots/compat/scale mode/.is choice,
+ /pgfplots/compat/scale mode/pre 1.3/.code=\def\pgfplots@compat@scale@mode@compatible@mode{1},%
+ /pgfplots/compat/scale mode/1.3/.style= {/pgfplots/compat/scale mode/pre 1.3},
+ /pgfplots/compat/scale mode/1.4/.style= {/pgfplots/compat/scale mode/pre 1.3},
+ /pgfplots/compat/scale mode/1.5/.style= {/pgfplots/compat/scale mode/pre 1.3},
+ /pgfplots/compat/scale mode/1.5.1/.style= {/pgfplots/compat/scale mode/pre 1.3},
+ /pgfplots/compat/scale mode/1.6/.code=\def\pgfplots@compat@scale@mode@compatible@mode{0},
+ /pgfplots/compat/scale mode/newest/.style={/pgfplots/compat/scale mode/1.6},
+ /pgfplots/compat/scale mode/default/.style={/pgfplots/compat/scale mode/1.5},
+ %
+ %
+ /pgfplots/compat/plot3graphics/.is choice,
+ /pgfplots/compat/plot3graphics/pre 1.3/.style= {/pgfplots/compat/plot3graphics/1.5},
+ /pgfplots/compat/plot3graphics/1.3/.style= {/pgfplots/compat/plot3graphics/1.5},
+ /pgfplots/compat/plot3graphics/1.4/.style= {/pgfplots/compat/plot3graphics/1.5},%
+ /pgfplots/compat/plot3graphics/1.5/.code= {\def\b@pgfplots@compat@plot@graphics@threedim{1}},%
+ /pgfplots/compat/plot3graphics/1.5.1/.style= {/pgfplots/compat/plot3graphics/1.5},%
+ /pgfplots/compat/plot3graphics/1.6/.code= {\def\b@pgfplots@compat@plot@graphics@threedim{2}},%
+ /pgfplots/compat/plot3graphics/newest/.style= {/pgfplots/compat/plot3graphics/1.6},%
+ /pgfplots/compat/plot3graphics/default/.style= {/pgfplots/compat/plot3graphics/1.5},%
+ %
+ % ATTENTION: there is a compatibility issue which slipped through
+ % the quality assurance: if tick labels where generated in scientific notation
+ % (NOT log tick labels; these are special), and the numbers were
+ % negative, the spacing changed as follows:
+ % pre 1.3: - 1*10^5 (binary minus sign)
+ % 1.3: - 1*10^5 (binary minus sign)
+ % 1.4: - 1*10^5 (binary minus sign)
+ % 1.5: -1*10^5 (unary minus sign - correct!)
+ % 1.6: -1*10^5 (unary minus sign - correct!)
+ % This is (was) a bug in the PGF number printer which has been
+ % fixed in the meantime; it occurred only if
+ % $\pgfmathprintnumber{-1e5}$ was used (i.e. with the '$' signs).
+ % Unfortunately, version 1.5 has been released without realizing
+ % the changes; I detected them right before the release of 1.6.
+ % Consequently, I cannot introduce compatibity switches without
+ % loosing compatibility.
+ %
+ % I chose to keep the correct unary minus sign. If you ever want
+ % to revert to the old version in order to keep spacing intact, use
+ %
+ % \pgfkeys{/pgf/compat/number printer=2.10}
+ %
+ % Risk: the size of such tick labels changed and the
+ % figure has been moved somewhat.
+ %
+ % Sorry.
+ %
+ %
/pgfplots/compat/general/.is choice,
/pgfplots/compat/general/pre 1.3/.style={/pgfplots/log origin=infty},%
- /pgfplots/compat/general/1.3/.style={/pgfplots/compat/general/pre 1.3},
- /pgfplots/compat/general/1.4/.style={/pgfplots/compat/general/pre 1.3},%
- /pgfplots/compat/general/1.5/.style={/pgfplots/compat/general/newest},%
- /pgfplots/compat/general/1.5.1/.style={/pgfplots/compat/general/newest},%
- /pgfplots/compat/general/newest/.style={/pgfplots/log origin=0},
+ /pgfplots/compat/general/1.3/.style= {/pgfplots/compat/general/pre 1.3},
+ /pgfplots/compat/general/1.4/.style= {/pgfplots/compat/general/pre 1.3},%
+ /pgfplots/compat/general/1.5/.style= {/pgfplots/compat/general/newest},%
+ /pgfplots/compat/general/1.5.1/.style= {/pgfplots/compat/general/newest},%
+ /pgfplots/compat/general/1.6/.style= {/pgfplots/compat/general/newest},%
+ /pgfplots/compat/general/newest/.style= {/pgfplots/log origin=0},
/pgfplots/compat/general/default/.style={/pgfplots/compat/general/newest},
+ %
+ /pgfplots/compat/show suggested version/.is if=pgfplots@show@suggested@version,
+ /pgfplots/compat/show suggested version=true,
+ /pgfplots/compat/current/.initial=,
+ /pgfplots/compat/mostrecent/.initial=1.6,
/pgfplots/compat/.style={%
% ATTENTION: *every* /pgfplots/compat/ setting needs to accept
% the same choices due to this construction:
+ /pgfplots/compat/current=#1,% remember the value
/pgfplots/compat/anchors=#1,%
/pgfplots/compat/labels=#1,%
/pgfplots/compat/empty line=#1,%
/pgfplots/compat/scaling=#1,%
+ /pgfplots/compat/scale mode=#1,%
/pgfplots/compat/general=#1,%
/pgfplots/compat/path replacement=#1,%
+ /pgfplots/compat/plot3graphics=#1,%
},%
/pgfplots/compat/.default=pre 1.3,% this is used if you type '\pgfplotsset{compat}' without value
/pgfplots/compat=default,% this is the initial config.
@@ -3454,6 +3664,22 @@
\pgfplots@error{Sorry, legendpreset is now deprecated, along with the legend options text width and font. Legends are now TikZ-matrizes which provide better alignment and can be placed horizontally. See the manual for details.}%
}
+% #1: axis (x, y, or z)
+% #2: display name of context information
+\def\pgfplots@warn@if@log@basis@unset#1#2{%
+ \pgfplots@if{pgfplots@#1islinear}{%
+ }{%
+ \pgfplots@warn@if@log@basis@unset@{#1}{#2}%
+ }%
+}%
+\def\pgfplots@warn@if@log@basis@unset@#1#2{%
+ \pgfkeysgetvalue{/pgfplots/log basis #1}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \pgfplots@warning{Some input argument (#2) explicitly relies on the log basis of #1 (which is e). Please verify that this is intended and set 'log basis #1=10' otherwise. This warning will be shown only once per document.}%
+ \fi
+ \gdef\pgfplots@warn@if@log@basis@unset##1##2{}%
+}%
+
% #1 axis (x or y)
% #2 the label
@@ -3751,19 +3977,37 @@
\axispath\path#1;%
}
\def\pgfplots@replacement@for@scope{\pgfutil@ifnextchar[{\pgfplots@replacement@for@scope@}{\pgfplots@replacement@for@scope@[]}}%
-\def\pgfplots@replacement@for@scope@[#1]{%
+\long\def\pgfplots@replacement@for@scope@[#1]{%
\pgfplotsextra{\scope[#1]}%
\begingroup
% I need to apply anything which might be relevant for \addplot
% here.
% But I do NOT want \scope since this might already affect the low
- % level output. Try this:
+ % level output.
+ %
+ % This here works:
+ % 1. set them to activate plot handlers and parameters like
+ % samples and domain:
\tikzset{#1}%
+ %
+ % 2. we need to remember all these options inside of
+ % 'current plot style' -- otherwise, they would not appear
+ % inside of legend images and markers.
+ \pgfplotsplothandlersurveyaddoptions{#1}%
}%
\def\pgfplots@replacement@for@endscope{%
\endgroup
- \pgfplotsextra\endscope%
+ \pgfplotsextra{\endscope}%
+}%
+
+\def\pgfplots@replacement@for@onlayer#1{%
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplots@replacement@for@onlayer@{#1}%
+}
+\def\pgfplots@replacement@for@onlayer@#1{%
+ \pgfplotsextra{\pgfonlayer{#1}}%
}%
+\def\pgfplots@replacement@for@endonlayer{\pgfplotsextra{\endpgfonlayer}}%
{
% A block which handles active semicolons.
@@ -3885,7 +4129,15 @@
% before.
%
% In contrast to \path, \pgfplotsextra can contain any command(s).
-\let\pgfplotsextra=\pgfplots@path@enqueue
+%
+% Syntax: either
+% \pgfplotsextra{<argument>}
+% or
+% \pgfplotsextra <argument> \endpgfplotsextra
+\def\pgfplotsextra{%
+ \pgfutil@ifnextchar\bgroup{\pgfplots@path@enqueue}{\pgfplotsextra@}%
+}%
+\long\def\pgfplotsextra@#1\endpgfplotsextra{\pgfplots@path@enqueue{#1}}%
% Assigns a legend.
@@ -4099,6 +4351,10 @@
% settings like stroke colors or the-like.
\def\pgfplots@restore@state@before@legend@style{%
\pgfsetfillcolor{black}%
+ % disable the transformations of pgfplots. This is only used by
+ % pgfplots-specific plot handlers which work only if used inside
+ % of an axis... disable it.
+ \def\pgfplotsaxisvisphasetransformcoordinate##1##2##3{}%
}%
\def\pgfplots@split@opts{%
@@ -4284,10 +4540,12 @@
\let\pgfplots@already@computed@legend@node=\pgfplots@glob@TMPa
\fi
\fi
-%\message{Vor legende: \meaning\pgfplots@already@computed@legend@node^^J}%
\ifx\pgfplots@createlegend@toname\pgfutil@empty
% DRAW:
+ \pgfplotsgetlayerforstyle{every axis legend}%
+ \pgfplotsonlayer\pgfplotsretval{legend style}%
\pgfplots@already@computed@legend@node
+ \endpgfplotsonlayer
\else
% apply the 'legend to name' feature:
%
@@ -4590,202 +4848,24 @@
}
-% helper for \pgfplots@check@and@apply@datatrafo@for.
-\def\pgfplots@compute@number@order@for@trafo@isdimen#1\tocount#2{%
- \edef\pgfplots@loc@TMPa{\pgf@sys@tonumber{#1}}%
- \pgfmathfloatparsenumber{\pgfplots@loc@TMPa}%
- \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2
- \advance#2 by1\relax
-}
-
-% helper for \pgfplots@check@and@apply@datatrafo@for.
-%
-\def\pgfplots@compute@number@order@for@trafo@isfloat#1\tocount#2{%
- \pgfmathfloatparsenumber{#1}%
- \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2\relax
- \advance#2 by1\relax
-}
-
% Initialises the data scale transformation and applies it to any
% user specified options.
%
% PRECONDITION:
-% - all axis limits are available in float representation
+% - all axis limits are already transformed
% - \pgfplots@set@default@size@options has been called before
+% - the scaling transformation for direction x is set up
+% (\pgfplots@set@optimal@datatrafo@for@),
% POSTCONDITION:
-% - the scaling transformation is set up,
-% - all axis limits are transformed,
% - any user input (like ticks and tick labels)
% EXCEPT unit vectors will reflect the changes.
%
% Unit vectors will be scaled later.
+% @see \pgfplots@apply@datatrafo@to@axis@limits
\def\pgfplots@check@and@apply@datatrafo@for#1{%
\pgfplots@if{pgfplots@apply@datatrafo@#1}{%
- \pgfplots@letcsname pgfplots@#1min@unscaled@as@float={pgfplots@#1min}%
- \pgfplots@letcsname pgfplots@#1max@unscaled@as@float={pgfplots@#1max}%
- % initialise data scale transformation
- % T(x) = 10^{q-m} * x
- %
- \ifpgfplots@disabledatascaling
- % this here is a waste of time, I know it. One could really
- % safe a lot of CPU time when disabledatascaling is enabled...
- % but it requires so much extra cases; I really don't want
- % that!
- \gdef\pgfplots@glob@TMPa{0}%
- \gdef\pgfplots@glob@TMPb{0}%
- \else
- \begingroup
- \let\data@max@order=\c@pgf@counta
- \let\data@cur@order=\c@pgf@countb
- \let\data@dimen=\pgf@xa
- \let\data@tmp=\pgf@xb
- \let\data@dimen@order=\c@pgf@countc
- \let\data@EXPONENT=\c@pgf@countd
- \expandafter\let\expandafter\pgfplots@display@min@float\csname pgfplots@#1min\endcsname
- \expandafter\let\expandafter\pgfplots@display@max@float\csname pgfplots@#1max\endcsname
- \expandafter\let\expandafter\pgfplots@data@min@float\csname pgfplots@data@#1min\endcsname
- \expandafter\let\expandafter\pgfplots@data@max@float\csname pgfplots@data@#1max\endcsname
- \ifpgfplots@autocompute@all@limits
- \else
- \pgfplotscoordmath{#1}{max}{\pgfplots@display@max@float}{\pgfplots@data@max@float}%
- \let\pgfplots@data@max@float=\pgfmathresult
- \pgfplotscoordmath{#1}{min}{\pgfplots@display@min@float}{\pgfplots@data@min@float}%
- \let\pgfplots@data@min@float=\pgfmathresult
- \fi
- %
-%\message{minmax = [\pgfplots@data@min@float,\pgfplots@data@max@float]}%
- % Step 1: compute 'm', the data order
- \pgfplots@compute@number@order@for@trafo@isfloat
- \pgfplots@data@min@float
- \tocount\data@cur@order
- %
- \data@max@order=\data@cur@order
- %
- \pgfplots@compute@number@order@for@trafo@isfloat
- \pgfplots@data@max@float
- \tocount\data@cur@order
- %
- \ifnum\data@cur@order>\data@max@order
- \data@max@order=\data@cur@order
- \fi
- %
- % Step 2: compute 'q', the #1-size of the axis.
- %\expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil@empty
- % We have 'width' or 'height' (I always have them).
- %
- % Use the order of these parameters.
- \def\pgfplots@loc@TMPa{#1}%
- \def\pgfplots@loc@TMPb{x}%
- \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
- \data@dimen=\pgfplots@width\relax
- \else
- \if1\pgfplots@compat@scaling@zunitfix@enable
- \data@dimen=\pgfplots@height\relax
- \else
- % this code here belongs to versions up to
- % 1.3.1.
- % It is now deprecated and produces small
- % pixel differences.
- \def\pgfplots@loc@TMPb{y}%
- \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
- \data@dimen=\pgfplots@height\relax
- \else
- \data@dimen=42pt % this is actually different from 1.3.1: there, it was UNDEFINED.
- \fi
- \fi
- \fi
- \pgfplots@compute@number@order@for@trafo@isdimen
- \data@dimen
- \tocount\data@dimen@order
- % This here is to avoid inaccuracies in the final
- % axis rectangle size, see \pgfplots@initsizes:
- %\advance\data@dimen@order by-1
- %\else
- % FIXME:
- % we have either the 'x=1cm' or 'y=1cm' option!
- % How should I initialise the trafo!?
- % \data@dimen@order=3
- %\fi
- %
-%\message{Direction #1: data max order=\the\data@max@order; data dimen order=\the\data@dimen@order. }%
- \data@EXPONENT=\data@dimen@order
- \advance\data@EXPONENT by-\data@max@order
- % Now, I introduce a loop which shall avoid cancellation of
- % significant digits.
- %
- % Harmless Example:
- % if we have data shift = -3 and
- % max = 2e6, min = 1e6, then max-min = 1e6; T(max)-T(min) = 1e3 which is ok.
- % In this case, the loop won't change anything.
- %
- % Critical Example:
- % if we have data shift = -3 and
- % max = 1980, min = 1930 then
- % T(max) = 1.98 and T(min) = 1.93
- % and thus T(max)-T(min) = 0.05 .
- % Considering that this is the axis range
- % in which tick labels and plot points need to be computed, we
- % only have two or three digits left! That happens because the
- % prefix '19' is common and is cancelled in the subtraction.
- % Idea: while T(max)-T(min) < O(10^2) -> increase shift by +1
- % (and make sure that T(max) < MAX_VALID_TEX_NUMBER).
- %
- \def\pgfplotscoordmathnotifydatascalesetfor##1{}% disable temporarily. We are just testing it.
- \pgfplots@loop@CONTINUEtrue
- \pgfutil@loop
- \pgfplotscoordmath{#1}{datascaletrafo set params}{\the\data@EXPONENT}{0}%
- \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@data@min@float}%
- \let\pgfplots@min@fixed=\pgfmathresult
- \ifpgfplots@loop@CONTINUE
- \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@data@max@float}%
- \let\pgfplots@max@fixed=\pgfmathresult
- \data@tmp=\pgfplots@max@fixed pt
-%\message{Current trafo EXPONENT for #1 direction: \the\data@EXPONENT; original #1 data limits: [\pgfplots@data@min@float:\pgfplots@data@max@float]; current transformed #1 limits: [\pgfplots@min@fixed:\pgfplots@max@fixed]; cancellation check max-min running...}%
- \ifdim\data@tmp<0pt
- % I need absolute values here:
- \multiply\data@tmp by-1\relax
- \fi
- \pgfmathsubtract@{\pgfplots@max@fixed}{\pgfplots@min@fixed}%
- \data@dimen=\pgfmathresult pt
- \pgfplots@loop@CONTINUEfalse
- \ifdim\data@tmp<1500pt % a multiplication with '10' results in max = 15000 which is the upper limit.
- \ifdim\data@dimen<100pt % I guess if max-min = O(100), we have quite good accuracy
- \ifdim\data@dimen<0.0001pt
- \else
- \advance\data@EXPONENT by1
- \pgfplots@loop@CONTINUEtrue
- \fi
- \fi
- \fi
- %--------------------------------------------------
- % \ifdim\data@dimen>1200pt% FIXME : is this here ok!? CHECK IT!
- % \ifdim\data@dimen>7999pt
- % \advance\data@EXPONENT by-2
- % \else
- % \advance\data@EXPONENT by-1
- % \fi
- % \pgfplots@loop@CONTINUEfalse
- % \fi
- %--------------------------------------------------
- \pgfutil@repeat
- \xdef\pgfplots@glob@TMPa{\the\data@EXPONENT}%
- \xdef\pgfplots@glob@TMPb{\pgfplots@min@fixed}%
- \endgroup
- \fi
- % COMPLETE INITIALISATION:
-%\message{Initialising the data scale transformation in direction #1 to 10^\pgfplots@glob@TMPa*#1 - \pgfplots@glob@TMPb...}%
- \pgfplotscoordmath{#1}{datascaletrafo set params}{\pgfplots@glob@TMPa}{\pgfplots@glob@TMPb}%
+ % Transform axis limits: ALREADY DONE.
%
- % ... and apply transformation to any user input
- %
- % Transform axis limits:
-%\message{#1- display limits BEFORE data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]}%
- \pgfplotscoordmath{#1}{datascaletrafo}{\csname pgfplots@#1min\endcsname}%
- \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
- %
- \pgfplotscoordmath{#1}{datascaletrafo}{\csname pgfplots@#1max\endcsname}%
- \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
-%\message{#1- display limits after data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]}%
% Transform tick limits (if they are set):
%\message{#1- display tick limits BEFORE data transformation: [\csname pgfplots@#1tickmin\endcsname:\csname pgfplots@#1tickmax\endcsname]}%
\expandafter\ifx\csname pgfplots@#1tickmin\endcsname\pgfutil@empty
@@ -4849,11 +4929,9 @@
\pgfkeyslet{/pgfplots/minor #1tick}\pgfplots@loc@TMPc
\fi
%
- % Transform any explicit axis unit scalings:
- % WILL BE DONE LATER!
+ % Transform any explicit axis unit scalings: ALREADY DONE
}{%
% case apply trafo == false:
- \pgfplotscoordmath{#1}{datascaletrafo set params}{0}{0}%
\def\pgfplots@loc@TMPb{data}%
\expandafter\ifx\csname pgfplots@#1tick\endcsname\pgfplots@loc@TMPb
\edef\pgfplots@loc@TMPa{\csname pgfplots@firstplot@coords@#1\endcsname}%
@@ -4870,8 +4948,6 @@
\pgfkeyslet{/pgfplots/minor #1tick}\pgfplotsretval
\fi
\fi
- \expandafter\let\csname pgfplots@#1min@unscaled@as@float\endcsname=\pgfutil@empty
- \expandafter\let\csname pgfplots@#1max@unscaled@as@float\endcsname=\pgfutil@empty
}%
}
@@ -5005,15 +5081,18 @@
\pgfplotsthreedimfalse
\fi
%
- \pgfplots@check@and@apply@datatrafo@for x%
- \pgfplots@check@and@apply@datatrafo@for y%
+ \pgfplots@set@optimal@datatrafos@allaxes
+ %
+ % Now, the data scaling has been set up.
+ % However, it may need to be changed if axis equal and/or unit
+ % vector ratio changes the axis limits considerably. If so, it
+ % will be done in \pgfplots@initsizes
+ \pgfplots@apply@datatrafo@to@axis@limits x%
+ \pgfplots@apply@datatrafo@to@axis@limits y%
\ifpgfplots@threedim
- \pgfplots@check@and@apply@datatrafo@for z%
+ \pgfplots@apply@datatrafo@to@axis@limits z%
\fi
- % clear structure:
- \global\let\pgfplots@firstplot@coords@x=\pgfutil@empty
- \global\let\pgfplots@firstplot@coords@y=\pgfutil@empty
- \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty
+ %
\pgfplots@datascaletrafo@initialisedtrue
%\message{transformed: x = [\pgfplots@xmin:\pgfplots@xmax] y = [\pgfplots@ymin:\pgfplots@ymax].}%
%
@@ -5032,6 +5111,16 @@
%
\pgfplots@initsizes
%
+ \pgfplots@check@and@apply@datatrafo@for x%
+ \pgfplots@check@and@apply@datatrafo@for y%
+ \ifpgfplots@threedim
+ \pgfplots@check@and@apply@datatrafo@for z%
+ \fi
+ % clear structure:
+ \global\let\pgfplots@firstplot@coords@x=\pgfutil@empty
+ \global\let\pgfplots@firstplot@coords@y=\pgfutil@empty
+ \global\let\pgfplots@firstplot@coords@z=\pgfutil@empty
+ %
\pgfplots@limits@ready
\pgfplotspoint@initialisation
%
@@ -5166,100 +5255,6 @@
\pgfkeyslet{/pgfplots/#1#2}\pgfmathresult
}%
-% Defines \pgfmathresult to be the desired width without axis labels.
-%
-\def\pgfplots@initsizes@get@width@withoutlabels{%
- \pgfplots@initsizes@handle@label@const{\pgfplots@width}{45pt}{width}%
-}
-
-% Defines \pgfmathresult to be the desired height without axis labels.
-\def\pgfplots@initsizes@get@height@withoutlabels{%
- \pgfplots@initsizes@handle@label@const{\pgfplots@height}{45pt}{height}%
-}
-\def\pgfplots@initsizes@handle@label@const#1#2#3{%
- \begingroup
- \pgf@xa=#1\relax
- % EXPECTED WIDTH = X = \pgfplots@width
- % ACTUAL WIDTH = c + x * (xmax-xmin)
- % where c is a CONSTANT (for the axis labels/tick labels).
- % -> \pgfplots@tmpXscale = (X - c) / (x *(xmax-xmin))
- %
- % \pgf@xa := X-c:
- \ifpgfplots@scale@only@axis
- \else
- \advance\pgf@xa by-#2 % FIXME determine 'c' correctly!
- \fi
- \ifdim\pgf@xa<0pt
- \pgfplots@error{Error: Plot #3 `#1' is too small. This can't be realised while maintaining constant size for labels. Sorry, label sizes are only approximate. You will need to adjust your #3.}%
- \pgf@xa=0pt
- \fi
- \edef\pgfmathresult{\the\pgf@xa}%
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
-}%
-
-% Helper method for initsizes.
-%
-% It computes a scaling such that \pgfplots@width = SCALE * ACTUAL WIDTH.
-%
-% The actual width is
-% c + x*(xmax-xmin)
-% based on
-% - c = estimated, a constant for the axis label/tick labels
-%
-% Arguments:
-% #1: is expected to be x*(xmax-xmin) measured in pt.
-% #2: the output argument for the SCALE.
-\def\pgfplots@initsizes@getXscale#1\into#2{%
- \begingroup
- \pgfplots@initsizes@get@width@withoutlabels
- % EXPECTED WIDTH = X = \pgfplots@width
- % ACTUAL WIDTH = c + x * (xmax-xmin)
- % where c is a CONSTANT (for the axis labels/tick labels).
- % -> \pgfplots@tmpXscale = (X - c) / (x *(xmax-xmin))
- %
- % \pgf@xa := X-c:
- % \pgf@xb := x*(xmax-xmin):
- \pgf@xa=\pgfmathresult\relax
- \pgf@xb=#1\relax
- \pgfmathlog@invoke@expanded\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@xa}%
- {\pgf@sys@tonumber\pgf@xb}%
- }%
-%--------------------------------------------------
-% \message{pgfplots.sty: Computing 'x' such that 'width = c + x*(xmax-xmin)';
-% c=estimated,
-% width-c =\the\pgf@xa,
-% x*(xmax - xmin)]) = \the\pgf@xb
-% -> x-scale =\pgfmathresult }%
-%--------------------------------------------------
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
- \let#2=\pgfmathresult
-}
-
-% The same as \pgfplots@initsizes@getXscale, just for the height.
-\def\pgfplots@initsizes@getYscale#1\into#2{%
- \begingroup
- \pgfplots@initsizes@get@height@withoutlabels
- % \pgf@xb := y*(ymax-ymin):
- \pgf@xa=\pgfmathresult\relax
- \pgf@xb=#1%
- \pgfmathlog@invoke@expanded\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@xa}%
- {\pgf@sys@tonumber\pgf@xb}%
- }%
-%\pgfplots@message{pgfplots.sty: Computing 'y' such that 'height = c + y*(ymax-ymin)';
-% height=\pgfplots@height,
-% c=estimated,
-% height-c =\the\pgf@xa,
-% y*(ymax[=\the\pgfplots@ycoordmaxTEX] - ymin[=\the\pgfplots@ycoordminTEX)]) = \the\pgf@xb
-% -> y-scale =#2 }%
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
- \let#2=\pgfmathresult
-}
-
\newif\ifpgfplots@avoid@emptyrange@@range@is@approx@equal
% Checks whether axis limits in coordinate #1 are approximately equal.
@@ -5295,7 +5290,13 @@
\fi
\fi
\ifpgfplots@avoid@emptyrange@@range@is@approx@equal
- \pgfplots@warning{Axis range for axis #1 is approximately empty; enlarging it.}%
+ \begingroup
+ \pgfplotscoordmath{#1}{datascaletrafo inverse to fixed}{\csname pgfplots@#1min\endcsname}%
+ \let\pgfplots@min=\pgfmathresult
+ \pgfplotscoordmath{#1}{datascaletrafo inverse to fixed}{\csname pgfplots@#1max\endcsname}%
+ \let\pgfplots@max=\pgfmathresult
+ \pgfplots@warning{Axis range for axis #1 is approximately empty; enlarging it (it is [\pgfplots@min:\pgfplots@max])}%
+ \endgroup
% the case \pgfplots@@min ~= \pgfplots@@max
%
% enlarge \pgfplots@@max and shrink \min:
@@ -5389,756 +5390,6 @@
\expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfplots@glob@TMPb
}
-% PRECONDITION:
-% none
-% POSTCONDITION:
-% \pgfplots@default@aspect@ratio is set.
-\def\pgfplots@compute@default@aspect@ratio{%
- \expandafter\pgfmath@x\axisdefaultwidth
- \expandafter\pgfmath@y\axisdefaultheight
- \pgfmathlog@invoke@expanded\pgfmathdivide@{%
- {\pgf@sys@tonumber{\pgfmath@x}}%
- {\pgf@sys@tonumber{\pgfmath@y}}%
- }%
- \let\pgfplots@default@aspect@ratio=\pgfmathresult
-}
-
-\def\pgfplots@set@default@size@options{%
- % The axes 'x' and 'y' vectors will be scaled such that the total
- % size is (\axisdefaultwidth, \axisdefaultheight).
- %
- % If the user specifies ONE of width OR height,
- % the plot will be resized; keeping the aspect ratio.
- %
- \let\pgfplots@default@aspect@ratio=\pgfutil@empty
- \pgfkeysgetvalue{/pgfplots/x}{\pgfplots@x}%
- \pgfkeysgetvalue{/pgfplots/y}{\pgfplots@y}%
- \pgfkeysgetvalue{/pgfplots/z}{\pgfplots@z}%
- %\pgfkeysgetvalue{/pgfplots/viewdir}{\pgfplots@viewdir}%
- \pgfkeysgetvalue{/pgfplots/width}{\pgfplots@width}%
- \pgfkeysgetvalue{/pgfplots/height}{\pgfplots@height}%
- \ifx\pgfplots@width\pgfutil@empty
- \def\pgfplots@user@provided@width{0}%
- \else
- \def\pgfplots@user@provided@width{1}%
- \pgfmathparse{\pgfplots@width}%
- \edef\pgfplots@width{\pgfmathresult pt}%
- \fi
- \ifx\pgfplots@height\pgfutil@empty
- \def\pgfplots@user@provided@height{0}%
- \else
- \def\pgfplots@user@provided@height{1}%
- \pgfmathparse{\pgfplots@height}%
- \edef\pgfplots@height{\pgfmathresult pt}%
- \fi
- %
- % CASES:
- % W := 'width' option non-empty
- % H := 'height' option non-empty
- %
- % W H
- % 0 0 -> \axisdefaultwidth
- % 0 1 -> determine width out of H and the default aspect ratio
- % 1 X -> ok, use the user parameter.
- % -> KEEP ASPECT RATIO if just one W, or H is given!
- \ifx\pgfplots@width\pgfutil@empty
- \ifx\pgfplots@height\pgfutil@empty
- % The case W=0 H=0:
- \let\pgfplots@width=\axisdefaultwidth
- \let\pgfplots@height=\axisdefaultheight
- \else
- % The case W=0 H=1:
- \pgfplots@compute@default@aspect@ratio
- \expandafter\pgfmath@y\pgfplots@height
- \pgfmathlog@invoke@expanded\pgfmathmultiply@{%
- {\pgf@sys@tonumber{\pgfmath@y}}%
- {\pgfplots@default@aspect@ratio}%
- }%
- \edef\pgfplots@width{\pgfmathresult pt}%
- \fi
- \else
- \ifx\pgfplots@height\pgfutil@empty
- % The case W=1 H=0:
- \pgfplots@compute@default@aspect@ratio
- \expandafter\pgfmath@x\pgfplots@width
- \pgfmathlog@invoke@expanded\pgfmathdivide@{%
- {\pgf@sys@tonumber{\pgfmath@x}}%
- {\pgfplots@default@aspect@ratio}%
- }%
- \edef\pgfplots@height{\pgfmathresult pt}%
- \else
- % The case W=1 H=1:
- \fi
- \fi
- \pgfkeyslet{/pgfplots/width}{\pgfplots@width}%
- \pgfkeyslet{/pgfplots/height}{\pgfplots@height}%
- %
- \ifpgfplots@threedim
- \pgfplots@set@default@size@options@threedim
- \fi
-}
-\def\pgfplots@set@default@size@options@threedim{%
- \pgfplots@loc@tmpfalse
- \ifx\pgfplots@x\pgfutil@empty
- \else
- \pgfplots@loc@tmptrue
- \fi
- \ifx\pgfplots@y\pgfutil@empty
- \else
- \pgfplots@loc@tmptrue
- \fi
- \ifx\pgfplots@z\pgfutil@empty
- \else
- \pgfplots@loc@tmptrue
- \fi
- \ifpgfplots@loc@tmp
- % oh - we have at least one of the [xyz] unit vectors!
- % make sure all of them are there
- \ifx\pgfplots@x\pgfutil@empty
- \pgfplots@set@default@size@options@threedim@{x}{(1pt,0pt)}%
- \fi
- \ifx\pgfplots@y\pgfutil@empty
- \pgfplots@set@default@size@options@threedim@{y}{(0pt,1pt)}%
- \fi
- \ifx\pgfplots@z\pgfutil@empty
- \pgfplots@set@default@size@options@threedim@{z}{(0pt,1pt)}%
- \fi
- \pgfkeyslet{/pgfplots/view/az}\pgfutil@empty
- \pgfkeyslet{/pgfplots/view/el}\pgfutil@empty
- \fi
-}
-\def\pgfplots@set@default@size@options@threedim@#1#2{%
- \pgfplots@error{Sorry, a 3D axis needs either NONE or ALL of "x,y,z". I found partial information, but (at least) '#1' is lacking... please add '#1'}%
- \expandafter\def\csname pgfplots@#1\endcsname{#2}%
-}
-
-% A helper method for \pgfplots@initsizes which
-% - applies the data scaling trafo to user arguments
-% - sets calls pgfset#1vec
-% - computes \pgfplots@#1@veclength
-% - computes \pgfplots@#1@inverseveclength
-%
-% #1: the vector to set (either 'x' or 'y')
-% #2: the index of the vector to set (either 0 or 1)
-% #3: the already precomputed temporary scale (see pgfplots@initsizes)
-% #4: an output argument. It is a macro name which will be defined to
-% '1' if and only if the finally set vector is parallel to the #1 axis
-% of PGF, that means (x,0) for #1=x and (0,y) for #2=y.
-\def\pgfplots@initsizes@setunitvector#1#2#3#4{%
- \pgfkeysgetvalue{/pgfplots/#1 dir/value}\pgfplots@loc@dirvalue
- \expandafter\let\expandafter\pgfplots@loc@TMPb\csname pgfplots@#1\endcsname
- \ifx\pgfplots@loc@TMPb\pgfutil@empty
- \def#4{1}% we have (#1,0) or (0,#1)
- %
-%\message{Setting unitvector(#1) to auto-computed multiple of e_#2 ...}%
- \edef\pgfplots@loc@TMPa{#3}%
- \if r\pgfplots@loc@dirvalue
- \edef\pgfplots@loc@TMPa{-#3}%
- \fi
- \begingroup
- \pgf@xa=#3\relax
- \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
- \endgroup
-% FIXME : '\pgfplots@loc@TMPa' contains 'pt' leading to missing
-% character warning!
- \ifcase#2\relax
- \pgfsetxvec{\pgfqpoint{\pgfplots@loc@TMPa}{0pt}}%
- \pgfmathabs@{\pgfplots@glob@TMPb}%
- \or
- \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@loc@TMPa}}%
- \pgfmathabs@{\pgfplots@glob@TMPb}%
- \or
- \pgfsetzvec{\pgfqpoint{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPa}}%
- \ifdim\pgfplots@loc@TMPa=0pt
- \def\pgfmathresult{0}%
- \else
- \edef\pgf@marshal{%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1x\endcsname}%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1y\endcsname}%
- }%
- \expandafter\pgfmathveclen\pgf@marshal
- \fi
- \fi
- % The numbers 1/||e_x|| and 1/||e_y|| are used by the tick
- % placement code to convert between logical and physical
- % coordinates.
- \expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfmathresult}{%
- \expandafter\def\csname pgfplots@#1@inverseveclength\endcsname{infty}%
- }{%
- \expandafter\pgfmathreciprocal@\expandafter{\pgfmathresult}%
- \expandafter\let\csname pgfplots@#1@inverseveclength\endcsname=\pgfmathresult
- }%
- \else
- % Ok, we have a user-defined unit vector.
- %
- % That means we also need to apply the scaling trafo!
- %
- \if r\pgfplots@loc@dirvalue
- \def\pgfplots@loc@dirvalue{-}%
- \else
- \def\pgfplots@loc@dirvalue{}%
- \fi
- %
- % 1. Check whether we have a complete vector of type (x,y):
- \expandafter\pgfutil@in@\expandafter(\expandafter{\pgfplots@loc@TMPb}%
- \ifpgfutil@in@
- % YES: we have (x,y):
- %
- \def#4{0}% we DON'T have (#1,0) or (0,#1). At least I think so.
- %
-%\message{Setting unitvector(#1) to non-standard \csname pgfplots@#1\endcsname ...}%
- \def\pgfplots@loc@TMPa(##1,##2){%
- \pgfplotscoordmath{default}{parse}{##1}%
- \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \pgfplotscoordmath{default}{parse}{##2}%
- \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
- \let\pgfplots@loc@TMPc=\pgfmathresult
- %
- \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
- \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfplots@loc@TMPb}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfplots@loc@TMPc}%
- \let\pgfplots@loc@TMPc=\pgfmathresult
- }{}%
- \csname pgfset#1vec\endcsname{%
- \pgfqpoint
- {\pgfplots@loc@dirvalue\pgfplots@loc@TMPb pt}
- {\pgfplots@loc@dirvalue\pgfplots@loc@TMPc pt}}%
- }%
- \expandafter\pgfplots@loc@TMPa\pgfplots@loc@TMPb%
- %
- \edef\pgf@marshal{%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1x\endcsname}%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1y\endcsname}%
- }%
- \expandafter\pgfmath@basic@veclen@\pgf@marshal
- %
- \expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfmathresult}{%
- \expandafter\def\csname pgfplots@#1@inverseveclength\endcsname{infty}%
- }{%
- \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
- \expandafter\let\csname pgfplots@#1@inverseveclength\endcsname=\pgfmathresult
- }%
- \else
- % NO we simply have a scalar value.
- \def#4{1}% we have (#1,0) or (0,#1)
-%\message{Setting unitvector(#1) to \csname pgfplots@#1\endcsname * e_{#2}...}%
- \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
- \pgfplotscoordmath{default}{parse}{\csname pgfplots@#1\endcsname}%
- \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
- \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfmathresult}%
- \edef\pgfplots@loc@TMPb{\pgfmathresult pt}%
- }{\relax}%
- \begingroup
- \pgf@xa=\pgfplots@loc@TMPb\relax
- \if r\pgfplots@loc@dirvalue
- \multiply\pgf@xa by-1
- \fi
- \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
- \endgroup
- \ifcase#2\relax
- \pgfsetxvec{\pgfqpoint{\pgfplots@loc@TMPb}{0pt}}%
- \pgfmath@basic@abs@{\pgfplots@glob@TMPb}%
- \or
- \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@loc@TMPb}}%
- \pgfmath@basic@abs@{\pgfplots@glob@TMPb}%
- \or
- \pgfsetzvec{\pgfqpoint{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPb}}%
- \ifdim\pgfplots@loc@TMPb=0pt
- \def\pgfmathresult{0}%
- \else
- \edef\pgf@marshal{%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1x\endcsname}%
- {\expandafter\pgf@sys@tonumber\csname pgf@#1y\endcsname}%
- }%
- \expandafter\pgfmath@basic@veclen@\pgf@marshal
- \fi
- \fi
- \expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfmathresult}{%
- \expandafter\def\csname pgfplots@#1@inverseveclength\endcsname{infty}%
- }{%
- \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
- \expandafter\let\csname pgfplots@#1@inverseveclength\endcsname=\pgfmathresult
- }%
- \fi
- \fi
-%\message{-> got unitvector(#1) = (\the\csname pgf@#1x\endcsname, \the\csname pgf@#1y\endcsname).^^J}%
-}%
-
-% Applies the 'axis equal' feature.
-%
-% PRECONDITION:
-% - final unit vectors have been set
-% - final axis limits are given in transformed range
-% - \pgfplots@set@default@size@options has been invoked before
-%
-% POSTCONDITION:
-% - unit vectors have been set to equal length,
-% - axis limits have been rescaled such that the axis dimensions
-% remain fixed
-%
-% There is just one algorithmic difficulty: the data scaling
-% transformation. All unit vector length above are only meaningful in
-% the UNTRANSFORMED range, so we have to mingle with the scaling
-% transformation.
-\def\pgfplots@apply@unit@ratio{%
- \pgfkeysgetvalue{/pgfplots/unit vector ratio}\pgfplots@unit@vector@ratio
- \ifx\pgfplots@unit@vector@ratio\pgfutil@empty
- \else
- \edef\pgfplots@unit@vector@ratio{\pgfplots@unit@vector@ratio\space1 1 }%
- %
- % Step 1: compute the unit vector which STAYS CONSTANT.
- %
- \pgfkeysgetvalue{/pgfplots/unit vector ratio axis}\pgfplots@apply@unit@ratio@reference
- \ifx\pgfplots@apply@unit@ratio@reference\pgfutil@empty
- \pgfplots@apply@unit@ratio@find@reference%
- \fi
- %
- % FIXME : I could spent some attention here to save work:
- % both, unit ratios and the resulting scales are computed at
- % least twice (once in \pgfplots@apply@unit@ratio@find@reference and once in the
- % following).
- \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
- %
-%\message{USING REFERENCE UNIT VECTOR FROM \pgfplots@apply@unit@ratio@reference; ratio \pgfplots@unit@ratio@x\space \pgfplots@unit@ratio@y\space \pgfplots@unit@ratio@z.^^J}%
- %
- % Step 2: apply the scaling:
- \pgfplots@rescale@unit@vector@reltoreference{x}{\pgfplots@unit@ratio@x}%
- \pgfplots@rescale@unit@vector@reltoreference{y}{\pgfplots@unit@ratio@y}%
- \ifpgfplots@threedim
- \pgfplots@rescale@unit@vector@reltoreference{z}{\pgfplots@unit@ratio@z}%
- \fi
- \fi
-}%
-
-% This macro determines the reference axis for unit vector rescaling.
-% The reference axis remains unscaled (it gets scaling factor 1 if you
-% want it this way).
-%
-% The other axes are scaled such that the desired unit vector ratios
-% are fulfilled.
-%
-% The idea to select a reference axis is as follows:
-% 1. Every unit vector scaling factor s should fulfill s <= 1.
-% 2. Choose the reference axis such that the minimal amount of scaling
-% is performed.
-%
-% The motivation for (1) is: if all involved scaling factors are at
-% most 1, the resulting picture will only become *smaller*.
-% Consequently, we can simply enlarge axis limits to restore the
-% original width/height!
-%
-% The motivation for (2) is: a huge amount of scaling might reduce the
-% size of the image too much. Of course, the figure will be enlarged
-% to fit the original width/height, but most of it will be empty. So,
-% use the smallest scaling.
-%
-% @POSTCONDITION The reference axis is stored in
-% \pgfplots@apply@unit@ratio@reference .
-%
-% @see the key 'unit vector ratio axis=y' which allows to manually
-% select the reference axis. This will illustrate what happens here.
-\def\pgfplots@apply@unit@ratio@find@reference{%
- %
- \begingroup
- \let\pgfplots@ONE=\pgf@x
- \global\pgfplots@ONE=1.002pt
- %
- \def\pgfplots@optimum@sofar@axis{}%
- \let\pgfplots@optimum@sofar@value=\pgf@y
- \global\pgfplots@optimum@sofar@value=16000pt
- %
- %\pgfplots@apply@unit@ratio@find@reference@checkexplicitlimits
- %
- \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty
- % set \pgfplots@loc@TMPa := 1 if and only if the axis is 3d
- \def\pgfplots@loc@TMPa{0}%
- \ifpgfplots@threedim
- % ah, it IS 3d!
- \ifdim\pgfplots@z@veclength pt=0pt
- % hm. It has view = {0}{90} (i.e. it is 2d)
- \def\pgfplots@loc@TMPa{0}%
- \else
- \def\pgfplots@loc@TMPa{1}%
- \fi
- \fi
- \if1\pgfplots@loc@TMPa
- % 3D is more complicated than 2D:
- % for every fixed reference axis, we have to check *two*
- % scaling factors.
- %
- % Furthermore, the optimality condition (2) needs to be
- % performed on the maximum max{1-s_a, 1-s_b} provided both of
- % these numbers are positive.
- %
- \def\pgfplots@check@##1##2{%
- % PRECONDITION: \pgfplots@apply@unit@ratio@reference is defined.
- %
- % renormalize \pgfplots@unit@[xyz] :
- \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
- %
- % compute s_a :
- \pgfplots@getscale@unit@vector@reltoreference ##1{\csname pgfplots@unit@ratio@##1\endcsname}%
- \let\pgfplots@scale@a=\pgfmathresult
- %
- % compute s_b :
- \pgfplots@getscale@unit@vector@reltoreference ##2{\csname pgfplots@unit@ratio@##2\endcsname}%
- \let\pgfplots@scale@b=\pgfmathresult
- %
- % check if the actual choice of
- % \pgfplots@apply@unit@ratio@reference is FEASIBLE.
- % That is the case if s_a <= 1 && s_b <= 1.
- % We check
- % (1 - s_a >= 0 ) && ( 1 - s_b >= 0 )
- % instead, since I need the value
- % max( 1-s_a, 1-s_b )
- % anyway.
- \def\pgfplots@ref@is@feasible{1}%
- \pgf@xa=\pgfplots@ONE \advance\pgf@xa by-\pgfplots@scale@a pt
- \ifdim\pgf@xa<0sp
- \def\pgfplots@ref@is@feasible{0}%
- \else
- \pgf@xb=\pgfplots@ONE \advance\pgf@xb by-\pgfplots@scale@b pt
- \ifdim\pgf@xb<0sp
- \def\pgfplots@ref@is@feasible{0}%
- \fi
- \fi
- % compute max(1-s_a,1-s_b) into \pgf@xa:
- % pgf@xa= max(pgf@xa,pgf@xb):
- \ifdim\pgf@xb>\pgf@xa \pgf@xa=\pgf@xb \fi
- \if1\pgfplots@ref@is@feasible
- \ifdim\pgf@xa<\pgfplots@optimum@sofar@value
- % Ah, ok. The actual choice is BETTER as it
- % involves less scaling.
- %
- % Remember it!
- \let\pgfplots@optimum@sofar@axis=\pgfplots@apply@unit@ratio@reference
- \global\pgfplots@optimum@sofar@value=\pgf@xa
- \fi
- \fi
-%\message{^^Junit vector ratio 3D searching reference: checking \pgfplots@apply@unit@ratio@reference. feasable=\pgfplots@ref@is@feasible. \if1\pgfplots@ref@is@feasible max=\the\pgf@xa. \fi Optimum so far: value =\the\pgfplots@optimum@sofar@value\space for axis \pgfplots@optimum@sofar@axis.^^J}%
- }%
- %
- % Check 'x' as reference :
- \def\pgfplots@apply@unit@ratio@reference{x}%
- \pgfplots@check@ yz%
- %
- % Check 'y' as reference :
- \def\pgfplots@apply@unit@ratio@reference{y}%
- \pgfplots@check@ xz%
- %
- % Check 'z' as reference :
- \def\pgfplots@apply@unit@ratio@reference{z}%
- \pgfplots@check@ xy%
- %
- \else
- % 2D is much simpler: find the scale s which fulfills s <= 1.
- % One of them MUST fulfill it.
- %
- % try 'x' axis as reference:
- \def\pgfplots@apply@unit@ratio@reference{x}%
- %
- % renormalize:
- \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
- %
- % compute scaling factor:
- \pgfplots@getscale@unit@vector@reltoreference y\pgfplots@unit@ratio@y%
- %
-%\message{^^Junit vector ratio 2D searching reference: checking \pgfplots@apply@unit@ratio@reference. feasable=\pgfmathresult < 1: \ifdim\pgfmathresult pt <\pgfplots@ONE YES-> use x\else NO->use y\fi^^J}%
- % and check (1). The condition (2) is irrelevant; it is met
- % anyway.
- \ifdim\pgfmathresult pt<\pgfplots@ONE
- \def\pgfplots@optimum@sofar@axis{x}%
- \else
- \def\pgfplots@optimum@sofar@axis{y}%
- \fi
- \fi
- \else
-%\message{^^Junit vector ratio chose \pgfplots@optimum@sofar@axis\space to fulfill explicitly provided limits (at least partially).^^J}%
- \fi
- %
- \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty
- \ifpgfplots@threedim
- \ifdim\pgfplots@z@veclength pt=0pt
- \def\pgfplots@optimum@sofar@axis{y}%
- \else
- \def\pgfplots@optimum@sofar@axis{z}%
- \fi
- \else
- \def\pgfplots@optimum@sofar@axis{y}%
- \fi
- \pgfplots@warning{The algorithm to implement 'unit vector ratio' failed! It could not determine the axis which shall be scaled and decided to use 'unit vector ratio axis=\pgfplots@optimum@sofar@axis'.}%
- \fi
- \let\pgfplots@apply@unit@ratio@reference=\pgfplots@optimum@sofar@axis
- \pgfmath@smuggleone\pgfplots@apply@unit@ratio@reference
- \endgroup
-}%
-\def\pgfplots@apply@unit@ratio@find@reference@checkexplicitlimits{%
- \ifpgfplots@autocompute@ymax \else \def\pgfplots@optimum@sofar@axis{y}\fi
- \ifpgfplots@autocompute@ymin \else \def\pgfplots@optimum@sofar@axis{y}\fi
- \ifpgfplots@autocompute@xmax \else \def\pgfplots@optimum@sofar@axis{x}\fi
- \ifpgfplots@autocompute@xmin \else \def\pgfplots@optimum@sofar@axis{x}\fi
- \ifpgfplots@threedim
- \ifpgfplots@autocompute@zmax \else \def\pgfplots@optimum@sofar@axis{z}\fi
- \ifpgfplots@autocompute@zmin \else \def\pgfplots@optimum@sofar@axis{z}\fi
- \fi
-}%
-
-\def\pgfplots@apply@unit@ratio@prepareratios#1 #2 #3 #4\pgfplots@EOI{%
- \def\pgfplots@unit@ratio@x{#1}%
- \def\pgfplots@unit@ratio@y{#2}%
- \def\pgfplots@unit@ratio@z{#3}%
- %
- % 'unit vector ratio' is measured relative to the y axis for 2d
- % and relative to the z axis for 3d plots.
- % renormalize such that it is relative to
- % \pgfplots@apply@unit@ratio@reference.
- %
- % Furthermore, renormalize such that
- % unit@ratio@\pgfplots@apply@unit@ratio@reference is 1.
- \pgfmathreciprocal@{\csname pgfplots@unit@ratio@\pgfplots@apply@unit@ratio@reference\endcsname}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \ifpgfplots@threedim
- \if z\pgfplots@apply@unit@ratio@reference
- \else
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@z}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \fi
- %
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@x}%
- \let\pgfplots@unit@ratio@x=\pgfmathresult
- %
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
- \let\pgfplots@unit@ratio@y=\pgfmathresult
- %
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@z}%
- \let\pgfplots@unit@ratio@z=\pgfmathresult
- \else
- \if y\pgfplots@apply@unit@ratio@reference
- \else
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \fi
- %
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@x}%
- \let\pgfplots@unit@ratio@x=\pgfmathresult
- %
- \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
- \let\pgfplots@unit@ratio@y=\pgfmathresult
- %
- \def\pgfplots@unit@ratio@z{<unused>}%
- \fi
- %
-}%
-
-
-% Computes a new unit vector E_#1 for direction #1 such that
-% ||E_#1|| = #2 * ||e_reference||.
-% Here, #2 is a scaling factor and e_reference is a reference axis.
-% The reference axis is stored in
-% \pgfplots@apply@unit@ratio@reference, the macro contains one of
-% {x,y,z}.
-%
-% The data limits for '#1' will be enlarged as well (for 'unit rescale
-% keep size').
-%
-% #1 is the axis which should be scaled (i.e. #1 in {x,y,z}).
-% It is allowed if #1 = \pgfplots@apply@unit@ratio@reference. In this
-% case, you can provide a scale '#2' to rescale the axis.
-%
-% #2 is a desired scale, relative to
-% \pgfplots@apply@unit@ratio@reference. #2 should be a number without
-% unit.
-%
-% The parameter \pgfplots@apply@unit@ratio@reference is also one of
-% {x,y,z}.
-%
-\def\pgfplots@rescale@unit@vector@reltoreference#1#2{%
- \def\pgfplots@loc@TMPa{0}%
- \if#1\pgfplots@apply@unit@ratio@reference
- \pgfplotsmath@ifapproxequal@dim{#2pt}{1pt}{0.0002pt}{%
- }{%
- \def\pgfplots@loc@TMPa{1}%
- }%
- \else
- \def\pgfplots@loc@TMPa{1}%
- \fi
- \ifdim\csname pgfplots@#1@veclength\endcsname pt=0pt
- \def\pgfplots@loc@TMPa{0}%
- \fi
- \if1\pgfplots@loc@TMPa
- %
- \pgfplots@getscale@unit@vector@reltoreference{#1}{#2}%
- \global\let\pgfplots@glob@TMPa=\pgfmathresult
- %
-%\message{Rescaling '#1' by \pgfplots@glob@TMPa.^^J}%
- \if x#1
- \pgfsetxvec{\pgfplotsqpointxy{\pgfplots@glob@TMPa}{0}}%
- \else
- \if y#1
- \pgfsetyvec{\pgfplotsqpointxy{0}{\pgfplots@glob@TMPa}}%
- \else
- \if z#1
- \pgfsetzvec{\pgfplotsqpointxyz{0}{0}{\pgfplots@glob@TMPa}}%
- \fi
- \fi
- \fi
- %
- \pgfmathmultiply@{\csname pgfplots@#1@veclength\endcsname}{\pgfplots@glob@TMPa}%
- \expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
- %
- \pgfmathreciprocal@\pgfplots@glob@TMPa
- \global\let\pgfplots@glob@TMPb=\pgfmathresult
- %
- \pgfmathmultiply@{\csname pgfplots@#1@inverseveclength\endcsname}{\pgfplots@glob@TMPb}%
- \expandafter\let\csname pgfplots@#1@inverseveclength\endcsname=\pgfmathresult
- %
- %
- \pgfplots@apply@unit@vector@rescale@keep@size{#1}{\pgfplots@glob@TMPb}%
- %
- \fi
-}
-
-% Updates the #1 axis limits such that the axis' dimensions
-% stay the same after scaling the #1 unit vector by a scale 's'.
-%
-% PRECONDITION:
-% - the #1 unit vector has been rescaled by a factor s.
-% For example, e_xnew := e_x * 0.5 .
-%
-% POSTCONDITION:
-% - the axis limits are enlarged by a factor 1/s such that
-% 1/s (#1max - #1min) * e_xnew = (#1max- #1min) * e_x.
-%
-% In other words, the unit vector rescale is componensated by
-% modifying the axis limits.
-%
-% My idea is to add half of the new range to 'max' and
-% subtract the other half from 'min':
-% 1/s( xmax - xmin) = (xmax+0.5d) - (xmin-0.5d) = xmax - xmin +d
-% with d = 1/s (xmax-xmin) - (xmax-xmin) = (1/s - 1) (xmax-xmin)
-%
-% #1: either x, y or z. It denotes the direction which has been
-% modified.
-% #2: the INVERSE of the scaling factor, #2 = 1/s .
-%
-\def\pgfplots@apply@unit@vector@rescale@keep@size#1#2{%
- \ifpgfplots@unit@vector@rescale@keep@size
- %
-%\message{'unit rescale keep size': Resizing data range for #1: from \csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname\ to}%
- \pgfmathsubtract@{\csname pgfplots@#1max\endcsname}{\csname pgfplots@#1min\endcsname}%
- \begingroup
- \pgf@xa=\pgfmathresult pt
- \pgfmathsubtract@{#2}{1.0}%
- \pgf@xa=\pgfmathresult \pgf@xa
- \divide\pgf@xa by2
- \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
- \endgroup
- \pgfmathsubtract@{\csname pgfplots@#1min\endcsname}{\pgfplots@glob@TMPb}%
- \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
- \pgfmathadd@{\csname pgfplots@#1max\endcsname}{\pgfplots@glob@TMPb}%
- \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
-%\message{\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname. [+- \pgfplots@glob@TMPb]}%
- %
- % Update auxiliary data members:
- \pgfplots@visphase@notify@changeofcanvaslimits{#1}%
- \fi
-}%
-
-% #1: an axis which should be scaled
-% #2: the desired final ratio ||e_#1||/||e_ref||
-\def\pgfplots@getscale@unit@vector@reltoreference#1#2{%
- %
- % If the datascaling transformation is active (which is almost
- % everytime the case here), we have a transformation
- % T^{-1}(x)= 10^scale * x
- % with different scales for every axis.
- %
- % If the datascaling transformation is NOT active, scale is 0
- % and T^{-1} = Identity.
- %
- % Note that the datascaling transformation also has
- % translations (shifts). These are not important here.
- %
- % Goal:
- % compute E_#1 such that
- % #2* || T^{-1} e_ref || = || T^{-1} E_#1 ||
- % where T^{-1} is the data scaling transformation and e_ref the
- % reference unit vector. Keep in mind that there are
- % *different* data scaling transformations for each axis.
- %
- % We are given e_ref and e_#1 and the desired aspect ratio
- % between e_ref and E_#1, which is available as #2.
- %
- % So: T^{-1} E_#1 := s* T^{-1} e_#1 where
- % s = #2 * ||T^{-1} e_ref|| / || T^{-1} e_#1 ||
- % = |10^{scale_ref}| / |10^{scale_#1}| * #2 * || e_ref|| / ||e_#1||.
- %
- % Then, E_#1 = T ( T^{-1} E_#1 ) = s * e_#1.
- %
- % -> compute 's'!
- %
- % Part 1: compute
- % #2 * ||e_ref|| / ||e_#1||.
- %
- \def\pgfplots@loc@TMPa{1}%
- \ifdim\csname pgfplots@#1@veclength\endcsname pt=0pt
- \def\pgfplots@loc@TMPa{0}%
- \else
- \ifdim\csname pgfplots@\pgfplots@apply@unit@ratio@reference @veclength\endcsname pt=0pt
- \def\pgfplots@loc@TMPa{0}%
- \fi
- \fi
- \if0\pgfplots@loc@TMPa
- \def\pgfmathresult{16001}%
- \else
- \pgfmathmultiply@
- {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @veclength\endcsname}
- {\csname pgfplots@#1@inverseveclength\endcsname}%
- \pgfmathmultiply@
- {\pgfmathresult}%
- {#2}%
- \global\let\pgfplots@glob@TMPa=\pgfmathresult
- %
- % also compute 1/s, required as temporary value:
- %\pgfmathmultiply@
- % {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @inverseveclength\endcsname}
- % {\csname pgfplots@#1@veclength\endcsname}%
- %\ifdim#2pt=1pt
- %\else
- % \pgfmathdivide@{\pgfmathresult}{#2}%
- %\fi
- %\global\let\pgfplots@glob@TMPb=\pgfmathresult
- %
- % Part 2: handle data scaling trafo scales:
- \begingroup
- \def\pgfplots@tmp@exponentref{0}%
- \def\pgfplots@tmp@exponentK{0}%
- \pgfplots@if{pgfplots@apply@datatrafo@\pgfplots@apply@unit@ratio@reference }{%
- \pgfplots@letcsname{pgfplots@tmp@exponentref}={pgfplots@data@scale@trafo@EXPONENT@\pgfplots@apply@unit@ratio@reference }%
- }{}%
- \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
- \pgfplots@letcsname{pgfplots@tmp@exponentK}={pgfplots@data@scale@trafo@EXPONENT@#1}%
- }{}%
- \c@pgf@counta=\pgfplots@tmp@exponentref\relax
- \advance\c@pgf@counta by-\pgfplots@tmp@exponentK\relax
- \ifnum\c@pgf@counta=0
- \else
- \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPa}{\c@pgf@counta}%
- \global\let\pgfplots@glob@TMPa=\pgfmathresult
- % \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPb}{-\c@pgf@counta}%
- % \global\let\pgfplots@glob@TMPb=\pgfmathresult
- \fi
- \xdef\pgfplots@glob@TMPc{\the\c@pgf@counta}%
- \endgroup
- \let\pgfmathresult=\pgfplots@glob@TMPa
- \fi
-%\message{\string\pgfplots@getscale@unit@vector@reltoreference{#1}{#2} (reference \pgfplots@apply@unit@ratio@reference) = \pgfmathresult.^^J}%
-}
% should be invoked whenever \pgfplots@#1min or \pgfplots@#1max have
% been changed during the visualization phase (for example, axis equal
@@ -6206,171 +5457,8 @@
\if1\pgfplots@glob@TMPc #3\else #4\fi
}%
-% PRECONDITION:
-% - final axis limits are given in transformed range
-% - \pgfplots@set@default@size@options has been invoked before
-% POSTCONDITION:
-% - the current x,y and z unit vectors are defined properly;
-% - the fast-access registers are initialised for the axis limits,
-% - the following macros are assigned:
-% \pgfplots@[xyz]@veclength
-% \pgfplots@[xyz]@inverseveclength
-% \pgfplotspointxaxis
-% \pgfplotspointyaxis
-% \pgfplotspointzaxis
-% \pgfplotspointcenter
-% \pgfplotspointminminmin
-%
-\def\pgfplots@initsizes{%
- % INIT.
- %
- %
- \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}%
- % FIXME
- \let\pgfplots@view@el=\pgfutil@empty
- \let\pgfplots@view@az=\pgfutil@empty
- \fi
- \ifx\pgfplots@view@az\pgfutil@empty
- % Note that in presence of "x,y,z" options, the
- % \pgfplots@set@default@size@options RESETS /pgfplots/view/az.
- %
- %\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}%
- %
- \pgfpointdiff
- {\pgfplotsqpointxy{\pgfplots@xmin}{\pgfplots@ymin}}
- {\pgfplotsqpointxy{\pgfplots@xmax}{\pgfplots@ymax}}%
- % 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
- %
- \pgfplotsqpointxy{\pgfplots@tmpXscale}{\pgfplots@tmpYscale}%
- \edef\pgfplots@tmpXscale{\the\pgf@x}%
- \edef\pgfplots@tmpYscale{\the\pgf@y}%
- %
- \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}%
- \ifcase\pgfplots@scale@mode@choice\relax
- % scale mode=auto : do nothing in this context.
- \else
- \pgfplots@scale@axisbox@to@widthheight
- \fi
- \ifpgfplots@threedim
- \pgfplotsgetnormalforcurrentview
- \fi
- \else
- % 3D case by `view':
- \let\pgfplots@x=\pgfutil@empty
- \let\pgfplots@y=\pgfutil@empty
- \let\pgfplots@z=\pgfutil@empty
- % this invokes \pgfplots@scale@plotbox@to@widthheight automatically.
- \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), n = (\pgfplots@view@dir@threedim@x,\pgfplots@view@dir@threedim@y,\pgfplots@view@dir@threedim@z).^^J }%
- %
- \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}{}%
- \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
- \fi
- \pgfplots@apply@unit@ratio
- %
- \pgfplots@axis@apply@post@scale x
- \pgfplots@axis@apply@post@scale y
- \ifpgfplots@threedim
- \pgfplots@axis@apply@post@scale z
- \fi
-}
-\def\pgfplots@axis@apply@post@scale#1{%
- %
- \pgfkeysgetvalue{/pgfplots/#1 post scale}\pgfmathresult
- \ifx\pgfmathresult\pgfutil@empty
- \else
- \pgfmathparse{\pgfmathresult}%
- \ifdim\pgfmathresult pt=1pt
- \else
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \csname pgf@#1x\endcsname=\pgfmathresult\csname pgf@#1x\endcsname
- \csname pgf@#1y\endcsname=\pgfmathresult\csname pgf@#1y\endcsname
- %
- \pgfmathmultiply@{\csname pgfplots@#1@veclength\endcsname}{\pgfplots@loc@TMPa}%
- \expandafter\let\csname pgfplots@#1@veclength\endcsname=\pgfmathresult
- %
- \pgfmathdivide@{\csname pgfplots@#1@inverseveclength\endcsname}{\pgfplots@loc@TMPa}%
- \expandafter\let\csname pgfplots@#1@inverseveclength\endcsname=\pgfmathresult
- \fi
- \fi
-}
-% This here is a low-weight node. It can ONLY be used during axis
-% descriptions and is completely useless otherwise.
-%
-% See pgfplots@low@level@shape below.
-\pgfdeclareshape{pgfplots@low@level@shape@INNER}{%
- \nodeparts{image}%
+\def\pgfplots@low@level@shape@INNER@define{%
\anchor{image}{\pgfpointorigin}%
%
%
@@ -6413,8 +5501,17 @@
{\pgfplotsqpointdescriptionxy{0}{0}}
{\pgfplotsqpointdescriptionxy{1}{0}}%
}%
+}
+
+% This here is a low-weight node. It can ONLY be used during axis
+% descriptions and is completely useless otherwise.
+%
+% See pgfplots@low@level@shape below.
+\pgfdeclareshape{pgfplots@low@level@shape@INNER}{%
+ \nodeparts{image}%
%%
%%
+ \pgfplots@low@level@shape@INNER@define
%%
%%
\anchorborder{}%
@@ -6432,12 +5529,14 @@
% of anchors.
\pgfdeclareshape{pgfplots@low@level@shape}{%
% The '(0,0)' point is the LOWER LEFT OUTER CORNER.
- \savedanchor\upperrightcorner{
- \global\pgf@x=\wd\pgfnodepartimagebox
- \global\pgf@y=\ht\pgfnodepartimagebox
+ \savedanchor\upperrightcorner{%
+ % FIXME : is this correct?
+ \pgfplotspointupperrightcorner
+ %\global\pgf@x=\wd\pgfnodepartimagebox
+ %\global\pgf@y=\ht\pgfnodepartimagebox
}%
\savedanchor\lowerleftinnercorner{%
- \pgfqpoint{\pgfplots@savedanchor@inner@lowerleft@x\relax}{\pgfplots@savedanchor@inner@lowerleft@y\relax}%
+ \pgfplotspointlowerleftinnercorner%
}%
\savedanchor\innerdiagonal{\pgfplotspointbbdiagonal}%
\savedanchor\origin{%
@@ -6450,7 +5549,6 @@
\global\pgf@y=0pt %
}%
%
- %
\anchor{center}{%
\pgfpointadd
{\lowerleftinnercorner}%
@@ -6695,11 +5793,13 @@
\pgfdeclareshape{pgfplots@low@level@shape@deprecated}{%
% The '(0,0)' point is the LOWER LEFT OUTER CORNER.
\savedanchor\upperrightcorner{
- \global\pgf@x=\wd\pgfnodepartimagebox
- \global\pgf@y=\ht\pgfnodepartimagebox
+ % FIXME : is this correct?
+ \pgfplotspointupperrightcorner
+ %\global\pgf@x=\wd\pgfnodepartimagebox
+ %\global\pgf@y=\ht\pgfnodepartimagebox
}%
\savedanchor\lowerleftinnercorner{%
- \pgfqpoint{\pgfplots@savedanchor@inner@lowerleft@x\relax}{\pgfplots@savedanchor@inner@lowerleft@y\relax}%
+ \pgfplotspointlowerleftinnercorner%
}%
\savedanchor\xaxisvec{\pgfplotspointxaxis}%
\savedanchor\yaxisvec{\pgfplotspointyaxis}%
@@ -7122,7 +6222,10 @@
\pgfplots@error{Sorry, your choice for '3d box' and 'axis x line' is incompatible.}%
\else
% 3d box=complete or complete*
+ \pgfplotsgetlayerforstyle{every 3d box foreground}%
+ \pgfplotsonlayer{\pgfplotsretval}{every 3d box foreground}%
\begingroup
+ \pgfplots@layered@graphicsfalse% no distinction of layers here.
\pgfplotsset{every 3d box foreground}%
\let\pgfplots@drawticklabels@onorientedsurf=\relax
\if2\pgfplots@threedimbox@choice
@@ -7189,6 +6292,7 @@
}{}%
%\fi
\endgroup
+ \endpgfplotsonlayer
% end of 3d box=complete
\fi
\fi
@@ -7319,7 +6423,7 @@
% will be initialised.
%
% ABOUT THE ALGORITHM:
-% Given \pgfplots@view@dir@threedim@[xyz], we know the view direction (in 3D!).
+% Given \pgfplots@view@dir@threedim, we know the view direction (in 3D!).
% Now, we compute the scalar products <n,(1,0,0)'> <n,(0,1,0)'> and
% <n,(0,0,1)'> between the view direction n and the unit vectors in 3D
% space. Of course, these scalar products are just specific components
@@ -7338,29 +6442,30 @@
\expandafter\def\csname pgfplots@surfviewdepth@v2v\endcsname{f}%
\expandafter\def\csname pgfplots@surfviewdepth@vv2\endcsname{f}%
\ifpgfplots@threedim
+ \pgfplotsmathvectortocomponents\pgfplots@view@dir@threedim{pgfplots@loc@}{default}%
% respect reversed axes here. If I am not mistaken, it should
% be completely sufficient to flip signs here:
- \ifdim\pgfplots@view@dir@threedim@x pt\if\pgfkeysvalueof{/pgfplots/x dir/value}n>\else<\fi0pt
+ \pgfplotscoordmath{default}{if is}{\pgfplots@loc@x}{\if\pgfkeysvalueof{/pgfplots/x dir/value}n+\else-\fi}{%
\expandafter\def\csname pgfplots@surfviewdepth@0vv\endcsname{f}% foreground
\expandafter\def\csname pgfplots@surfviewdepth@1vv\endcsname{b}% background
- \else
+ }{%
\expandafter\def\csname pgfplots@surfviewdepth@0vv\endcsname{b}%
\expandafter\def\csname pgfplots@surfviewdepth@1vv\endcsname{f}%
- \fi
- \ifdim\pgfplots@view@dir@threedim@y pt\if\pgfkeysvalueof{/pgfplots/y dir/value}n>\else<\fi0pt
+ }%
+ \pgfplotscoordmath{default}{if is}{\pgfplots@loc@y}{\if\pgfkeysvalueof{/pgfplots/y dir/value}n+\else-\fi}{%
\expandafter\def\csname pgfplots@surfviewdepth@v0v\endcsname{f}% foreground
\expandafter\def\csname pgfplots@surfviewdepth@v1v\endcsname{b}% background
- \else
+ }{%
\expandafter\def\csname pgfplots@surfviewdepth@v0v\endcsname{b}%
\expandafter\def\csname pgfplots@surfviewdepth@v1v\endcsname{f}%
- \fi
- \ifdim\pgfplots@view@dir@threedim@z pt\if\pgfkeysvalueof{/pgfplots/z dir/value}n>\else<\fi0pt
+ }%
+ \pgfplotscoordmath{default}{if is}{\pgfplots@loc@z}{\if\pgfkeysvalueof{/pgfplots/z dir/value}n+\else-\fi}{%
\expandafter\def\csname pgfplots@surfviewdepth@vv0\endcsname{f}% foreground
\expandafter\def\csname pgfplots@surfviewdepth@vv1\endcsname{b}% background
- \else
+ }{%
\expandafter\def\csname pgfplots@surfviewdepth@vv0\endcsname{b}%
\expandafter\def\csname pgfplots@surfviewdepth@vv1\endcsname{f}%
- \fi
+ }%
\else
% FIXME : it might be better to implement that stuff here
% implicilty using the 3D algorithms.
@@ -7448,51 +6553,64 @@
\def\pgfplots@loc@axischar@for@first{x}%
\fi
\fi
- \pgfplotsifaxislineisonconvexhull{\pgfplots@loc@to@threedim 00}{%
- % -> both, v00 or v11 are on CH.
- %
- % Decide whether the '{0.5}{0}{0}' point is above or below
- % the {0.5}{0.5}{0.5}
- % point. This '<' operation is based on the '#1ticklabel pos'
- % key, the 2D projection of the axis and the argument '#2'.
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 00}%
- \pgfqpointscale{0.5}{\csname pgfplotspoint#1axis\endcsname}%
- \ifdim\csname pgf@#2\endcsname<\csname pgfplots@tmp@center#2\endcsname\relax
- \if u\csname pgfplots@#1ticklabel@pos\endcsname
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 11}%
- \fi
- \else
- \if l\csname pgfplots@#1ticklabel@pos\endcsname
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 11}%
- \fi
- \fi
- }{%
- % -> both, v01 or v10 are on CH
- %--------------------------------------------------
- % \pgfplotsifaxislineisonconvexhull{\pgfplots@loc@to@threedim 01}{% FIXME : eliminate sanity assertion if possible
- % }{%
- % \pgfplots@error{INTERNAL ERROR}%
- % }%
- %--------------------------------------------------
- % Decide whether the '{0.5}{1}{0}' point is above or below
- % the {0.5}{0.5}{0.5} point. Again, the '<' operation is based
- % on the '#1ticklabel pos' key, the projection and #2.
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 10}%
- % compute the middle point on \pgfplots@loc@to@threedim 10
- \pgfpointadd
- {\csname pgfplotspoint\pgfplots@loc@axischar@for@first axis\endcsname}
- {\pgfpointscale{0.5}{\csname pgfplotspoint#1axis\endcsname}}%
+ %\if2\csname pgfplots@#1axislinesnum\endcsname
+ % axis #1 lines=center .
+ \iffalse
+ % FIXME : while this here seems reasonable, it is not fully
+ % implemented. The "outer normal" is missing and one other
+ % component produces a NYI-warning
%
- \ifdim\csname pgf@#2\endcsname<\csname pgfplots@tmp@center#2\endcsname\relax
- \if u\csname pgfplots@#1ticklabel@pos\endcsname
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 01}%
+ % well, for 3d, this implies that all others also have
+ % "center". And since "0" == lower, "1" == upper", "2" ==
+ % center, we have to use center:
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 22}%
+ \else
+ \pgfplotsifaxislineisonconvexhull{\pgfplots@loc@to@threedim 00}{%
+ % -> both, v00 or v11 are on CH.
+ %
+ % Decide whether the '{0.5}{0}{0}' point is above or below
+ % the {0.5}{0.5}{0.5}
+ % point. This '<' operation is based on the '#1ticklabel pos'
+ % key, the 2D projection of the axis and the argument '#2'.
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 00}%
+ \pgfqpointscale{0.5}{\csname pgfplotspoint#1axis\endcsname}%
+ \ifdim\csname pgf@#2\endcsname<\csname pgfplots@tmp@center#2\endcsname\relax
+ \if u\csname pgfplots@#1ticklabel@pos\endcsname
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 11}%
+ \fi
+ \else
+ \if l\csname pgfplots@#1ticklabel@pos\endcsname
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 11}%
+ \fi
\fi
- \else
- \if l\csname pgfplots@#1ticklabel@pos\endcsname
- \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 01}%
+ }{%
+ % -> both, v01 or v10 are on CH
+ %--------------------------------------------------
+ % \pgfplotsifaxislineisonconvexhull{\pgfplots@loc@to@threedim 01}{% FIXME : eliminate sanity assertion if possible
+ % }{%
+ % \pgfplots@error{INTERNAL ERROR}%
+ % }%
+ %--------------------------------------------------
+ % Decide whether the '{0.5}{1}{0}' point is above or below
+ % the {0.5}{0.5}{0.5} point. Again, the '<' operation is based
+ % on the '#1ticklabel pos' key, the projection and #2.
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 10}%
+ % compute the middle point on \pgfplots@loc@to@threedim 10
+ \pgfpointadd
+ {\csname pgfplotspoint\pgfplots@loc@axischar@for@first axis\endcsname}
+ {\pgfpointscale{0.5}{\csname pgfplotspoint#1axis\endcsname}}%
+ %
+ \ifdim\csname pgf@#2\endcsname<\csname pgfplots@tmp@center#2\endcsname\relax
+ \if u\csname pgfplots@#1ticklabel@pos\endcsname
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 01}%
+ \fi
+ \else
+ \if l\csname pgfplots@#1ticklabel@pos\endcsname
+ \expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots@loc@to@threedim 01}%
+ \fi
\fi
- \fi
- }%
+ }%
+ \fi
}%
\def\pgfplots@init@ticklabelaxisspec@twodim@for#1#2{%
\if#1x%
@@ -7677,11 +6795,321 @@
\pgfkeyslet{/pgfplots/.unknown/.@cmd}\pgfplots@BEGIN@prepare@description@styles@oldhandler
}%
-\def\pgfplots@BEGIN@init@and@draw@axis{%
- \pgfplots@determinedefaultvalues
+\newif\ifpgfplots@layered@graphics
+
+
+% Shortcut for '\pgfplotsset{set layers={#1}}'.
+%
+% USAGE:
+% 1. \pgfplotssetlayers{<layer config name>} (one declared with /.define layer set)
+% 2. \pgfplotssetlayers (no braces)
+% 3. \pgfplotssetlayers{<comma-separated-list-of-layers>}
+%
+% This command immediately installs a \pgfsetlayers command. It also prepares following axes.
+% ATTENTION: this might affect tikzpictures as well.
+%
+\def\pgfplotssetlayers{%
+ \pgfutil@ifnextchar\bgroup{\pgfplotssetlayers@}{\pgfplotsset{set layers}}%
+}%
+\def\pgfplotssetlayers@#1{%
+ \pgfplotsset{set layers={#1}}%
+}%
+
+% This method checks if '#1' is a well-known layer set. If that is the case, the layer set is initialized.
+% If there is no such layer set, #1 is assumed to be a comma-separated-list of layer names.
+% These layers are defined if they do not exist already.
+%
+% POSTCONDITION:
+% - a \pgfsetlayers{<list>} is issued (immediately)
+% - '/pgfplots/@set layers arg' is defined such that any following axes can initialized their layers.
+\def\pgfplots@key@set@layers#1{%
+ %
+ % auto detect if '#1' is a defined layer set:
+ \pgfkeysifdefined{#1/list}{%
+ \def\pgfkeyscurrentname{#1}%
+ }{%
+ \pgfkeysifdefined{/pgfplots/layers/#1/list}{%
+ \edef\pgfkeyscurrentname{/pgfplots/layers/#1}%
+ }{%
+ \let\pgfkeyscurrentname\pgfutil@empty
+ }%
+ }%
+ \ifx\pgfkeyscurrentname\pgfutil@empty
+ % OK. The argument is NO layer set configuration.
+ \pgfplots@key@set@layers@{#1}%
+ \pgfkeyslet{/pgfplots/@set layers arg}\pgfutil@empty%
+ \else
+ % OK, The argument is the key name of some '/.define layer set' key.
+ % Remember it for later and initialize the layers:
+ \pgfkeyslet{/pgfplots/@set layers arg}\pgfkeyscurrentname%
+ \pgfkeysgetvalue{\pgfkeyscurrentname/list}\pgfplots@loc@TMPa
+ \expandafter\pgfplots@key@set@layers@\expandafter{\pgfplots@loc@TMPa}%
+ \fi
+}
+% a simple method which (immediately) invokes \pgfsetlayers{#1}.
+%
+% The only difference is that it creates missing layers on-the-fly.
+\def\pgfplots@key@set@layers@#1{%
+ \edef\pgfplots@loc@TMPa{#1}%
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ % DEFAULT.
+ \pgfsetlayers{main}%
+ \else
+ \def\pgfplots@loc@TMPb{false}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % "use layers=false"
+ \pgfsetlayers{main}%
+ \else
+ \def\pgfplots@loc@TMPb{main}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % "use layers=main"
+ \pgfsetlayers{main}%
+ \else
+ % declare all layers, and collect the normalised list
+ % into \pgfplots@loc@TMPd
+ \def\pgfplots@loc@TMPd{}%
+ \expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplots@loc@TMPa}\as\pgfplots@loc@TMPa{%
+ % normalize argument:
+ \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa}%
+ \expandafter\pgfplotsutil@trim\expandafter{\pgfplots@loc@TMPa}%
+ \let\pgfplots@loc@TMPa=\pgfplotsretval
+ %
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \else
+ \def\pgfplots@loc@TMPb{main}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ \else
+ \expandafter\pgfdeclarelayer\expandafter{\pgfplots@loc@TMPa}%
+ \fi
+ \edef\pgfplots@loc@TMPd{\ifx\pgfplots@loc@TMPd\pgfutil@empty\else\pgfplots@loc@TMPd,\fi\pgfplots@loc@TMPa}%
+ \fi
+ }%
+ % activate layers:
+ \pgfplots@log3{Setting layers '\pgfplots@loc@TMPd'...}%
+ \expandafter\pgfsetlayers\expandafter{\pgfplots@loc@TMPd}%
+ \fi
+ \fi
+ \fi
+}%
+
+\def\pgfplots@prepare@layered@graphics{%
+ % check if there are no layers at all.
+ \ifpgfplots@layered@graphics
+ \pgfutil@ifundefined{pgf@layerlist}{%
+ }{%
+ \ifx\pgf@layerlist\pgfutil@empty
+ \pgfplots@layered@graphicsfalse
+ \else
+ \def\pgfplots@loc@TMPa{main}%
+ \ifx\pgf@layerlist\pgfplots@loc@TMPa
+ \pgfplots@layered@graphicsfalse
+ \fi
+ \fi
+ }%
+ \fi
+}%
+
+% validates 'mark layer' such that it can be queried afterwards.
+\def\pgfplots@prepare@layered@graphics@marks{%
+ \ifpgfplots@layered@graphics
+ \pgfkeysgetvalue{/pgfplots/mark layer}\pgfplots@loc@TMPa
+ \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa}%
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \def\pgfplots@loc@TMPa{auto}%
+ \fi
+ \def\pgfplots@loc@TMPb{auto}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % COMBINATION: 'activate layers,mark layer=auto' --> keep
+ % backwards compatibility with 'clip marker paths'
+ % -> nothing to do.
+ \pgfkeyslet{/pgfplots/mark layer}\pgfutil@empty%
+ \else
+ % mark layer=like plot
+ \def\pgfplots@loc@TMPb{like plot}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % draw markers together with their plot (no matter
+ % on which layer):
+ \pgfplots@clip@marker@pathstrue
+ \pgfkeyslet{/pgfplots/mark layer}\pgfutil@empty%
+ \else
+ \edef\pgfplots@loc@TMPb{\pgfkeysvalueof{/pgfplots/on layer}}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % nothing to do; they are on the same layer
+ % anyway: (this is the same as 'like plot'
+ \pgfplots@clip@marker@pathstrue
+ \pgfkeyslet{/pgfplots/mark layer}\pgfutil@empty%
+ \else
+ % OK, marks will be plotted on their own layer.
+ \fi
+ \fi
+ \fi
+ \else
+ % reset its value:
+ \pgfkeyslet{/pgfplots/mark layer}\pgfutil@empty%
+ \fi
+}%
+
+% #2: context information (for improved error recovery), optional
+\def\pgfplotsonlayer#1{%
+ \pgfutil@ifnextchar\bgroup{\pgfplotsonlayer@{#1}}{\pgfplotsonlayer@{#1}{}}%
+}
+\def\pgfplotsonlayer@#1#2{%
+ \begingroup
+ \def\b@pgfplotsonlayer@started{0}%
+ \ifpgfplots@layered@graphics
+ \edef\pgfplots@loc@TMPa{#1}%
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \else
+ \def\b@pgfplotsonlayer@started{1}%
+ \pgfonlayer{#1}%
+ \fi
+ \fi
+}%
+\def\endpgfplotsonlayer{%
+ \ifpgfplots@layered@graphics
+ \if1\b@pgfplotsonlayer@started
+ \endpgfonlayer
+ \fi
+ \fi
+ \endgroup
+}%
+
+
+% Searches for the layers of a (set of) style name(s).
+%
+% #1 is a style name like 'every major grid'. It can also be a list of
+% style names.
+%
+% The last "on layer" key found in these styles will be used here.
+%
+% Note that the "on layer" keys have already been extracted in during
+% the key filtering procedure.
+\def\pgfplotsgetlayerforstyle#1{%
+ \let\pgfplotsretval=\pgfutil@empty
+ \ifpgfplots@layered@graphics
+ % this here is the return value:
+ \let\pgfplots@loc@TMPc=\pgfutil@empty
+ %
+ % search list:
+ \pgfplotsutilforeachcommasep{#1}\as\pgfplots@loc@TMPa{%
+ \pgfkeysifdefined{/pgfplots/layers for styles/\pgfplots@loc@TMPa}{%
+ % oh, good: I have already processed the requested
+ % style, and I already know if it has a particular
+ % layer.
+ \pgfkeysgetvalue{/pgfplots/layers for styles/\pgfplots@loc@TMPa}\pgfplots@loc@TMPb
+ }{%
+ % hm. Ok, then process the style. Throw everything
+ % away, keep only the layer.
+ \begingroup
+ \pgfkeyslet{/pgfplots/on layer}\pgfutil@empty
+ \pgfkeysdef{/handlers/.unknown}{}% do nothing
+ \pgfkeysdef{/tikz/.unknown}{}% also, do nothing.
+ \pgfplotsset{#1}% let's hope this works with unknown keys...
+ \pgfkeysgetvalue{/pgfplots/on layer}\pgfplots@loc@TMPb
+ \pgfmath@smuggleone\pgfplots@loc@TMPb
+ \endgroup
+ }%
+ \ifx\pgfplots@loc@TMPb\pgfutil@empty
+ \else
+ % update return value:
+ \let\pgfplots@loc@TMPc=\pgfplots@loc@TMPb
+ \fi
+ }%
+ \let\pgfplotsretval=\pgfplots@loc@TMPc
+%\message{\string\pgfplotsgetlayerforstyle{#1} = '\pgfplotsretval'^^J}%
+ \fi
+}%
+
+% The purpose of this method is to check for the cases where no cell picture is necessary.
+% The idea behind this anchor is to insert the axis DIRECTLY into the embedding tikzpicture, without
+% a posteriori shifting.
+%
+% A posteriori shifting == anchors whose dimensions are not fixed
+% until the complete axis has been "typeset".
+%
+% Disabling the cell picture will still prepare ALL anchors correctly,
+% but it disables many of the anchor choices when it comes to the
+% alignment of the current axis (in other words: other node can align
+% using the anchors of this axis, but this axis cannot be aligned based on its anchors).
+%
+% The motivation for this feature is to implement multi-axis support together with layered graphics.
+%
+% The 'cell picture=false' feature may be interesting for SVG export as
+% well.
+\def\pgfplots@prepare@cell@picture{%
+ \pgfplots@ifcellpicture@required{%
+ \pgfplots@has@cell@picturetrue
+ }{%
+ % cell picture=false or cell picture=if necessary
+ %
+ % anchor processing is special in this case! The standard
+ % anchor processing uses a posteriori shifts. This feature
+ % here REQUIRES a priori shifts.
+ % Prepare special handling for these shifts:
+ \pgfplots@has@cell@picturefalse
+ \edef\pgfplots@anchorname@internal{\pgfplots@anchorname}%
+ %\def\pgfplots@anchorname{image}%
+ %
+ \let\pgfplots@BEGIN@cell@picture=\pgfplots@BEGIN@cell@picture@DISABLED
+ \let\pgfplots@END@cell@picture=\pgfplots@END@cell@picture@DISABLED
+ \def\pgfplots@add@named@child@node##1{}% do nothing here
+ \let\pgfplots@finally@correct@child@node@positions=\relax
+ %
+ % translate the coordinate system before the 'current axis'
+ % node is generated.
+ \expandafter\def\expandafter\pgfplots@beforenode\expandafter{\pgfplots@beforenode
+ \setbox\pgfnodepartimagebox=\hbox{}%
+ }%
+ }%
+}
+
+\long\def\pgfplots@ifcellpicture@required#1#2{%
+ \if1\pgfplots@cell@picture@mode
+ % cell picture=true
+ #1\relax
+ \else
+ % cell picture=false | cell picture=if necessary
+ \edef\pgfplots@shapename{pgfplots@low@level@shape@INNER}%
+ \pgfutil@ifundefined{pgf@anchor@\pgfplots@shapename @\pgfplots@anchorname}{%
+ % we need to compute the anchor a posteriorily.
+ \if0\pgfplots@cell@picture@mode
+ % cell picture=false is forbidden here...
+ \pgfplots@error{Sorry, 'cell picture=false' is UNSUPPORTED for 'anchor=\pgfplots@anchorname'.}%
+ \fi
+ \if2\pgfplots@cell@picture@mode
+ \pgfplots@log3{'cell picture=if necessary' resulted in 'cell picture=true'}%
+ \fi
+ #1\relax
+ }{%
+ \pgfplots@log3{'cell picture=if necessary' resulted in 'cell picture=false'}%
+ % OK, an a priori anchor is available - we do not really need
+ % a cell picture and this is compatible with the input
+ % options:
+ #2\relax
+ }%
+ \fi
+}%
+
+\def\pgfplots@define@preliminary@current@axis@node{%
+ \begingroup
+ \pgfplots@sys@beforenode
+ % create a leight-weight 'current axis' node for anchor references
+ % (which may happen during both, the axis descriptions or any
+ % path/plot commands).
+ \pgfmultipartnode{pgfplots@low@level@shape@INNER}{image}{current axis}{\pgfusepath{discard}}%
+ \endgroup
+}%
+
+\def\pgfplots@BEGIN@cell@picture[#1]{%
+ %
+ \pgfplots@define@preliminary@current@axis@node
+ %
+ \pgfplotsutil@BEGIN@cell@picture[#1]%
+}%
+\def\pgfplotsutil@BEGIN@cell@picture[#1]{%
\setbox\pgfnodepartimagebox=\hbox\bgroup\bgroup
\pgfinterruptpicture
- \tikzpicture[/pgfplots/every axis]%
+ \tikzpicture[#1]%
% set baseline for sub-picture to default value.
% the baseline option will be applied to the OUTER picture.
\pgfsetbaseline{\pgf@picminy}%
@@ -7698,15 +7126,142 @@
\xdef\pgfplots@glob@TMPa{{\aa}{\ab}{\ba}{\bb}}%
\endgroup
\expandafter\pgfsettransformentries\pgfplots@glob@TMPa{0pt}{0pt}%
+}
+
+\def\pgfplotsutil@END@cell@picture#1{%
+ \endtikzpicture%
+ \begingroup
+ \ifdim\pgf@picmaxx=-16000pt\relax%
+ \pgf@picmaxx=0pt\relax%
+ \pgf@picminx=0pt\relax%
+ \pgf@picmaxy=0pt\relax%
+ \pgf@picminy=0pt\relax%
+ \fi%
+ #1
+ \endgroup
+ \endpgfinterruptpicture
+ \egroup\egroup% end of pgfnodepartimagebox
+ %
+ % restore any shift transformations provided to an axis.
+ % These would be lost otherwise.
+ \pgftransformshift{\pgfplots@savedtransformshift}%
+ %
+ % allow positioning of colorbars with this hook.
+ % It is \relax unless this here is a color bar axis.
+ % Its intention is to re-define `\pgfplots@at':
+ \pgfplots@colorbar@position@hook%
+ %
+ \pgftransformshift{\pgfplots@at}%
+ %
+}%
+\def\pgfplots@END@cell@picture{%
+ \pgfplotsutil@END@cell@picture{\pgfplots@END@cell@picture@preparepoints}%
+}%
+
+\def\pgfplots@END@cell@picture@preparepoints{%
+ % Protocol sizes for the axis-shape.
+ % That needs to be done globally, do avoid all those
+ % \endgroup's in and after \endpgfinterruptpicture ...
+ %
+ \xdef\pgfplotspointorigininternal{\global\pgf@x=\the\pgf@picminx\space\global\pgf@y=\the\pgf@picminy\space}%
+ %
+ \ifpgfplots@deprecated@anchors
+ \pgfplotspointminminmin
+ \else
+ \pgfplotspointbblowerleft
+ \fi
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgf@pos@transform\pgf@xa\pgf@ya
+ \advance\pgf@xa by-\pgf@picminx
+ \advance\pgf@ya by-\pgf@picminy
+ \xdef\pgfplotspointlowerleftinnercorner{%
+ \global\pgf@x=\the\pgf@xa\space
+ \global\pgf@y=\the\pgf@ya\space
+ }%
+ %
+ \global\pgf@x=\pgf@picmaxx
+ \global\pgf@y=\pgf@picmaxy
+ \global\advance\pgf@x by-\pgf@picminx
+ \global\advance\pgf@y by-\pgf@picminy
+ \xdef\pgfplotspointupperrightcorner{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
+ %
+ \pgfplotspointaxisorigin
+ \pgf@pos@transform\pgf@x\pgf@y
+ \global\advance\pgf@x by-\pgf@picminx
+ \global\advance\pgf@y by-\pgf@picminy
+ \xdef\pgfplotspointaxisorigin{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
+}
+
+% this here is essentially the same as
+% \pgfpointanchor{current axis}{#1}
+% but it does not need a node.
+\def\pgfplotspointdescriptionbyanchor#1{%
+ \begingroup
+ \edef\pgfplotspointdescriptionbyanchor@{#1}%
+ \gdef\pgfplots@glob@TMPa{0}%
+ % do a linear search through all anchors of
+ % shape pgfplots@low@level@shape@INNER :
+ \def\anchor##1##2{%
+ \def\pgfplots@loc@TMPa{##1}%
+ \ifx\pgfplots@loc@TMPa\pgfplotspointdescriptionbyanchor@
+ \pgf@process{##2}%
+ \gdef\pgfplots@glob@TMPa{1}%
+ \fi
+ }%
+ \pgfplots@low@level@shape@INNER@define
+ \if0\pgfplots@glob@TMPa
+ \pgfplots@error{The anchor '#1' is unsupported in this context.}%
+ \fi
+ \endgroup
+}%
+
+\def\pgfplots@BEGIN@cell@picture@DISABLED[#1]{%
+ \begingroup
+ \pgfinterruptboundingbox
+ %
+ %
+ % allow positioning of colorbars with this hook.
+ % It is \relax unless this here is a color bar axis.
+ % Its intention is to re-define `\pgfplots@at':
+ \pgfplots@colorbar@position@hook%
+ %
+ \pgftransformshift{\pgfplots@at}%
+ %
+ % prepare a priori anchor transformation (see
+ % \pgfplots@prepare@cell@picture for details):
+ \pgftransformshift{%
+ \pgfqpointscale{-1}{\pgfplotspointdescriptionbyanchor{\pgfplots@anchorname@internal}}%
+ }%
+ %
+ \pgfplots@define@preliminary@current@axis@node
+ %
+ \scope[#1]%
+}%
+\def\pgfplots@END@cell@picture@DISABLED{%
+ \endscope%
+ \begingroup
+ \pgfplots@END@cell@picture@preparepoints%
+ \endgroup
+ \endpgfinterruptboundingbox
+ \endgroup
+}%
+
+\def\pgfplots@BEGIN@init@and@draw@axis{%
%
%
\pgfplots@draw@axis@pre
\pgfplots@draw@axis@is@prepared
\scope
%
- \pgfkeysifdefined{/pgfplots/axis background/.@cmd}{%
- \path[/pgfplots/axis background] \pgfextra{\pgfplots@clippath@install{}};%
- }{}%
+ \pgfkeysgetvalue{/pgfplots/axis background/.@cmd}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfplots@empty@style@key
+ \else
+ \pgfplotsgetlayerforstyle{/pgfplots/axis background,/pgfplots/axis background@}%
+ \pgfplotsonlayer{\pgfplotsretval}{axis background}%
+ \path[/pgfplots/axis background,/pgfplots/axis background@] \pgfextra{\pgfplots@clippath@install{}};%
+ \endpgfplotsonlayer
+ \fi
%
\ifpgfplots@axis@on@top
\else
@@ -7714,7 +7269,10 @@
\fi
% CLIPPING:
\ifpgfplots@clip
- \pgfplots@clippath@install{\pgfusepath{clip}}%
+ \if1\pgfplots@clipmode
+ % 'clip=true' and 'clip/mode=global':
+ \pgfplots@clippath@install{\pgfusepath{clip}}%
+ \fi
\fi
\pgfplotspointbb@assertvaluesexist%
}
@@ -7986,7 +7544,7 @@
% clip path routine; it will be used quite often.
%
\let\pgfplots@clippath@install@pathcmd=\pgfplots@clippath@install
- \iffalse% FIXME : this needs to be fixed
+ \iffalse
\pgf@resetpathsizes% FIXME: this here should not be necessary!
\pgfsysprotocol@getcurrentprotocol\pgfplots@loc@TMPa%
\begingroup
@@ -8004,7 +7562,7 @@
\endgroup
\let\pgfplots@clippath@install@clip@protocolled=\pgfplots@glob@TMPa
\pgfsysprotocol@setcurrentprotocol\pgfplots@loc@TMPa%
- \fi
+ \fi
%
% Replace \pgfplots@clippath@install by one which makes use of the
% optimized version (if ##1=\pgfusepath{clip})
@@ -8062,6 +7620,16 @@
\pgfplots@error{Can't install a clippath here - the command has not yet been prepared.}%
}%
+
+% Generates a path representing the outline of the axis.
+% Example:
+%
+% \pgfplotspathaxisoutline
+% \pgfusepath{clip}
+\def\pgfplotspathaxisoutline{%
+ \pgfplots@clippath@install{}%
+}%
+
% This is the counterpart for \pgfplots@BEGIN@init@and@draw@axis
\def\pgfplots@END@init@and@draw@axis{%
\endscope%
@@ -8071,19 +7639,25 @@
\fi
\pgfplots@draw@axis@post
%
+ % Draw any markers for which drawing has been postponed.
+ %
+ % The motivation here is that markers should be drawn on top of
+ % their plots, and AFTER the clip path.
+ %
+ % If the plotting logic added serialized marker streams to
+ % \pgfplots@stored@markerlist, these markers will be plotted here.
+ %
+ % Note that this list will be EMPTY if
+ % \ifpgfplots@clip@marker@paths is true.
+ %
% whats the better sequence for \ifpgfplots@axis@on@top and \ifpgfplots@clip@marker@paths !?
% This here looks better, I think... markers should not be obscured by descriptions.
- \ifpgfplots@clip@marker@paths
- \else
- \pgfplotslistforeach\pgfplots@stored@markerlist\as\pgfplots@loc@TMPa{%
- \scope% make sure that 'fill opacity' and 'dotted' styles remain local!
+ \pgfplotslistforeach\pgfplots@stored@markerlist\as\pgfplots@loc@TMPa{%
%\message{Executing marker stuff: \meaning\pgfplots@loc@TMPa]]]]]}%
%\tracingmacros=2\tracingcommands=2
- \pgfplots@loc@TMPa
- \endscope
- }%
- \global\pgfplotslistnewempty\pgfplots@stored@markerlist% clear.
- \fi
+ \pgfplots@loc@TMPa
+ }%
+ \global\pgfplotslistnewempty\pgfplots@stored@markerlist% clear.
%
\begingroup
\pgfkeysvalueof{/pgfplots/after end axis/.@cmd}\pgfeov%
@@ -8436,6 +8010,11 @@
%
\pgfkeysgetvalue{/pgfplots/log basis #1}\pgfplots@loc@TMPa%
\edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa}%
+ \def\pgfplots@loc@TMPb{e}%
+ \ifx\pgfplots@loc@TMPb\pgfplots@loc@TMPa
+ % log basis x=e : same as empty value.
+ \let\pgfplots@loc@TMPa=\pgfutil@empty
+ \fi
\ifx\pgfplots@loc@TMPa\pgfutil@empty
% log basis x={} (initial setting:)
\else
@@ -8816,6 +8395,13 @@
% confused if the catcodes change... this here is a
% work-around for babel support.
\let\pgfplots@checkandpreparefor@active@semicolon\relax
+ %
+ % make sure that 'every colorbar' is checked by the key-filtering
+ % stuff: we want to find 'ymode=log' inside of it.
+ % Note that we have to change it here because only the colorbar
+ % should expand 'every colorbar' that early in the processing:
+ \pgfkeys{/pgfplots/every colorbar/.belongs to family=/pgfplots/scale}%
+ %
\pgfkeysvalueof{/pgfplots/colorbar/draw/.@cmd}\pgfeov
}
\pgfkeysdef{/pgfplots/colorbar to name/at}{%
@@ -8896,6 +8482,22 @@
\pgfplots@set@keymacro@to@style\pgfplots@rmopts{#1}%
}
+% Invokes \pgfplots@set@keys@from@tikz@style and handles the "on
+% layer" key.
+%
+% More precisely, it stores any "on layer" value found in style "#1"
+% in
+% /pgfplots/layers for styles/#1.
+%
+% If there is no such value, it will store the empty string (main
+% layer)
+\def\pgfplots@set@keys@from@tikz@style@and@handle@layer#1{%
+ \pgfkeyslet{/pgfplots/on layer}\pgfutil@empty
+ \pgfplots@set@keys@from@tikz@style{#1}%
+ \pgfkeysgetvalue{/pgfplots/on layer}\pgfplots@loc@TMPa
+ \pgfkeyslet{/pgfplots/layers for styles/#1}\pgfplots@loc@TMPa
+}%
+
% The same as \pgfplots@set@keys@from@tikz@style but this one appends
% unmatched options to style #2.
%
@@ -9102,6 +8704,20 @@
\pgfkeysdeactivatefamily{/pgfplots/naming commands}%
\pgfkeysdeactivatefamily{/pgfplots/shared with tikz}%
%
+ \ifpgfplots@axis@on@top
+ \ifpgfplots@layered@graphics
+ \pgfplots@log3{the combination of 'axis on top' and 'activate layers' implies 'set layers=axis on top'. Deactivate 'axis on top' if you want other layers.}%
+ \pgfplotsset{set layers=axis on top}%
+ \fi
+ \fi
+ % retrieve layer configurations (the one set with 'set layers*').
+ \pgfkeysgetvalue{/pgfplots/@set layers arg}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \else
+ % ah, yes: then set its style:
+ \pgfqkeys{/pgfplots/layers}{\pgfplots@loc@TMPa}% note that this here should not need key filtering; it adjusts only styles (hopefully ;) )
+ \fi
+ %
% Now, any 'name' and 'alias' options have been processed.
%
% Remember their current meaning and reset the tikz options!
@@ -9118,16 +8734,16 @@
\pgfkeysgetvalue{/tikz/alias/.@cmd}\pgfplots@old@alias@impl
}{}%
\pgfkeysdef{/tikz/name}{%
- \xdef\pgfplots@named@child@node@list{\pgfplots@named@child@node@list,{##1}}%
+ \pgfplots@add@named@child@node{##1}%
\pgfplots@old@name@impl##1\pgfeov
}%
\pgfkeysdef{/tikz/alias}{%
- \xdef\pgfplots@named@child@node@list{\pgfplots@named@child@node@list,{##1}}%
+ \pgfplots@add@named@child@node{##1}%
\pgfplots@old@alias@impl##1\pgfeov
}%
%
% Now, continue to process the 'every' styles. Please note that
- % the 'legend style={}' like options have already been processed;
+ % options like 'legend style={}' have already been processed;
% their values are already inside of the associated 'every'
% styles.
%
@@ -9140,7 +8756,7 @@
% 'legend style={legend pos=outer north east}':
\pgfkeysdef{/pgfplots/every axis legend/.append style}{\pgfkeysalso{##1}}%
%
- \pgfplots@set@keys@from@tikz@style{every axis legend}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every axis legend}%
%
% restore:
\pgfkeysdef{/pgfplots/every axis legend/.append style}{%
@@ -9159,12 +8775,12 @@
%\pgfkeysdeactivatefamily{/pgfplots/descriptions}%
%
\pgfkeysactivatefamily{/pgfplots/tick}%
- \pgfplots@set@keys@from@tikz@style{every tick}%
- \pgfplots@set@keys@from@tikz@style{every minor tick}%
- \pgfplots@set@keys@from@tikz@style{every major tick}%
- \pgfplots@set@keys@from@tikz@style{every axis grid}%
- \pgfplots@set@keys@from@tikz@style{every minor grid}%
- \pgfplots@set@keys@from@tikz@style{every major grid}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every tick}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every minor tick}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every major tick}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every axis grid}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every minor grid}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every major grid}%
\pgfkeysdeactivatefamily{/pgfplots/tick}%
%
%--------------------------------------------------
@@ -9178,9 +8794,9 @@
% ensure that \axis[<options>] take higher precedence).
%\pgfkeysactivatefamily{/pgfplots/descriptions}%
\pgfkeysactivatefamily{/pgfplots/tick}%
- \pgfplots@set@keys@from@tikz@style{every x tick label}%
- \pgfplots@set@keys@from@tikz@style{every y tick label}%
- \pgfplots@set@keys@from@tikz@style{every tick label}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every x tick label}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every y tick label}%
+ \pgfplots@set@keys@from@tikz@style@and@handle@layer{every tick label}%
\pgfkeysdeactivatefamily{/pgfplots/tick}%
%\pgfkeysdeactivatefamily{/pgfplots/descriptions}%
%
@@ -9240,10 +8856,24 @@
\global\let\pgfplots@firstplot@coords@z=\pgfutil@empty
\pgfkeysalso{/pgfplots/.search also=/tikz}%
%
+ \pgfkeysifdefined{/tikz/on layer}{}{%
+ % make sure assignments 'on layer' in the /tikz/ prefix
+ % doesn't hurt.
+ % this may happen, for example with
+ % 'x grid style={on layer=...}'
+ % because 'x grid style' is not processed by the key filtering
+ % above (it is extracted later).
+ \pgfkeyslet{/tikz/on layer}\pgfutil@empty%
+ }%
+ %
\pgfplots@set@options@sanitize
\pgfplots@notify@options@are@set
}
+\def\pgfplots@add@named@child@node#1{%
+ \xdef\pgfplots@named@child@node@list{\pgfplots@named@child@node@list,{#1}}%
+}%
+
\def\pgfplots@notify@options@are@set{}%
\def\pgfplots@install@abbrev@commands{
@@ -9386,6 +9016,9 @@
{/pgf/key filters/defined}}%
\def\pgfplots@label@tikzopts{}%
\pgfkeysinstallkeyfilterhandler{/pgf/key filter handlers/append filtered to}{\pgfplots@label@tikzopts}%
+ % FIXME : this fails if 'error bars/.cd,/pgfplots/.cd' is used inside of #1 --
+ % the second /pgfplots/.cd will be applied, but the error bars
+ % command not
\pgfqkeysfiltered{/tikz}{#1}%
%
\pgfkeysgetvalue{/pgfplots/legend image code/.@cmd}{\pgfplots@curlegendcode}%
@@ -9797,6 +9430,9 @@
%
\pgfplots@set@options{#1}%
%
+ \pgfplots@prepare@layered@graphics
+ %
+ \pgfplots@prepare@cell@picture
%
%
%
@@ -9881,7 +9517,12 @@
\pgfplots@autocompute@all@limitsfalse
\fi
%
- \pgfplots@declare@mathfunctions
+ \pgfutil@ifundefined{pgfmathdeclarefunction}{%
+ % SKIP: \pgfmathdeclarefunction is unavailable in pgf 2.00 .
+ % UPGRADE TO PGF 2.10 to use these math functions.
+ }{%
+ \pgfplots@declare@mathfunctions
+ }%
%
% check for axis-wide 'point meta min' :
\pgfkeysgetvalue{/pgfplots/point meta min}\pgfplots@loc@TMPa
@@ -9938,6 +9579,18 @@
\let\scope=\pgfplots@replacement@for@scope
\let\endscope=\pgfplots@replacement@for@endscope
%
+ \let\pgfplots@orig@pgfonlayer=\pgfonlayer
+ \let\pgfplots@orig@endpgfonlayer=\endpgfonlayer
+ \let\pgfonlayer=\pgfplots@replacement@for@onlayer
+ \let\endpgfonlayer=\pgfplots@replacement@for@endonlayer
+ %
+ \let\pgfplots@orig@pgfplotsonlayer=\pgfplotsonlayer
+ \let\pgfplots@orig@endpgfplotsonlayer=\endpgfplotsonlayer
+ \let\pgfplotsonlayer=\pgfplots@replacement@for@onlayer
+ \let\endpgfplotsonlayer=\pgfplots@replacement@for@endonlayer
+ %
+ % allow layer changes within the environment; reset:
+ \pgfkeyslet{/pgfplots/on layer}\pgfutil@empty
}
% \end{axis} :
@@ -9959,6 +9612,10 @@
\let\plot=\pgfplots@orig@plot
\let\scope=\pgfplots@orig@scope
\let\endscope=\pgfplots@orig@endscope
+ \let\pgfonlayer=\pgfplots@orig@pgfonlayer
+ \let\endpgfonlayer=\pgfplots@orig@endpgfonlayer
+ \let\pgfplotsonlayer=\pgfplots@orig@pgfplotsonlayer
+ \let\endpgfplotsonlayer=\pgfplots@orig@endpgfplotsonlayer
%
\pgfplotssurveyphase@setactiveplothandlers
%
@@ -9966,131 +9623,99 @@
%
%\end{axis}:
%
- \begingroup
- \pgfplots@sys@beforenode
- % create a leight-weight 'current axis' node for anchor references
- % (which may happen during both, the axis descriptions or any
- % path/plot commands).
- \pgfmultipartnode{pgfplots@low@level@shape@INNER}{image}{current axis}{\pgfusepath{discard}}%
- \endgroup
- %
% --------------------
% All plotting commands have been read.
% -> apply postponed drawing commands!
% --------------------
- \pgfplots@BEGIN@init@and@draw@axis
- %
- % replace some of tikz's paths (like ellipse and path): make them
- % aware of any transformations:
- \pgfplots@install@path@replacements
- %
- \pgfplots@stacked@initialise
- \global\pgfplotslistnewempty\pgfplots@stored@markerlist
- \ifpgfplots@stacked@reverse
- % This here applies any scaling trafos and assembles a
- % NEW \pgfplots@stored@plotlist!
- \pgfplots@stacked@finalize@stored@plots
- \fi
- \pgfplotslistforeachungrouped\pgfplots@stored@plotlist\as\pgfplots@loc@TMPa{%
- \expandafter\pgfplots@stored@plotlist@EXTRACTENTRY\pgfplots@loc@TMPa
+ \pgfplots@determinedefaultvalues
+ \pgfplots@BEGIN@cell@picture[/pgfplots/every axis]%
+ \pgfplots@BEGIN@init@and@draw@axis
+ %
+ % replace some of tikz's paths (like ellipse and path): make them
+ % aware of any transformations:
+ \pgfplots@install@path@replacements
+ %
+ \pgfplots@stacked@initialise
+ \global\pgfplotslistnewempty\pgfplots@stored@markerlist
+ \ifpgfplots@stacked@reverse
+ % This here applies any scaling trafos and assembles a
+ % NEW \pgfplots@stored@plotlist!
+ \pgfplots@stacked@finalize@stored@plots
+ \fi
+ \pgfplotslistforeachungrouped\pgfplots@stored@plotlist\as\pgfplots@loc@TMPa{%
+ \expandafter\pgfplots@stored@plotlist@EXTRACTENTRY\pgfplots@loc@TMPa
%\message{^^JProcessing stored plot with precommand '\meaning\pgfplots@stored@current@precmd';^^J pgfplots@plotcmd '\meaning\pgfplots@stored@current@cmd'^^J postcommand '\meaning\pgfplots@stored@current@postcmd'^^J}%
%\message{DATA: '\meaning\pgfplots@stored@current@data';^^J}%
- % The precmd sets all required variables needed to
- % finalize a plot.
- \ifx\pgfplots@stored@current@cmd\pgfutil@empty
- \pgfplots@stored@current@data%
- \else
- \begingroup
+ % The precmd sets all required variables needed to
+ % finalize a plot.
% @see the stream preparation routines.
\pgfplots@stored@current@precmd
- \pgfkeysvalueof{/pgfplots/execute at begin plot visualization}%
- \ifpgfplots@threedim
- \else
- % axis = 2d and plot=3d is forbidden here.
- \pgfplots@curplot@threedimfalse
- \fi
- %
- % this code here means we REALLY have a plotting
- % command!
- \scope[current plot style] % this sets BOTH pgfplots and tikz options.
- % FIXME : what, precisely, was the motivation to use a
- % scope here? It causes a lot of problems and
- % work-arounds. Is it worth the effort!?
- %
- % de-activate the FPU here! I fear its number
- % format may cause errors when used in low-level
- % routines.
- \pgfkeys{/pgf/fpu=false}%
- %
- \ifpgfplots@stacked@reverse
- % has already been processed above, in \pgfplots@stacked@finalize@stored@plots.
- \pgfplots@stacked@draw@reversed@plot
+ \ifx\pgfplots@stored@current@cmd\pgfutil@empty
+ % Ah: some \pgfplotsextra command like \draw,\path,
+ % \node or even \scope or \endscope.
+ %
+ % do NOT call \pgfplotsonlayer here! We MUST NOT
+ % destroy grouping levels here.
+ \pgfplots@stored@current@data%
\else
- % modifies \pgfplots@stored@markerlist if necessary.
- \expandafter\pgfplots@coord@stream@finalize@storedcoords@START\pgfplots@stored@current@data\pgfplots@EOI
+ %
+ % this code here means we REALLY have a plotting
+ % command!
+ \begingroup
+ \pgfplotsonlayer{\pgfkeysvalueof{/pgfplots/on layer}}{a plot or graphical element (or inherited from the axis)}%
+ \pgfkeysvalueof{/pgfplots/execute at begin plot visualization}%
+ \ifpgfplots@threedim
+ \else
+ % axis = 2d and plot=3d is forbidden here.
+ \pgfplots@curplot@threedimfalse
+ \fi
+ \pgfplots@execute@at@begin@plot@visualization@internal
+ \scope[current plot style] % this does set BOTH pgfplots and tikz options.
+ % FIXME : what, precisely, was the motivation to use a
+ % scope here? It causes a lot of problems and
+ % work-arounds. Is it worth the effort!?
+ \ifpgfplots@clip
+ \if2\pgfplots@clipmode
+ % clip=true and 'clip mode=individual'
+ \pgfplots@clippath@install{\pgfusepath{clip}}%
+ \fi
+ \fi
+ %
+ \pgfplots@prepare@layered@graphics@marks
+ %
+ % de-activate the FPU here! I fear its number
+ % format may cause errors when used in low-level
+ % routines.
+ \pgfkeys{/pgf/fpu=false}%
+ %
+ \ifpgfplots@stacked@reverse
+ % has already been processed above, in \pgfplots@stacked@finalize@stored@plots.
+ \pgfplots@stacked@draw@reversed@plot
+ \else
+ % modifies \pgfplots@stored@markerlist if necessary.
+ \expandafter\pgfplots@coord@stream@finalize@storedcoords@START\pgfplots@stored@current@data\pgfplots@EOI
+ \fi
+ \endscope
+ \pgfplots@execute@at@end@plot@visualization@internal
+ \pgfkeysvalueof{/pgfplots/execute at end plot visualization}%
+ \endpgfplotsonlayer
+ \endgroup
\fi
- \endscope
- \pgfkeysvalueof{/pgfplots/execute at end plot visualization}%
\pgfplots@stored@current@postcmd
- \endgroup
- \fi
- }%
- \global\pgfplotslistnewempty\pgfplots@stored@plotlist% delete contents.
- %
- \pgfplots@END@init@and@draw@axis
- %
- \pgfplots@create@axis@descriptions
- %
- \endtikzpicture%
- \begingroup
- % Protocol sizes for the axis-shape.
- % That needs to be done globally, do avoid all those
- % \endgroup's in and after \endpgfinterruptpicture ...
- \ifdim\pgf@picmaxx=-16000pt\relax%
- \pgf@picmaxx=0pt\relax%
- \pgf@picminx=0pt\relax%
- \pgf@picmaxy=0pt\relax%
- \pgf@picminy=0pt\relax%
- \fi%
- %
- \xdef\pgfplots@saveddimen@picminx{\the\pgf@picminx}%
- \xdef\pgfplots@saveddimen@picminy{\the\pgf@picminy}%
- %
- \ifpgfplots@deprecated@anchors
- \pgfplotspointminminmin
- \else
- \pgfplotspointbblowerleft
- \fi
- \pgf@xa=\pgf@x
- \advance\pgf@xa by-\pgf@picminx
- \xdef\pgfplots@savedanchor@inner@lowerleft@x{\the\pgf@xa}%
+ }%
+ \global\pgfplotslistnewempty\pgfplots@stored@plotlist% delete contents.
%
- \pgf@xa=\pgf@y
- \advance\pgf@xa by-\pgf@picminy
- \xdef\pgfplots@savedanchor@inner@lowerleft@y{\the\pgf@xa}%
+ \pgfplots@END@init@and@draw@axis
%
- \pgfplotspointaxisorigin
- \global\advance\pgf@x by-\pgf@picminx
- \global\advance\pgf@y by-\pgf@picminy
- \xdef\pgfplotspointaxisorigin{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
- \endgroup
- \endpgfinterruptpicture
- \egroup\egroup% end of pgfnodepartimagebox
+ \pgfplots@create@axis@descriptions
+ %
+ % this here does \endtikzpicture\endpgfinterruptpicture
+ % (and stores sizes):
+ \pgfplots@END@cell@picture
%
\let\tikz@fig@name=\pgfplots@fig@name
\tikz@fig@mustbenamed
%
- % restore any shift transformations provided to an axis.
- % These would be lost otherwise.
- \pgftransformshift{\pgfplots@savedtransformshift}%
- %
- % allow positioning of colorbars with this hook.
- % It is \relax unless this here is a color bar axis.
- % Its intention is to re-define `\pgfplots@at':
- \pgfplots@colorbar@position@hook%
- %
- \pgftransformshift{\pgfplots@at}%
- %
\edef\pgfplots@shapename{pgfplots@low@level@shape\ifpgfplots@deprecated@anchors @deprecated\fi}%
\pgfutil@ifundefined{pgf@anchor@\pgfplots@shapename @\pgfplots@anchorname}{%
% Oh. Well, suppose \pgfplots@anchorname is associated to an
@@ -10102,7 +9727,7 @@
% \pgfplots@finally@correct@child@node@positions).
% Do that here with \pgfplots@saveddimen@picminx:
\pgfpointdiff
- {\pgfqpoint{\pgfplots@saveddimen@picminx}{\pgfplots@saveddimen@picminy}}
+ {\pgfplotspointorigininternal}
{##1}%
\global\pgf@x=-\pgf@x \global\pgf@y=-\pgf@y
}%
@@ -10112,7 +9737,7 @@
}{}%
%
\begingroup
- \pgfplots@sys@beforenode
+ \pgfplots@beforenode
%
\ifpgfplots@deprecated@anchors
\pgfplots@restore@deprecated@lowlevel@shape
@@ -10132,10 +9757,40 @@
\else
\global\let\pgfplots@glob@TMPa=\relax
\fi
+ %
+ % transport the current layer config - but only if nessary!
+ \def\pgfplots@loc@TMPa{0}%
+ \ifpgfplots@has@cell@picture
+ % layers are used for the cell picture only- no need to
+ % communicate them.
+ \else
+ \ifpgfplots@layered@graphics
+ \def\pgfplots@loc@TMPa{1}%
+ \else
+ % there are no layers.
+ \fi
+ \fi
+ \if1\pgfplots@loc@TMPa
+ % Ah - we need to transport the current layer config!
+ \pgf@remember@layerlist@globally
+ \aftergroup\pgf@restore@layerlist@from@global
+ \else
+ % Hm. No layers to transport. Make sure that the second
+ % \aftergroup does not hurt:
+ \aftergroup\pgf@remember@layerlist@globally
+ \fi
\endgroup
\pgfplots@glob@TMPa
+ %
+ % once more again - just to be sure that it works with LaTeX which
+ % introduces a further grouping level:
+ \aftergroup\pgf@restore@layerlist@from@global
}
+\def\pgfplots@beforenode{%
+ \pgfplots@sys@beforenode
+}%
+
% Now, we need to process all named nodes inside of our
% axis-image.
%
@@ -10170,7 +9825,7 @@
\pgfpointanchor{\tikz@fig@name}{image}%
\pgf@xa=\pgf@x
\pgf@xb=\pgf@y
- \pgf@process{\pgfqpoint{\pgfplots@saveddimen@picminx}{\pgfplots@saveddimen@picminy}}%
+ \pgf@process{\pgfplotspointorigininternal}%
\advance\pgf@xa by-\pgf@x
\advance\pgf@xb by-\pgf@y
\global\pgf@x=\pgf@xa
@@ -10248,6 +9903,8 @@
\tikzaddtikzonlycommandshortcutlet\loglogaxis\pgfplots@environment@loglogaxis
\tikzaddtikzonlycommandshortcutlet\endloglogaxis\endpgfplots@environment@loglogaxis
+%\input pgfplots.multiaxis.code.tex
+
\pgfplotsdefineaxistype{rectangle}{%
% do nothing, this is the default anyway.
}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex
index 7ecfb8a5957..aee93120a5e 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex
@@ -1,3 +1,3 @@
\def\pgfplotsrevision{%
-1.5.1-4-g53e640f
+1.6.1
}
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex
new file mode 100644
index 00000000000..79a4e5a11de
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex
@@ -0,0 +1,3332 @@
+%--------------------------------------------
+%
+% Package pgfplots
+%
+% Provides a user-friendly interface to create function plots (normal
+% plots, semi-logplots and double-logplots).
+%
+% It is based on Till Tantau's PGF package.
+%
+% Copyright 2007-2012 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+% PRECONDITION:
+% - final axis limits are given in transformed range
+% - \pgfplots@set@default@size@options has been invoked before
+% POSTCONDITION:
+% - the current x,y and z unit vectors are defined properly;
+% - the fast-access registers are initialised for the axis limits,
+% - the following macros are assigned:
+% \pgfplots@[xyz]@veclength
+% \pgfplots@[xyz]@inverseveclength
+% \pgfplotspointxaxis
+% \pgfplotspointyaxis
+% \pgfplotspointzaxis
+% \pgfplotspointcenter
+% \pgfplotspointminminmin
+%
+\def\pgfplots@initsizes{%
+ % INIT.
+ %
+ %
+ \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
+ \else
+ \let\pgfplots@view@el=\pgfutil@empty
+ \let\pgfplots@view@az=\pgfutil@empty
+ \fi
+ \ifx\pgfplots@view@az\pgfutil@empty
+ % Note that in presence of "x,y,z" options, the
+ % \pgfplots@set@default@size@options RESETS /pgfplots/view/az.
+ %
+ %\let\pgfplots@rectangle@width=\pgfutil@empty
+ %\let\pgfplots@rectangle@height=\pgfutil@empty
+ \pgfplotsmathvectorfromstring{0,0,1}{default}%
+ \let\pgfplots@view@dir@threedim=\pgfplotsretval
+ %
+ \ifx\pgfplots@x\pgfutil@empty
+ \ifx\pgfplots@width\pgfutil@empty
+ \pgfplots@error{INTERNAL LOGIC ERROR! WIDTH NOT SET}%
+ \fi
+ \fi
+ %
+ \ifx\pgfplots@y\pgfutil@empty
+ \ifx\pgfplots@height\pgfutil@empty
+ \pgfplots@error{INTERNAL LOGIC ERROR! HEIGHT NOT SET}%
+ \fi
+ \fi
+ \ifpgfplots@threedim
+ \def\pgfplots@tmp@Zscale{1}%
+ \else
+ \def\pgfplots@tmp@Zscale{0}%
+ \fi
+ %
+ \pgfplots@initsizes@setunitvector{x}{0}{1}{\pgfplots@tmp@xisaxisparallel}%
+ \pgfplots@initsizes@setunitvector{y}{1}{1}{\pgfplots@tmp@yisaxisparallel}%
+ \pgfplots@initsizes@setunitvector{z}{2}{\pgfplots@tmp@Zscale}{\pgfplots@loc@TMPc}%
+ \pgfplots@scale@plotbox@to@widthheight
+ \ifpgfplots@threedim
+ \pgfplotsgetnormalforcurrentview
+ \fi
+ \else
+ % 3D case 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}%
+ \pgfplots@scale@plotbox@to@widthheight
+ \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), n = (\pgfplots@view@dir@threedim).^^J }%
+ %
+ \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}{}%
+ \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
+ \fi
+}
+
+% Defines \pgfmathresult to be the desired width without axis labels.
+%
+\def\pgfplots@initsizes@get@width@withoutlabels{%
+ \pgfplots@initsizes@handle@label@const{\pgfplots@width}{45pt}{width}%
+}
+
+% Defines \pgfmathresult to be the desired height without axis labels.
+\def\pgfplots@initsizes@get@height@withoutlabels{%
+ \pgfplots@initsizes@handle@label@const{\pgfplots@height}{45pt}{height}%
+}
+
+\def\pgfplots@initsizes@handle@label@const#1#2#3{%
+ \begingroup
+ \pgf@xa=#1\relax
+ % EXPECTED WIDTH = X = \pgfplots@width
+ % ACTUAL WIDTH = c + x * (xmax-xmin)
+ % where c is a CONSTANT (for the axis labels/tick labels).
+ % -> \pgfplots@tmpXscale = (X - c) / (x *(xmax-xmin))
+ %
+ % \pgf@xa := X-c:
+ \ifpgfplots@scale@only@axis
+ \else
+ \advance\pgf@xa by-#2 % FIXME determine 'c' correctly!
+ \fi
+ \ifdim\pgf@xa<0pt
+ \pgfplots@error{Error: Plot #3 `#1' is too small. This cannot be implemented while maintaining constant size for labels. Sorry, label sizes are only approximate. You will need to adjust your #3.}%
+ \pgf@xa=0pt
+ \fi
+ \edef\pgfmathresult{\the\pgf@xa}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% #1: axis
+\def\pgfplots@axis@apply@post@scale#1{%
+ %
+ \pgfkeysgetvalue{/pgfplots/#1 post scale}\pgfplots@loc@TMPd
+ \ifx\pgfplots@loc@TMPd\pgfutil@empty
+ \else
+ \pgfmathparse{\csname pgfplots@target@unit@scale@#1x\endcsname*\pgfplots@loc@TMPd}%
+ \expandafter\let\csname pgfplots@target@unit@scale@#1x\endcsname=\pgfmathresult
+ %
+ \pgfmathparse{\csname pgfplots@target@unit@scale@#1y\endcsname*\pgfplots@loc@TMPd}%
+ \expandafter\let\csname pgfplots@target@unit@scale@#1y\endcsname=\pgfmathresult
+ \fi
+}
+
+% Takes azimuth (horizontal angle) '#1' and elongation (vertical
+% angle) '#2' (both in degrees) and computes
+% x,y and z vectors which define the view in the direction
+% defined by '#1' and '#2'.
+%
+% 'azimuth' means a rotation around the viewport's x axis. 'elongation' means
+% a rotation around the original coordinate system's z axis.
+%
+% The method works by computing
+% Az = [ cos(azimuth) -sin(azimuth) 0; ...
+% sin(azimuth) cos(azimuth) 0; ...
+% 0 0 1 ];
+%
+%
+% Ax = [ 1 0 0; ...
+% 0 cos(elevation) -sin(elevation) ;...
+% 0 sin(elevation) cos(elevation) ];
+%
+% v= Ax * Az;
+% = [ ...
+% cosaz -sinaz cosel sinaz sinel; ...
+% sinaz cosaz cosel -sinel cosaz; ...
+% 0 sinel cosel ];
+%
+% Then, we use the rotated XZ plane as viewport, that means
+% xvec = v * [1 0 0]' = <first column of v>
+% zvec = v * [0 0 1]' = <third column of v>
+% and we define the projection onto the twodimensional surface
+% spanned by 'xvec' and 'zvec' as
+% P( q ) = [ q^T xvec, q^T zvec ]'
+% for q in R^3.
+% As a consequence, we compute the three unit vectors as
+% x = P( [1 0 0] )
+% = [ cosaz, sinaz sinel ]'
+% y = P( [0 1 0] )
+% = [ sinaz, -sinel cosaz ]'
+% z = P( [0 0 1] )
+% = [ 0, cosel]'
+%
+% Furthermore, the 3D view vector which points into the direction of the view
+% is
+% n = v * [0 1 0 ]' = <second column of v> = [-sinaz cosel, cosaz cosel, sinel]'
+% because the normal view point was the XZ plane with y as its normal
+% vector.
+% The 3D vector n is returned by this routine as well - it is
+% necessary for some kind of z buffering (determining what is
+% foreground and what is background).
+%
+% INPUT:
+% - #1 : azimuth ("yaw")
+% - #2 : elevation ("pitch")
+% OUTPUT:
+% - #3 : a macro which will be set to '1' if and only if
+% the viewport is the standard XY axis (i.e. azimuth=0, elevation=90).
+% - [xyz] vectors,
+% \pgfplots@view@dir@threedim will contain the three components
+% of 'n' (without the suffix 'pt', but in units of 'pt') (see
+% \pgfplotsmathvectorfromstring).
+\def\pgfplotssetaxesfromazel#1#2#3{%
+ \begingroup
+ \pgfmathparse{#1}%
+ \let\pgfplots@az=\pgfmathresult
+ \pgfmathparse{#2}%
+ \edef\pgfplots@el{-\pgfmathresult}%
+ \pgfmathsin@{\pgfplots@az}%
+ \let\sinaz=\pgfmathresult
+ \pgfmathcos@{\pgfplots@az}%
+ \let\cosaz=\pgfmathresult
+ \pgfmathsin@{\pgfplots@el}%
+ \let\sinel=\pgfmathresult
+ \pgfmathcos@{\pgfplots@el}%
+ \let\cosel=\pgfmathresult
+ % x:
+ \pgfmathmultiply@{\sinaz}{\sinel}%
+ \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpoint{\cosaz pt}{\pgfmathresult pt}}%
+ % y:
+ \pgfmathmultiply@{-\sinel}{\cosaz}%
+ \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpoint{\sinaz pt}{\pgfmathresult pt}}%
+ % z:
+ \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpoint{0pt}{\cosel pt}}%
+ %
+ \pgfkeysgetvalue{/pgfplots/x dir/value}\pgfplots@loc@dirvalue@x
+ \pgfkeysgetvalue{/pgfplots/y dir/value}\pgfplots@loc@dirvalue@y
+ \pgfkeysgetvalue{/pgfplots/z dir/value}\pgfplots@loc@dirvalue@z
+ \if r\pgfplots@loc@dirvalue@x
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}%
+ \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
+ \fi
+ \if r\pgfplots@loc@dirvalue@y
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPb}%
+ \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
+ \fi
+ \if r\pgfplots@loc@dirvalue@z
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPc}%
+ \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
+ \fi
+ %
+ % Process 'plot box ratio':
+ \def\pgfplots@extract@plot@box@ratio##1##2##3##4\pgfplots@EOI{%
+ \pgfmathparse{##1}\let\pgfplots@plotboxratio@x=\pgfmathresult
+ \pgfmathparse{##2}\let\pgfplots@plotboxratio@y=\pgfmathresult
+ \pgfmathparse{##3}\let\pgfplots@plotboxratio@z=\pgfmathresult
+ }%
+ \def\pgfplots@extract@plot@box@ratio@spaces##1 ##2 ##3 ##4\pgfplots@EOI{%
+ \pgfplots@extract@plot@box@ratio{##1}{##2}{##3}{##4}\pgfplots@EOI
+ }%
+ \pgfkeysgetvalue{/pgfplots/plot box ratio}\pgfplots@loc@TMPa
+ % Auto-determine input format which is either '{x}{y}{z}' or 'x y z'
+ \def\pgfplots@loc@TMPb{%
+ \pgfutil@ifnextchar\bgroup{%
+ \pgfplots@loc@tmptrue
+ \pgfplots@gobble@until@EOI
+ }{%
+ \pgfplots@loc@tmpfalse
+ \pgfplots@gobble@until@EOI
+ }%
+ }%
+ \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\pgfplots@EOI
+ \ifpgfplots@loc@tmp
+ % Ah- braces format.
+ \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa{1}{1}{1}}%
+ \expandafter\pgfplots@extract@plot@box@ratio\pgfplots@loc@TMPa\pgfplots@EOI
+ \else
+ % Ah- space-separated
+ \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa\space 1 1 1}%
+ \expandafter\pgfplots@extract@plot@box@ratio@spaces\pgfplots@loc@TMPa\pgfplots@EOI
+ \fi
+ %
+ % process it:
+ \ifdim\pgfplots@plotboxratio@x pt=1pt
+ \else
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}%
+ \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@x}{\the\t@pgfplots@toka}}%
+ \fi
+ \ifdim\pgfplots@plotboxratio@y pt=1pt
+ \else
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPb}%
+ \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@y}{\the\t@pgfplots@toka}}%
+ \fi
+ \ifdim\pgfplots@plotboxratio@z pt=1pt
+ \else
+ \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPc}%
+ \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@z}{\the\t@pgfplots@toka}}%
+ \fi
+ %
+ % n (3D!)
+ \pgfmathmultiply@{-\sinaz}{\cosel}%
+ \let\pgfmathresultNx=\pgfmathresult
+ \pgfmathmultiply@{\cosaz}{\cosel}%
+ \xdef\pgfplots@glob@TMPd{{\pgfmathresultNx}{\pgfmathresult}{\sinel}}%
+ \endgroup
+%\message{Setting x,y and z from {#1}{#2} to^^J x = \meaning\pgfplots@glob@TMPa,^^J y = \meaning\pgfplots@glob@TMPb,^^J z = \meaning\pgfplots@glob@TMPc,^^J n = \pgfplots@glob@TMPd.^^J}%
+ \pgfsetxvec{\pgfplots@glob@TMPa}%
+ \pgfsetyvec{\pgfplots@glob@TMPb}%
+ \pgfsetzvec{\pgfplots@glob@TMPc}%
+ \def\pgfplots@loc@TMPa##1##2##3{%
+ \pgfplotsmathvectorfromstring{##1,##2,##3}{default}%
+ \let\pgfplots@view@dir@threedim=\pgfplotsretval
+ }%
+ \expandafter\pgfplots@loc@TMPa\pgfplots@glob@TMPd\relax
+ \def#3{0}%
+}%
+
+% Takes the current plot box, defined by the actual PGF x,y and z unit
+% vectors, and re-scales it such that it fits into the
+% width and height of the axis (as they have been provided by the
+% user).
+%
+% @see \pgfplots@scale@axisbox@to@widthheight
+% @see\pgfplots@scaleaxes@to@BB
+\def\pgfplots@scale@plotbox@to@widthheight{%
+ \pgfplots@initsizes@get@width@withoutlabels
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplots@initsizes@get@height@withoutlabels
+ %
+ \edef\pgfplots@loc@TMPa{{\pgfplots@loc@TMPa}{\pgfmathresult}}%
+ \expandafter\pgfplots@scaleaxes@to@BB\pgfplots@loc@TMPa
+}
+
+
+% Takes the current PGF x,y and z unit vectors and scales them such
+% that the bounding box of the final image has width #1 and height #2.
+%
+% The relative length of the input vectors is important for the 3D case: it
+% will be scaled as-is.
+%
+% PRECONDITION
+% - the x, y and z unit vectors have been set to the proper
+% DIRECTIONS. Their relative vector lengths are set-up properly
+% (i.e. y is twice as large as x and half as large as z or so).
+% - the \ifpgfplots@threedim boolean is set.
+% - the data limits have been initialised and transformed according
+% to the data transformation.
+% - the data transformation has ONLY been applied to the axis limits
+% (not other axis inputs). It may be changed by this method.
+%
+% POSTCONDITION
+% - the unit vectors have been re-scaled such that the final plot
+% has the desired dimensions.
+% - the @veclength and @inverseveclength have been initialized
+\def\pgfplots@scaleaxes@to@BB#1#2{%
+ \if0\pgfplots@scale@mode@choice
+ % scale mode=auto
+ \def\pgfplots@scale@mode@choice{2}% stretch to fill
+ \fi
+ \pgfplots@scaleaxes@to@BB@{#1}{#2}%
+ \pgfplots@computeunitvectorlengths
+ \pgfplots@rescale@view@dir
+}%
+
+\def\pgfplots@rescale@view@dir{%
+ \expandafter\ifx\csname pgfplots@view@dir@threedim\endcsname\relax
+ \else
+ % At this point, we ALREADY HAVE a normal vector. However, it
+ % might be skewed due to the scaling.
+ %
+ % -> recompute normal vector. In earlier versions, I tried to
+ % rescale it - but that was too complicated (for me). This
+ % here produces correct results, and it is a correct approach
+ % anyway.
+ \pgfplotsgetnormalforcurrentview
+ \fi
+}%
+
+% \pgfplots@BB@for@plotbox@get@unit@scales@for@limits{#1}{#2}{#3}:
+% a helper tool which computes individual unit vector scales in order
+% to respect the limits.
+%
+% This method ignores width/height; its purpose is only to make sure
+% that [xmin,xmax] fits into the CURRENT plot box.
+%
+% In this context, each unit vector is supposed to be scaled such that
+% width/height fit if xmin=0 and xmax=1.
+%
+% #1 [output] a macro name which will contain the INVERSE scale for x
+% #2 [output] a macro name which will contain the INVERSE scale for y
+% #3 [output] a macro name which will contain the INVERSE scale for z
+%
+\def\pgfplots@BB@for@plotbox@get@unit@scales@for@limits#1#2#3{%
+ \if1\b@pgfplots@plotbox@xisunit
+ % Consequently, we have to multiply with 1/(max-min):
+ % compute 1/(xmax - xmin) in float for more recent versions (see /pgfplots/compat/scaling).
+ % I observed that it is much more accurate
+ \pgfmathsubtract@{\pgfplots@xmax}{\pgfplots@xmin}%
+ \else
+ \def\pgfmathresult{1}%
+ \fi
+ \let#1=\pgfmathresult
+ %
+ \if1\b@pgfplots@plotbox@yisunit
+ \pgfmathsubtract@{\pgfplots@ymax}{\pgfplots@ymin}%
+ \else
+ \def\pgfmathresult{1}%
+ \fi
+ \let#2=\pgfmathresult
+ %
+ \ifpgfplots@threedim
+ \if1\b@pgfplots@plotbox@zisunit
+ \pgfmathsubtract@{\pgfplots@zmax}{\pgfplots@zmin}%
+ \else
+ \def\pgfmathresult{1}%
+ \fi
+ \else
+ \def\pgfmathresult{1}%
+ \fi
+ \let#3=\pgfmathresult
+}%
+\def\pgfplots@BB@for@plotbox{%
+ \ifpgfplots@threedim
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmin\pgfplots@plotbox@ymin\pgfplots@plotbox@zmin}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmin\pgfplots@plotbox@ymin\pgfplots@plotbox@zmax}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmin\pgfplots@plotbox@ymax\pgfplots@plotbox@zmin}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmin\pgfplots@plotbox@ymax\pgfplots@plotbox@zmax}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmax\pgfplots@plotbox@ymin\pgfplots@plotbox@zmin}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmax\pgfplots@plotbox@ymin\pgfplots@plotbox@zmax}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmax\pgfplots@plotbox@ymax\pgfplots@plotbox@zmin}%
+ \pgfpathmoveto{\pgfqpointxyz\pgfplots@plotbox@xmax\pgfplots@plotbox@ymax\pgfplots@plotbox@zmax}%
+ \else
+ \pgfpathmoveto{\pgfqpointxy\pgfplots@plotbox@xmin\pgfplots@plotbox@ymin}%
+ \pgfpathmoveto{\pgfqpointxy\pgfplots@plotbox@xmin\pgfplots@plotbox@ymax}%
+ \pgfpathmoveto{\pgfqpointxy\pgfplots@plotbox@xmax\pgfplots@plotbox@ymin}%
+ \pgfpathmoveto{\pgfqpointxy\pgfplots@plotbox@xmax\pgfplots@plotbox@ymax}%
+ \fi
+}%
+
+
+
+% Returns width and height of the current plot box
+% (the path produced by \pgfplots@BB@for@plotbox).
+%
+% PRECONDITION: \pgfplots@BB@for@plotbox is defined to produce a path
+% for the plot box
+%
+% POSTCONDITION: \pgfplotsretval contains the with and
+% \pgfplotsretvalb contains the height
+\def\pgfplots@get@dimension@of@BB{%
+ \begingroup
+ \pgfinterruptboundingbox
+ %
+ % the result of this call will be used to scale to target
+ % dimensions. If we omit \pgftransformreset here, we might
+ % accidentally UNDO the PGF transformation matrix (compare by
+ % writing \tikzpicture[scale=0.5] before the axis).
+ \pgftransformreset
+ %
+ % STEP 1: compute the bounding box for the plot box.
+ \pgfplots@BB@for@plotbox
+ %
+ % TMPa = width
+ \pgf@xa=\pgf@pathmaxx
+ \advance\pgf@xa by-\pgf@pathminx
+ % TMPb = height
+ \pgf@xb=\pgf@pathmaxy
+ \advance\pgf@xb by-\pgf@pathminy
+ \xdef\pgfplots@glob@TMPa{%
+ \def\noexpand\pgfplotsretval{\the\pgf@xa}%
+ \def\noexpand\pgfplotsretvalb{\the\pgf@xb}%
+ }%
+ \pgfusepath{discard}%
+ \endpgfinterruptboundingbox
+ \endgroup
+ \pgfplots@glob@TMPa
+}%
+
+\def\pgfplots@scaleaxes@to@BB@prepare@plotbox@limits{%
+ \def\b@pgfplots@rescale@x{1}%
+ \def\b@pgfplots@rescale@y{1}%
+ \def\b@pgfplots@rescale@z{1}%
+ %
+ \pgfplots@scaleaxes@to@BB@prepare@plotbox@limits@ x%
+ \pgfplots@scaleaxes@to@BB@prepare@plotbox@limits@ y%
+ \pgfplots@scaleaxes@to@BB@prepare@plotbox@limits@ z%
+}%
+
+\def\pgfplots@scaleaxes@to@BB@prepare@plotbox@limits@#1{%
+ \expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil@empty
+ \expandafter\def\csname pgfplots@plotbox@#1min\endcsname{0}%
+ \expandafter\def\csname pgfplots@plotbox@#1max\endcsname{1}%
+ \expandafter\def\csname b@pgfplots@plotbox@#1isunit\endcsname{1}%
+ \else
+ \pgfutil@namelet{pgfplots@plotbox@#1min}{pgfplots@#1min}%
+ \pgfutil@namelet{pgfplots@plotbox@#1max}{pgfplots@#1max}%
+ \expandafter\def\csname b@pgfplots@plotbox@#1isunit\endcsname{0}%
+ \if2\pgfplots@scale@mode@choice
+ % scale mode=stretch to fill
+ \expandafter\def\csname b@pgfplots@rescale@#1\endcsname{0}%
+ \fi
+ \fi
+ \expandafter\def\csname b@pgfplots@unitvec@is@zero@#1\endcsname{0}%
+ \ifdim\csname pgf@#1x\endcsname=0pt %
+ \ifdim\csname pgf@#1y\endcsname=0pt %
+ \expandafter\def\csname b@pgfplots@unitvec@is@zero@#1\endcsname{1}%
+ \fi
+ \fi
+}
+
+\def\pgfplots@scaleaxes@to@BB@#1#2{%
+ \begingroup
+ %
+ \pgfplots@scaleaxes@to@BB@prepare@plotbox@limits
+ \def\pgfplots@target@limitrescale@x{1}%
+ \def\pgfplots@target@limitrescale@y{1}%
+ \def\pgfplots@target@limitrescale@z{1}%
+ \if1\pgfplots@scale@mode@choice
+ % scale mode=none
+ \def\xscale{1}%
+ \def\yscale{1}%
+ \def\pgfplots@target@unit@scale@inv@x{1}%
+ \def\pgfplots@target@unit@scale@inv@y{1}%
+ \def\pgfplots@target@unit@scale@inv@z{1}%
+ \else
+ %
+ % This here CAN cause anisotropic (different) scaling factors.
+ \pgfplots@BB@for@plotbox@get@unit@scales@for@limits
+ {\pgfplots@target@unit@scale@inv@x}
+ {\pgfplots@target@unit@scale@inv@y}
+ {\pgfplots@target@unit@scale@inv@z}%
+ %
+%\message{got scales to fit limits into BB: x=1/\pgfplots@target@unit@scale@inv@x, y=1/\pgfplots@target@unit@scale@inv@y, z=1/\pgfplots@target@unit@scale@inv@z^^J}%
+ %
+ \if3\pgfplots@scale@mode@choice
+ % scale mode=scale uniformly
+ %
+ % We need to recompensate in case the previous method chose
+ % different unit scaling scalings:
+ \pgfplots@BB@for@plotbox@get@unit@scales@compensated@axis@limits
+ {\pgfplots@target@unit@scale@inv@x}
+ {\pgfplots@target@unit@scale@inv@y}
+ {\pgfplots@target@unit@scale@inv@z}
+ {\pgfplots@target@limitrescale@x}{\pgfplots@target@limitrescale@y}{\pgfplots@target@limitrescale@z}%
+ %
+ %\pgfplots@BB@update@cumulative@limit@compensations
+ \fi
+%\message{adjusted scales for 'scale mode': x=1/\pgfplots@target@unit@scale@inv@x, y=1/\pgfplots@target@unit@scale@inv@y, z=1/\pgfplots@target@unit@scale@inv@z; ^^J axis limit componsation scales x=\pgfplots@target@limitrescale@x, y=\pgfplots@target@limitrescale@y, z=\pgfplots@target@limitrescale@z^^J}%
+ %
+ % ATTENTION: this MODIFIES \pgfplots@target@limitrescale@x and its
+ % variants directly - and it needs the input values.
+ \pgfplots@get@scale@horiz@and@vert
+ {#1}%
+ {#2}%
+ {\xscale}%
+ {\yscale}% yscale
+ {\pgfplots@target@limitrescale@x}%
+ {\pgfplots@target@limitrescale@y}%
+ {\pgfplots@target@limitrescale@z}%
+%\message{Got W/H scale for all x components: \xscale; for all y components: \xscale; ^^J axis limit componsation scales x=1/\pgfplots@target@limitrescale@x, y=1/\pgfplots@target@limitrescale@y, z=1/\pgfplots@target@limitrescale@z^^J}%
+ % Ok, we know the W,H scalings now.
+ %
+ %
+ %
+ \pgfplots@apply@unit@ratio
+ {\pgfplots@target@unit@scale@inv@x}
+ {\pgfplots@target@unit@scale@inv@y}
+ {\pgfplots@target@unit@scale@inv@z}
+ {\pgfplots@target@limitrescale@x@}{\pgfplots@target@limitrescale@y@}{\pgfplots@target@limitrescale@z@}%
+ \pgfplots@BB@update@cumulative@limit@compensations
+ %
+%\message{adjusted scales for 'unit vector ratio': x=1/\pgfplots@target@unit@scale@inv@x, y=1/\pgfplots@target@unit@scale@inv@y, z=1/\pgfplots@target@unit@scale@inv@z; ^^J axis limit componsation scales x=\pgfplots@target@limitrescale@x, y=\pgfplots@target@limitrescale@y, z=\pgfplots@target@limitrescale@z^^J}%
+ \fi
+ %
+ %
+ \pgfplots@scaling@minimize@limitrescale%
+ %
+ %
+ \pgfplots@scaling@adjust@datascaling%
+%\message{adjusted scales for data scale trafo: x=1/\pgfplots@target@unit@scale@inv@x, y=1/\pgfplots@target@unit@scale@inv@y, z=1/\pgfplots@target@unit@scale@inv@z; ^^J axis limit componsation scales x=\pgfplots@target@limitrescale@x, y=\pgfplots@target@limitrescale@y, z=\pgfplots@target@limitrescale@z;^^J data scale trafo exponents x=\pgfplots@target@datascaletrafo@x@exponent@old -> \pgfplots@target@datascaletrafo@x@exponent, y=\pgfplots@target@datascaletrafo@y@exponent@old -> \pgfplots@target@datascaletrafo@y@exponent, z=\pgfplots@target@datascaletrafo@z@exponent@old -> \pgfplots@target@datascaletrafo@z@exponent^^J}%
+ %
+ \pgfplots@scaling@compute@final@scales%
+ {\xscale}{\yscale}%
+ {\pgfplots@target@unit@scale@inv@x}%
+ {\pgfplots@target@unit@scale@inv@y}%
+ {\pgfplots@target@unit@scale@inv@z}%
+ %
+ \pgfplots@axis@apply@post@scale{x}%
+ \pgfplots@axis@apply@post@scale{y}%
+ \ifpgfplots@threedim
+ \pgfplots@axis@apply@post@scale{z}%
+ \fi
+ % and finally, resize limits appropriately and add all cumulative limit compensations:
+ \xdef\pgfplots@glob@TMPa{%
+ %
+ \pgf@xx=\pgfplots@target@unit@scale@xx\pgf@xx
+ \pgf@xy=\pgfplots@target@unit@scale@xy\pgf@xy
+ %
+ \pgf@yx=\pgfplots@target@unit@scale@yx\pgf@yx
+ \pgf@yy=\pgfplots@target@unit@scale@yy\pgf@yy
+ %
+ \ifpgfplots@threedim
+ \pgf@zx=\pgfplots@target@unit@scale@zx\pgf@zx
+ \pgf@zy=\pgfplots@target@unit@scale@zy\pgf@zy
+ \fi
+ %
+ \noexpand\pgfplots@apply@datascaletrafo@change@{x}{\pgfplots@target@datascaletrafo@x@exponent}%
+ \noexpand\pgfplots@apply@datascaletrafo@change@{y}{\pgfplots@target@datascaletrafo@y@exponent}%
+ \noexpand\pgfplots@apply@datascaletrafo@change@{z}{\pgfplots@target@datascaletrafo@z@exponent}%
+ %
+ \noexpand\pgfplots@apply@unit@vector@rescale@keep@size{x}{\pgfplots@target@limitrescale@x}%
+ \noexpand\pgfplots@apply@unit@vector@rescale@keep@size{y}{\pgfplots@target@limitrescale@y}%
+ \noexpand\pgfplots@apply@unit@vector@rescale@keep@size{z}{\pgfplots@target@limitrescale@z}%
+ %
+ \noexpand\pgfplots@notify@final@scalings{%
+ x unit scale=\pgfplots@target@unit@scale@x,%
+ y unit scale=\pgfplots@target@unit@scale@y,%
+ z unit scale=\pgfplots@target@unit@scale@z,%
+ x datatrafo exponent=\pgfplots@target@datascaletrafo@x@exponent,%
+ y datatrafo exponent=\pgfplots@target@datascaletrafo@y@exponent,%
+ z datatrafo exponent=\pgfplots@target@datascaletrafo@z@exponent,%
+ x limit rescale=\pgfplots@target@limitrescale@x,%
+ y limit rescale=\pgfplots@target@limitrescale@y,%
+ z limit rescale=\pgfplots@target@limitrescale@z,%
+ }%
+ }%
+ \endgroup
+ \pgfplots@glob@TMPa
+}%
+
+% Checks for the case the ALL (visible) limit compensation scales are
+% bigger than one (for example x = 1.22, y = 2). In such a case, we
+% want to MINIMIZE the rescaling. This can happen if unit vector ratio
+% is active.
+%
+% In our example, we want to use limit rescaling factors x = 1, y = 2/1.22
+% and, consequently, unit rescaling factors x *= 1.22, y *= 1.22 .
+%
+% This method checks for the case and applies the rescaling if
+% necessary.
+%
+\def\pgfplots@scaling@minimize@limitrescale{%
+ % boolean allLimitScalesAreBiggerThanOne;
+ \pgfplots@loc@tmptrue
+ \if0\b@pgfplots@unitvec@is@zero@x
+ \ifdim\pgfplots@target@limitrescale@x pt<1.002pt %
+ \pgfplots@loc@tmpfalse
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@y
+ \ifdim\pgfplots@target@limitrescale@y pt<1.002pt %
+ \pgfplots@loc@tmpfalse
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@z
+ \ifdim\pgfplots@target@limitrescale@z pt<1.002pt %
+ \pgfplots@loc@tmpfalse
+ \fi
+ \fi
+ %
+ \ifpgfplots@loc@tmp
+ \begingroup
+ % Ah -- all non-vanishing limit rescaling factors are BIGGER
+ % THAN ONE.
+ % In this case, we can save some rescalings!
+ %
+ % Search for the smallest rescaling factor.
+ \let\pgfplots@smallest=\pgf@x
+ \pgfplots@smallest=16000pt %
+ \def\pgfplots@smallest@arg{}%
+ \if0\b@pgfplots@unitvec@is@zero@x
+ \pgf@xa=\pgfplots@target@limitrescale@x pt %
+ \ifdim\pgf@xa<\pgfplots@smallest%
+ \pgfplots@smallest=\pgf@xa
+ \def\pgfplots@smallest@arg{x}%
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@y
+ \pgf@xa=\pgfplots@target@limitrescale@y pt %
+ \ifdim\pgf@xa<\pgfplots@smallest%
+ \pgfplots@smallest=\pgf@xa
+ \def\pgfplots@smallest@arg{y}%
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@z
+ \pgf@xa=\pgfplots@target@limitrescale@z pt %
+ \ifdim\pgf@xa<\pgfplots@smallest%
+ \pgfplots@smallest=\pgf@xa
+ \def\pgfplots@smallest@arg{z}%
+ \fi
+ \fi
+ %
+ % OK. We have the smallest scaling factor. It is > 1.
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@limitrescale@x}%
+ \let\pgfplots@target@limitrescale@x=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@limitrescale@y}%
+ \let\pgfplots@target@limitrescale@y=\pgfmathresult
+ %
+ %
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@unit@scale@inv@x}%
+ \let\pgfplots@target@unit@scale@inv@x=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@unit@scale@inv@y}%
+ \let\pgfplots@target@unit@scale@inv@y=\pgfmathresult
+ %
+ \if0\b@pgfplots@unitvec@is@zero@z
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@limitrescale@z}%
+ \let\pgfplots@target@limitrescale@z=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplots@target@unit@scale@inv@z}%
+ \let\pgfplots@target@unit@scale@inv@z=\pgfmathresult
+ \fi
+ %
+ \pgfplotscoordmath{default}{op}{reciprocal}{{\csname pgfplots@target@limitrescale@\pgfplots@smallest@arg\endcsname}}%
+ \let\scale=\pgfmathresult
+ %
+ \pgfplotsforeachentryinCSV\value{%
+ \pgfplots@target@unit@scale@inv@x,%
+ \pgfplots@target@unit@scale@inv@y,%
+ \pgfplots@target@limitrescale@x,%
+ \pgfplots@target@limitrescale@y%
+ }{%
+ \pgfplotscoordmath{default}{op}{multiply}{{\scale}{\value}}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ \expandafter\let\value=\pgfmathresult
+ }%
+ \if0\b@pgfplots@unitvec@is@zero@z
+ \pgfplotsforeachentryinCSV\value{%
+ \pgfplots@target@unit@scale@inv@z,%
+ \pgfplots@target@limitrescale@z%
+ }{%
+ \pgfplotscoordmath{default}{op}{multiply}{{\scale}{\value}}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ \expandafter\let\value=\pgfmathresult
+ }%
+ \fi
+ %
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand\pgfplots@target@unit@scale@inv@x{\pgfplots@target@unit@scale@inv@x}%
+ \noexpand\def\noexpand\pgfplots@target@unit@scale@inv@y{\pgfplots@target@unit@scale@inv@y}%
+ \noexpand\def\noexpand\pgfplots@target@unit@scale@inv@z{\pgfplots@target@unit@scale@inv@z}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@x{\pgfplots@target@limitrescale@x}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@y{\pgfplots@target@limitrescale@y}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@z{\pgfplots@target@limitrescale@z}%
+ }%
+ \endgroup
+ \pgfplots@glob@TMPa
+%
+%\message{adjusted scales by minimizing common scaling factors: x=1/\pgfplots@target@unit@scale@inv@x, y=1/\pgfplots@target@unit@scale@inv@y, z=1/\pgfplots@target@unit@scale@inv@z; ^^J axis limit componsation scales x=\pgfplots@target@limitrescale@x, y=\pgfplots@target@limitrescale@y, z=\pgfplots@target@limitrescale@z;^^J}%
+ \fi
+}%
+
+% Defines
+% \pgfplots@target@unit@scale@xx
+% \pgfplots@target@unit@scale@xy
+% \pgfplots@target@unit@scale@yx
+% \pgfplots@target@unit@scale@yy
+% \pgfplots@target@unit@scale@zx
+% \pgfplots@target@unit@scale@zy
+% %
+% \pgfplots@target@unit@scale@x
+% \pgfplots@target@unit@scale@y
+% \pgfplots@target@unit@scale@z
+% by combining the input args.
+%
+% #1: the scale to be applied to ALL x components
+% #2: the scale to be applied to ALL y components
+% #3: the scale to be applied to x unit
+% #4: the scale to be applied to y unit
+% #5: the scale to be applied to z unit
+\def\pgfplots@scaling@compute@final@scales#1#2#3#4#5{%
+ \def\pgfplots@loc@TMPa##1##2##3##4{%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{##2}%
+ \let\xscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{##3}%
+ \let\yscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{##4}%
+ \let\unitscale@inv@@=\pgfmathresult
+ %
+ % NOTE : it *would* be more efficient to use
+ % 1/\unitscale@inv@@ in the routines above. BUT THAT IS NOT BACKWARDS COMPATIBLE.
+ % Leave it this way!
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{op}{reciprocal}{{\unitscale@inv@@}}%
+ \let\unitscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{tofixed}{\pgfmathresult}%
+ \expandafter\let\csname pgfplots@target@unit@scale@##1\endcsname=\pgfmathresult
+ %
+ %
+ \ifx\pgfplots@compat@scaling@coordmath@final\pgfplots@compat@scaling@coordmath
+ \else
+ % backwards compatibility is such a burden.... :-(
+ %
+ % earlier versions relied on TeX's dimen arithmetics to
+ % multiply the final scales. Make sure we do the same -
+ % rounding errors on unit vectors are instable, i.e. the
+ % errors add up considerably.
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{parsenumber}{\xscale@@}%
+ \let\xscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{parsenumber}{\yscale@@}%
+ \let\yscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{parsenumber}{\unitscale@@}%
+ \let\unitscale@@=\pgfmathresult
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{parsenumber}{\unitscale@inv@@}%
+ \let\unitscale@inv@@=\pgfmathresult
+ \fi
+ %
+ \ifpgfplots@threedim
+ % backw. compatibility: this is how it used to be in 3d
+ % axes:
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{op}{multiply}{{\xscale@@}{\unitscale@@}}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{tofixed}{\pgfmathresult}%
+ \expandafter\let\csname pgfplots@target@unit@scale@##1x\endcsname=\pgfmathresult
+ %
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{op}{multiply}{{\yscale@@}{\unitscale@@}}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{tofixed}{\pgfmathresult}%
+ \expandafter\let\csname pgfplots@target@unit@scale@##1y\endcsname=\pgfmathresult
+ \else
+ % backw. compatibility: 2d axes used divide in earlier
+ % versions, not reciprocal. Believe it or not; for
+ % \pgfplots@compat@scaling@coordmath=pgfbasic, it makes a
+ % visible difference of about 2-3pt in the complete figure
+ % size.
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{op}{divide}{{\xscale@@}{\unitscale@inv@@}}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{tofixed}{\pgfmathresult}%
+ \expandafter\let\csname pgfplots@target@unit@scale@##1x\endcsname=\pgfmathresult
+ %
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{op}{divide}{{\yscale@@}{\unitscale@inv@@}}%
+ \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath@final}{tofixed}{\pgfmathresult}%
+ \expandafter\let\csname pgfplots@target@unit@scale@##1y\endcsname=\pgfmathresult
+ \fi
+ %
+ }%
+ \if1\b@pgfplots@rescale@x
+ \pgfplots@loc@TMPa{x}{\xscale}{\yscale}{#3}%
+ \else
+ \pgfplots@loc@TMPa{x}{1}{1}{#3}%
+ \fi
+ %
+ \if1\b@pgfplots@rescale@y
+ \pgfplots@loc@TMPa{y}{\xscale}{\yscale}{#4}%
+ \else
+ \pgfplots@loc@TMPa{y}{1}{1}{#4}%
+ \fi
+ %
+ \ifpgfplots@threedim
+ \if1\b@pgfplots@rescale@z
+ \pgfplots@loc@TMPa{z}{\xscale}{\yscale}{#5}%
+ \else
+ \pgfplots@loc@TMPa{z}{1}{1}{#5}%
+ \fi
+ \else
+ \def\pgfplots@target@unit@scale@z{0}%
+ \def\pgfplots@target@unit@scale@zx{0}%
+ \def\pgfplots@target@unit@scale@zy{0}%
+ \def\pgfplots@target@unit@scale@inv@z{inf}%
+ \fi
+ %
+}%
+
+\def\pgfplots@notify@final@scalings#1{%
+ \pgfkeys{/pgfplots/scaling/.cd,
+ .unknown/.code={%
+%\message{setting key '\pgfkeyscurrentkey' to {##1}^^J}
+ \pgfkeyssetvalue{\pgfkeyscurrentkey}{##1}%
+ },
+ #1%
+ }%
+}%
+
+% #1: either x,y, or z
+% #2: the new exponent
+\def\pgfplots@apply@datascaletrafo@change@#1#2{%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ \pgfplotscoordmath{#1}{datascaletrafo get params}%
+ \edef\pgfplots@loc@TMPa{\expandafter\pgfutil@firstoftwo\pgfmathresult}%
+ \edef\pgfplots@loc@TMPb{#2}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ % ok; the data scale trafo did not change at all - we
+ % still have the same exponent.
+ \else
+ % Ah - we have a new data scale trafo!
+ \pgfplotscoordmath{#1}{datascaletrafo inverse}{\csname pgfplots@#1min\endcsname}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{#1}{datascaletrafo inverse}{\csname pgfplots@#1max\endcsname}%
+ \let\pgfplots@loc@TMPb=\pgfmathresult
+ %
+ % first: determine the optimal shift (which is the
+ % transformed lower limit):
+ \pgfplotscoordmath{#1}{datascaletrafo set params}{#2}{0}%
+ \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@loc@TMPa}%
+ %
+ % ok, finalize the data trafo:
+ \pgfplotscoordmath{#1}{datascaletrafo set params}{#2}{\pgfmathresult}%
+ %
+ % ... and recompute axis limits:
+ \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@loc@TMPa}%
+ \expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@loc@TMPb}%
+ \expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+ \fi
+ }{}%
+}%
+
+% Inspects the limit enlargement factors and reinitializes the data
+% scale transformations.
+%
+% The purpose of this method is to avoid "dimension too large" if the
+% factors exceed certain limits.
+%
+% INPUT:
+% \pgfplots@target@limitrescale@x and its variants for y and z
+% \pgfplots@target@unit@scale@inv@x and its variants for y and z
+%
+% OUTPUT:
+% \pgfplots@target@datascaletrafo@x@exponent and its variants for y and z
+% -> contains NEW datascaletrafo exponents
+% \pgfplots@target@datascaletrafo@x@exponent@old and its variants for y and z
+% -> contains OLD datascaletrafo exponents
+% \pgfplots@target@unit@scale@inv@x and its variants for y and z
+% -> contains (modified) unit vector scales
+\def\pgfplots@scaling@adjust@datascaling{%
+ \pgfplots@scaling@adjust@datascaling@for x%
+ \pgfplots@scaling@adjust@datascaling@for y%
+ \pgfplots@scaling@adjust@datascaling@for z%
+}
+\def\pgfplots@scaling@adjust@datascaling@for#1{%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ \pgfplotscoordmath{#1}{datascaletrafo get params}%
+ \def\pgfplots@loc@TMPa##1##2{%
+ \expandafter\def\csname pgfplots@target@datascaletrafo@#1@exponent\endcsname{##1}%
+ \expandafter\def\csname pgfplots@target@datascaletrafo@#1@exponent@old\endcsname{##1}%
+ }%
+ \expandafter\pgfplots@loc@TMPa\pgfmathresult
+ \pgf@xa=\csname pgfplots@target@limitrescale@#1\endcsname pt
+ \ifdim\pgf@xa>5pt %
+ % We want to enlarge axis limits considerably!
+ %
+ \pgfplots@scaling@adjust@datascaling@for@get@compensation{\pgf@xa}%
+ %
+ % Ok, make sure that we do not get "dimension too large"
+ % by adjusting the data scale trafo.
+ %
+ % Note that the data scale trafo has (only) been applied
+ % to axis limits, so we have to reapply it before these
+ % changes can take effect:
+ \pgf@xa=\csname pgfplots@target@unit@scale@inv@#1\endcsname pt
+ \divide\pgf@xa by\pgfplotsretval\relax %
+ \expandafter\edef\csname pgfplots@target@unit@scale@inv@#1\endcsname{\pgf@sys@tonumber\pgf@xa}%
+ %
+ \c@pgf@countd=\csname pgfplots@target@datascaletrafo@#1@exponent\endcsname\relax
+ \advance\c@pgf@countd by-\pgfplotsretvalb\relax %
+ \expandafter\edef\csname pgfplots@target@datascaletrafo@#1@exponent\endcsname{\the\c@pgf@countd}%
+ \fi
+ }{%
+ \expandafter\def\csname pgfplots@target@datascaletrafo@#1@exponent\endcsname{0}%
+ \expandafter\def\csname pgfplots@target@datascaletrafo@#1@exponent@old\endcsname{0}%
+ }%
+}
+
+% Returns
+% \pgfplotsretval -> the absolute scaling
+% \pgfplotsretvalb -> the log10 of the scaling
+\def\pgfplots@scaling@adjust@datascaling@for@get@compensation#1{
+ \ifdim#1<100pt %
+ \def\pgfplotsretval{10}%
+ \def\pgfplotsretvalb{1}%
+ \else
+ \ifdim#1<1000pt %
+ \def\pgfplotsretval{100}%
+ \def\pgfplotsretvalb{2}%
+ \else
+ \ifdim#1<10000pt %
+ \def\pgfplotsretval{1000}%
+ \def\pgfplotsretvalb{3}%
+ \else
+ % too much for this approach anyway... and probably no
+ % use-case at all.
+ \def\pgfplotsretval{1000}%
+ \def\pgfplotsretvalb{3}%
+ \fi
+ \fi
+ \fi
+}%
+
+% Computes the initial scale from a plot box of unit size to the
+% desired with and height.
+%
+% #1 the desired width
+% #2 the desired height
+% #3 [output] a macro which will contain the horizontal (x) scale
+% #4 [output] a macro which will contain the vertical (y) scale
+% #5 [input/output] a macro which, on input, contains the x axis limit compensation scale
+% which is required to select a single unit vector scale without
+% reducing the plots dimension (without actually respecting the
+% final dimension). On output, the input has been multiplied by
+% some additional x limit componensation scale (selected by scale
+% uniformly strategy).
+% #6 [input/output] a macro which will contain a y axis limit
+% compensation scale; it works in the same way as #5
+% #7 [input/output] a macro which will contain a z axis limit
+% compensation scale; it works in the same way as #5
+\def\pgfplots@get@scale@horiz@and@vert#1#2#3#4#5#6#7{%
+ \begingroup
+ \edef\pgfplots@target@limitrescale@x{#5}%
+ \edef\pgfplots@target@limitrescale@y{#6}%
+ \edef\pgfplots@target@limitrescale@z{#7}%
+ \pgfplots@get@dimension@of@BB
+ \pgf@xa=\pgfplotsretval\relax
+ \pgf@xb=\pgfplotsretvalb\relax
+ \pgf@ya=#1\relax
+ \pgf@yb=#2\relax
+ \edef\w{\pgf@sys@tonumber\pgf@xa}%
+ \edef\h{\pgf@sys@tonumber\pgf@xb}%
+ \edef\W{\pgf@sys@tonumber\pgf@ya}%
+ \edef\H{\pgf@sys@tonumber\pgf@yb}%
+%\message{PGFPLOTS: the current unit vectors result in a UNIT BB of (\the\pgf@xa,\the\pgf@xb). Scaling it to (\the\pgf@ya,\the\pgf@yb)...^^J}%
+ \ifcase\pgfplots@scale@mode@choice
+ % scale mode=auto does not happen here
+ \or
+ % scale mode=none does not happen here
+ \or
+ % scale mode=stretch to fill
+ %
+ % This is very simple:
+ %
+ % Compute individual scaling factors for X and Y
+ % such that the UNIT-BB will have size #1,#2. Keep limits.
+ \pgfmathdivide@{\W}{\w}%
+ \let\scalex=\pgfmathresult
+ %
+ \pgfmathdivide@{\H}{\h}%
+ \let\scaley=\pgfmathresult
+ %
+ % no changes to the axis limits - we only rescale units.
+ \def\pgfplots@target@limitrescale@x@{1}%
+ \def\pgfplots@target@limitrescale@y@{1}%
+ \def\pgfplots@target@limitrescale@z@{1}%
+ \pgfplots@BB@update@cumulative@limit@compensations
+ \or
+ % scale mode=scale uniformly
+ % compute ONE common scale for both, X and Y - and satisfy
+ % width/height constraints by adjusting the axis limits.
+ %
+ % The idea is as follows:
+ % we WANT to have width W and height H.
+ % The constraint is that each unit vector must get the same
+ % scale -- but the axis limits can receive individual
+ % compensation scales. But it should "look reasonable well".
+ %
+ % currently, we have
+ % w = r_x e_xx + r_y e_yx + rz e_zx (with e_zx = 0 typically)
+ % h = r_x e_xy + r_y e_yy + rz e_zy
+ %
+ % where r_x, r_y, r_z are the maximal range of the data in
+ % x,y,z respectively. Depending on the context of this method,
+ % they are either 1 (relative coords) or
+ % (xmax-xmin) (absolute coords).
+ %
+ % Now, search for a set of real numbers
+ % Rx, Ry, Rz, s
+ % such that
+ % W = (Rx r_x) (s e_xx) + (Ry r_y) (s e_yx) + (Rz r_z) (s e_zx)
+ % H = (Rx r_x) (s e_xy) + (Ry r_y) (s e_yy) + (Rz r_z) (s e_zy)
+ %
+ % clearly, the solution is not unique.
+ % ONE choice is to employ the fact that e_zx = 0 (or, for 2d
+ % plots, e_zx=0, e_zy=0 and e_yx=0):
+ %
+ % in that case, we can compute s such that the equation for W
+ % is satisfied and compensate only the limit r_z, i.e. to
+ % choose
+ % s := W / w, (scale to satisfy width constraint)
+ % Rx := Ry := 1 (keep limits in X and Y)
+ % Rz = ( H - s (w - r_z e_zy) ) / (s r_z e_zy) (adjust z limit to satisfy height constraint)
+ %
+ % This approach works well if W < H . If W > H, it will look
+ % bad: Rz will be less than 1, causing the limit to become
+ % smaller. This, in turn, will clip away parts of the image.
+ %
+ %
+ %
+ % Another solution is to make it the other way: to keep the
+ % limit r_z, but to reduce the size and enlarge the other
+ % limits to satisfy the size constraints. This solution is
+ % considerably more involved; it requires to solve a nonlinear
+ % set of equations.
+ %
+ % Formally, this second solution uses
+ % Rz := 1 (no limit componensation scale for z -- keep z limit)
+ % R:= Rx := Ry (same limit componensation scale for both X and Y)
+ % R and s still need to be determined from the two equations for W
+ % and H.
+ %
+ % Substituting the given choices into the equations for W and H, we find
+ %
+ % R = W / (s w)
+ %
+ % s = H * (R * (h-r_z e_zy) + r_z e_zy)^-1
+ %
+ % Here, we employed the definition of 'h', see above. The
+ % equations are non-linear.
+ %
+ % ATTENTION: we assume that the datascaletrafo set params
+ % method has been called with THE SAME SCALE IN EACH
+ % DIRECTION.
+ \if0\pgfplots@scaleuniformly@choice
+ % scale uniformly strategy=auto
+ \pgfplots@get@scale@horiz@and@vert@scaleuniformly@of@optimal@strategy
+ \else
+ \pgfplots@get@scale@horiz@and@vert@scaleuniformly
+ \pgfplots@BB@update@cumulative@limit@compensations
+ \fi
+ \fi
+ %
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand#3{\scalex}%
+ \noexpand\def\noexpand#4{\scaley}%
+ \noexpand\def\noexpand#5{\pgfplots@target@limitrescale@x}%
+ \noexpand\def\noexpand#6{\pgfplots@target@limitrescale@y}%
+ \noexpand\def\noexpand#7{\pgfplots@target@limitrescale@z}%
+ }%
+ \endgroup
+ \pgfplots@glob@TMPa
+}%
+
+% This is the implementation for 'scale uniformly strategy=auto'.
+%
+% It works by finding the strategy which involves the minimal scaling
+% overhead.
+%
+% To this end, it computes the result for each 'scale uniformly
+% strategy', and computes a cost function. The one with optimal cost
+% function wins, and its results are returned.
+%
+% The cost function is the overal scaling which is applied to AXIS
+% LIMITS. It works as follows:
+% 1. if a choice requires to REDUCE the axis limits in order to
+% fulfill all constraints, it is neglected (using maximal cost 16000).
+% Reducing axis limits may clip away information.
+%
+% 2. if a choice requires to ENLARGE some axis limits, its cost is the
+% sum of the individual scaling factors (even if they are are one -
+% who cares).
+%
+% Note that this method *is* relevant and the optimization appears to
+% be necessary.
+% Examples are
+% unittest_scalemode_2d_standard_1.tex
+% and perhaps
+% unittest_scalemode_2d_standard_0.tex
+% and more involved 3d examples are also available.
+%
+% My first guess was that it is sufficient to decide the optimal
+% strategy in advance by comparing the target width and the target
+% height - but that proved to be insufficient: it leads to correct
+% results, but wastes too much space (i.e. enlarges limits too much).
+%
+% ATTENTION: the cost function INCLUDES RESULTS OF
+% \pgfplots@BB@for@plotbox@get@unit@scales@for@limits and its
+% corrector
+% \pgfplots@BB@for@plotbox@get@unit@scales@compensated@axis@limits.
+%
+% More precisely, it relies on already computes limit compensation
+% factors which do not depend on the target width/target height: both
+% \pgfplots@BB@for@plotbox@get@unit@scales@compensated@axis@limits and
+% this implementation of 'scale uniformly strategy' can be used to compute
+% the cost of a strategy.
+%
+\def\pgfplots@get@scale@horiz@and@vert@scaleuniformly@of@optimal@strategy{%
+ \begingroup
+ \def\mathclass{default}%
+ \pgfplotscoordmath{\mathclass}{max limit}%
+ \let\pgfplots@cost@for@choice@superhigh=\pgfmathresult%
+ %
+ % private helpers to compute the cost.
+ \def\pgfplots@scalestrategy@compute@cost{%
+ \begingroup
+ % ATTENTION: this call changes
+ % '\pgfplots@target@limitrescale@x' and its variants.
+ % Restore its value after the iteration:
+ \pgfplots@BB@update@cumulative@limit@compensations
+ \pgfplotscoordmath{\mathclass}{one}%
+ \let\ONE=\pgfmathresult
+ \pgfplotscoordmath{\mathclass}{parsenumber}{\pgfplots@target@limitrescale@x}%
+ \let\X=\pgfmathresult
+ \pgfplotscoordmath{\mathclass}{parsenumber}{\pgfplots@target@limitrescale@y}%
+ \let\Y=\pgfmathresult
+ \ifpgfplots@threedim
+ \pgfplotscoordmath{\mathclass}{parsenumber}{\pgfplots@target@limitrescale@z}%
+ \let\Z=\pgfmathresult
+ \else
+ \let\Z=\pgfplots@target@limitrescale@z
+ \fi
+ %
+ % If one of the resulting limit compensation scales is
+ % less than 1, we can immediately skip it - we do not want
+ % to risk to clip away image content.
+ \pgfplotscoordmath{\mathclass}{if less than}{\X}{\ONE}{%
+ \let\pgfplots@cost@for@choice=\pgfplots@cost@for@choice@superhigh
+ }{%
+ \pgfplotscoordmath{\mathclass}{if less than}{\Y}{\ONE}{%
+ \let\pgfplots@cost@for@choice=\pgfplots@cost@for@choice@superhigh
+ }{%
+ \ifpgfplots@threedim
+ \pgfplotscoordmath{\mathclass}{if less than}{\Z}{\ONE}{%
+ \let\pgfplots@cost@for@choice=\pgfplots@cost@for@choice@superhigh
+ }{%
+ % ah - 3 limit scales >= 1. Good, assign cost:
+ \pgfplots@scalestrategy@compute@cost@
+ }%
+ \else
+ % ah - all limit scales >=1. Good, assign cost:
+ \pgfplots@scalestrategy@compute@cost@
+ \fi
+ }%
+ }%
+%\message{scale uniformly strategy=auto: '\pgfplots@tostring@scaleuniformlystrategy{\pgfplots@scaleuniformly@choice}' has cost \pgfplots@cost@for@choice\space(limit rescaling factors x=\X, y=\Y, z=\Z)^^J}%
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand\pgfplots@scaleuniformly@choice{\pgfplots@scaleuniformly@choice}%
+ \noexpand\def\noexpand\scalex{\scalex}%
+ \noexpand\def\noexpand\scaley{\scaley}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@x{\pgfplots@target@limitrescale@x}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@y{\pgfplots@target@limitrescale@y}%
+ \noexpand\def\noexpand\pgfplots@target@limitrescale@z{\pgfplots@target@limitrescale@z}%
+ }%
+ \pgfmath@smuggleone\pgfplots@cost@for@choice
+ % keep in mind that this scope IS NECESSARY: we have
+ % changed the target quantities
+ % \pgfplots@target@limitrescale@x and its variants!
+ \endgroup
+ \let\pgfplots@scalestrategy@values=\pgfplots@glob@TMPa
+ }%
+ \def\pgfplots@scalestrategy@compute@cost@{%
+ \pgfplotscoordmath{\mathclass}{op}{add}{{\X}{\Y}}%
+ \ifpgfplots@threedim
+ \pgfplotscoordmath{\mathclass}{op}{add}{{\pgfmathresult}{\Z}}%
+ \fi
+ \let\pgfplots@cost@for@choice=\pgfmathresult
+ }%
+ %
+ % compute initial cost:
+ \def\pgfplots@scaleuniformly@choice{3}% change horizontal limits
+ \pgfplots@get@scale@horiz@and@vert@scaleuniformly
+ \pgfplots@scalestrategy@compute@cost
+ %
+ % init minimum:
+ \let\pgfplots@cost@for@choice@arg=\pgfplots@scalestrategy@values
+ \let\pgfplots@cost@for@choice@sofar=\pgfplots@cost@for@choice%
+ %
+ % compute cost of next strategy:
+ \def\pgfplots@scaleuniformly@choice{2}% change vertical limits
+ \pgfplots@get@scale@horiz@and@vert@scaleuniformly
+ \pgfplots@scalestrategy@compute@cost
+ %
+ % update minimum:
+ \pgfplotscoordmath{\mathclass}{if less than}{\pgfplots@cost@for@choice}{\pgfplots@cost@for@choice@sofar}{%
+ \let\pgfplots@cost@for@choice@arg=\pgfplots@scalestrategy@values
+ \let\pgfplots@cost@for@choice@sofar=\pgfplots@cost@for@choice%
+ }{%
+ }%
+ %
+ \ifx\pgfplots@cost@for@choice@sofar\pgfplots@cost@for@choice@superhigh
+ % the algorithm discarded every available strategy.
+ \def\pgfplots@scaleuniformly@choice{1}% fall back to 'units only'
+ \pgfplots@get@scale@horiz@and@vert@scaleuniformly
+ \pgfplots@scalestrategy@compute@cost
+ \let\pgfplots@cost@for@choice@arg=\pgfplots@scalestrategy@values
+ \let\pgfplots@cost@for@choice@sofar=\pgfplots@cost@for@choice%
+ \fi
+ %
+ %
+ \global\let\pgfplots@glob@TMPa=\pgfplots@cost@for@choice@arg
+ \endgroup
+ \pgfplots@glob@TMPa
+%\message{scale uniformly strategy=auto: choosing '\pgfplots@tostring@scaleuniformlystrategy{\pgfplots@scaleuniformly@choice}'^^J}%
+}
+
+\def\pgfplots@tostring@scaleuniformlystrategy#1{%
+ % scale uniformly strategy:
+ \ifcase#1\relax
+ auto
+ \or
+ units only
+ \or
+ change vertical limits
+ \or
+ change horizontal limits
+ \fi
+}
+% Does the work for 'scale mode=scale uniformly' inside of
+% \pgfplots@get@scale@horiz@and@vert.
+%
+% It returns its result into \pgfplots@target@limitrescale@x@ (i.e.
+% with an extra '@')
+\def\pgfplots@get@scale@horiz@and@vert@scaleuniformly{%
+ \ifcase\pgfplots@scaleuniformly@choice\relax
+ % scale uniformly strategy=auto does not happen here.
+ \or
+ % scale uniformly strategy=units only
+ \pgfplots@scaleuniformly@onlyunits
+ \or
+ % scale uniformly strategy=change vertical limits
+ %
+ % first, scale to the width ...
+ \pgfplots@scaleuniformly@onlyunits@{\w}{\W}%
+ % ... and change (only) vertical limits to get the "correct"
+ % height:
+ \ifdim\pgf@zy=0pt
+ \ifdim\pgf@yx=0pt
+ \pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir{y}\returninto\pgfplots@target@limitrescale@y@
+ \else
+ \pgfplots@scale@uniformly@fallback
+ \fi
+ \else
+ \ifdim\pgf@zx=0pt
+ \pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir{z}\returninto\pgfplots@target@limitrescale@z@
+ \else
+ \pgfplots@scale@uniformly@fallback
+ \fi
+ \fi
+ \or
+ % scale uniformly strategy=change horizontal limits
+ \ifdim\pgf@zy=0pt
+ \ifdim\pgf@yx=0pt
+ \ifdim\pgf@xy=0pt
+ % special 2d routine with explicit solution
+ \pgfplots@scaleuniformly@change@horizontal@limits@twodim
+ {\scalex}
+ {\pgfplots@target@limitrescale@x@}
+ {\pgfplots@target@limitrescale@y@}
+ {\pgfplots@target@limitrescale@z@}%
+ \else
+ \pgfplots@scale@uniformly@fallback
+ \fi
+ \else
+ \pgfplots@scale@uniformly@fallback
+ \fi
+ \else
+ \ifdim\pgf@zx=0pt
+ \pgfplots@scaleuniformly@change@horizontal@limits
+ {\scalex}
+ {\pgfplots@target@limitrescale@x@}
+ {\pgfplots@target@limitrescale@y@}
+ {\pgfplots@target@limitrescale@z@}%
+ \else
+ \pgfplots@scale@uniformly@fallback
+ \fi
+ \fi
+ \let\scaley=\scalex
+ \fi
+}
+
+\def\pgfplots@scaleuniformly@onlyunits{%
+ % scale to the smaller target dimension:
+ \ifdim\W pt<\H pt %
+ \pgfplots@scaleuniformly@onlyunits@{\w}{\W}%
+ \else
+ \pgfplots@scaleuniformly@onlyunits@{\h}{\H}%
+ \fi
+}%
+
+% #1 : the actual dimension
+% #2 : the target dimension
+\def\pgfplots@scaleuniformly@onlyunits@#1#2{%
+ \def\pgfplots@target@limitrescale@x@{1}%
+ \def\pgfplots@target@limitrescale@y@{1}%
+ \def\pgfplots@target@limitrescale@z@{1}%
+ \pgfmathdivide@{#2}{#1}%
+ \let\scalex=\pgfmathresult
+ \let\scaley=\scalex % we *need* the same unit scale.
+}%
+
+% Computes 'scale uniformly strategy=change horizontal limits'.
+% This is a complicated solution, see the documentation in the
+% implementation for
+% 'scale mode=scale uniformly'
+%
+% #1 [output] a macro which will contain the (uniform) scale for the
+% unit vectors
+% #2 [output] a macro which will contain a x axis limit compensation scale
+% #3 [output] a macro which will contain a x axis limit compensation scale
+% #4 [output] a macro which will contain a x axis limit compensation scale
+\def\pgfplots@scaleuniformly@change@horizontal@limits#1#2#3#4{%
+ \begingroup
+ %
+ \pgfplots@BB@for@plotbox@getunitheight{\pgf@xc}{z}%
+ %
+ % compute the rest in floating point - intermediate results may
+ % become too huge for TeX.
+ \pgfplotscoordmath{default}{parsenumber}{\expandafter\pgf@sys@tonumber\csname pgf@xc\endcsname}%
+ \let\M=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{parsenumber}{\w}%
+ \let\w=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\W}%
+ \let\W=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\h}%
+ \let\h=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\H}%
+ \let\H=\pgfmathresult
+ \pgfplotscoordmath{default}{op}{divide}{{\W}{\w}}%
+ \let\Wwinv=\pgfmathresult
+ \pgfplotscoordmath{default}{op}{subtract}{{\h}{\M}}%
+ \let\hminusM=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{one}%
+ \let\S=\pgfmathresult%
+ \let\R=\pgfmathresult%
+ \let\Rx=\pgfmathresult
+ \def\Rz{1}%
+ %
+ \def\pgfplots@hold@S@get@R{%
+ \pgfplotscoordmath{default}{op}{divide}{{\Wwinv}{\S}}%
+ \let\R=\pgfmathresult
+%\message{updated R = \R\space ( S = \S ) ^^J}%
+ }%
+ \def\pgfplots@hold@R@get@S{%
+ \pgfplotscoordmath{default}{op}{multiply}{{\R}{\hminusM}}%
+ \pgfplotscoordmath{default}{op}{add}{{\pgfmathresult}{\M}}%
+ \pgfplotscoordmath{default}{op}{divide}{{\H}{\pgfmathresult}}%
+ \let\S=\pgfmathresult
+%\message{updated S = \S\space ( R = \R ) ^^J}%
+ }%
+ %
+ % This is the (most stupid) nonlinear method which is at hand:
+ % fix point iteration.
+ % choose R arbitrarily (R=1 seems adequate), solve for s.
+ % Then, fix s and solve for R. Then, fix R and
+ % solve for s until convergence.
+ \c@pgf@countc=0
+ \pgfplotsloop{%
+ \ifnum\c@pgf@countc<\pgfkeysvalueof{/pgfplots/scale uniformly strategy iter} %
+ \pgfplotsloopcontinuetrue
+ \else
+ \pgfplotsloopcontinuefalse
+ \fi
+ }{%
+ \pgfplots@hold@R@get@S \pgfplots@hold@S@get@R
+ \advance\c@pgf@countc by1 %
+ }%
+ %
+ \pgfplotscoordmath{default}{tofixed}{\R}\let\R=\pgfmathresult
+ \pgfplotscoordmath{default}{tofixed}{\S}\let\S=\pgfmathresult
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand#1{\S}%
+ \noexpand\def\noexpand#2{\R}%
+ \noexpand\def\noexpand#3{\R}%
+ \noexpand\def\noexpand#4{\Rz}%
+ }%
+ \endgroup
+ %
+ \pgfplots@glob@TMPa
+}%
+
+% Computes 'scale uniformly strategy=change horizontal limits'.
+%
+% This is a simplified closed solution assuming that e_xy=0 and e_yx = 0
+%
+% #1 [output] a macro which will contain the (uniform) scale for the
+% unit vectors
+% #2 [output] a macro which will contain a x axis limit compensation scale
+% #3 [output] a macro which will contain a x axis limit compensation scale
+% #4 [output] a macro which will contain a x axis limit compensation scale
+\def\pgfplots@scaleuniformly@change@horizontal@limits@twodim#1#2#3#4{%
+ \begingroup
+ % Assuming that we have a standard 2d axis, i.e.
+ % e_zx = e_zy = 0, e_xy = 0, and e_yx =0,
+ % we can immediately compute a solution.
+ %
+ % In this case, we have the actual width
+ % w = r_x e_xx + r_y e_yx + rz e_zx
+ % = r_x e_xx
+ % and actual height
+ % h = r_x e_xy + r_y e_yy + rz e_zy
+ % = r_y e_yy
+ % and, consequently, desired width
+ % W = (Rx r_x) (s e_xx) + (Ry r_y) (s e_yx) + (Rz r_z) (s e_zx)
+ % = (Rx r_x) (s e_xx)
+ % and desired height
+ % H = (Rx r_x) (s e_xy) + (Ry r_y) (s e_yy) + (Rz r_z) (s e_zy)
+ % = (Ry r_y) (s e_yy).
+ % since this strategy changes horizontal limits (only), we have
+ % Ry := 1.
+ % We find
+ % s : = H/h
+ % and
+ % Rx : = W/w /s .
+ %
+ \pgfplotscoordmath{default}{parsenumber}{\w}%
+ \let\w=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\W}%
+ \let\W=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\h}%
+ \let\h=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\H}%
+ \let\H=\pgfmathresult
+ \pgfplotscoordmath{default}{op}{divide}{{\H}{\h}}%
+ \let\S=\pgfmathresult
+ \pgfplotscoordmath{default}{op}{divide}{{\W}{\w}}%
+ \pgfplotscoordmath{default}{op}{divide}{{\pgfmathresult}{\S}}%
+ \let\Rx=\pgfmathresult
+ \def\Ry{1}%
+ \def\Rz{1}%
+ %
+ \pgfplotscoordmath{default}{tofixed}{\Rx}\let\Rx=\pgfmathresult
+ \pgfplotscoordmath{default}{tofixed}{\S}\let\S=\pgfmathresult
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand#1{\S}%
+ \noexpand\def\noexpand#2{\Rx}%
+ \noexpand\def\noexpand#3{\Ry}%
+ \noexpand\def\noexpand#4{\Rz}%
+ }%
+ \endgroup
+ %
+ \pgfplots@glob@TMPa
+}%
+
+\def\pgfplots@BB@update@cumulative@limit@compensations{%
+%\message{ -> additional limit componensation scales x=\pgfplots@target@limitrescale@x@, y=\pgfplots@target@limitrescale@y@, z=\pgfplots@target@limitrescale@z@^^J}%
+ % add limit compensation to what we have from earlier
+ % operations:
+ \pgfplotscoordmath{pgfbasic}{op}{multiply}{{\pgfplots@target@limitrescale@x@}{\pgfplots@target@limitrescale@x}}%
+ \let\pgfplots@target@limitrescale@x=\pgfmathresult
+ \pgfplotscoordmath{pgfbasic}{op}{multiply}{{\pgfplots@target@limitrescale@y@}{\pgfplots@target@limitrescale@y}}%
+ \let\pgfplots@target@limitrescale@y=\pgfmathresult
+ \pgfplotscoordmath{pgfbasic}{op}{multiply}{{\pgfplots@target@limitrescale@z@}{\pgfplots@target@limitrescale@z}}%
+ \let\pgfplots@target@limitrescale@z=\pgfmathresult
+}%
+
+\def\pgfplots@scale@uniformly@fallback{%
+ \ifpgfplots@scaleuniformly@warning
+ \pgfplots@warning{Sorry, 'scale uniformly' failed because its actual implementation works only if y_x = 0 and x_y = 0 (for 2d axes) or if z_x = 0 (for 3d axes). The result will not fill the prescribed dimensions. Falling back to 'scale uniformly strategy=units only. (use scale uniformly warning=false to disable this warning)}%
+ \fi
+ \pgfplots@scaleuniformly@onlyunits
+}%
+
+% This is part of the implementation of 'scale mode=scale uniformly'.
+%
+% Its purpose it to set up the initial scaling such that
+% 1. each unit vector gets the same scale
+% 2. the axis limits are resized (enlarged) to keep the plot box ratio
+% (as far as possible)
+%
+% It repairs the outcome of
+% \pgfplots@BB@for@plotbox@get@unit@scales@for@limits .
+%
+% The assumption is that on input #1, #2, and #3 are the factors which
+% would be used by stretch-to-fill in order to squeze the axis limits
+% into the plot box defined by e_x, e_y, and e_z (the unit vectors).
+%
+% On output, #1, #2, and #3 will be modified such that *each has the
+% same value*. The value will be chosen with care. More precisely, it
+% is the *minimum* of {#1,#2,#3}.
+%
+% Clearly, 'scale mode=scale uniformly' has less freedom than
+% strech-to-fill. In order to keep the plot box ratio intact (as far
+% as possible), the axis limits will be rescaled to componsate for the
+% ignored scaling factors. More precisely, if direction i is not the
+% extremal value (as discussed in the last paragraph), the axis limits
+% will be rescaled by #i/extremum .
+%
+%
+%
+% #1: on input, it contains the x unit scale which would be taken without the
+% compensation. On output, it contains the x unit scale which *will* be
+% used.
+% #2: same as #1, but for y
+% #3: same as #1, but for z
+% #4: [output] a scale for use as argument of \pgfplots@apply@unit@vector@rescale@keep@size{x}{<arg>}
+% #5: [output] a scale for use as argument of \pgfplots@apply@unit@vector@rescale@keep@size{y}{<arg>}
+% #6: [output] a scale for use as argument of \pgfplots@apply@unit@vector@rescale@keep@size{z}{<arg>}
+%
+% The output arguments need to be applied before they take effect.
+\def\pgfplots@BB@for@plotbox@get@unit@scales@compensated@axis@limits#1#2#3#4#5#6{%
+ \begingroup
+ % ATTENTION : this code ASSUMES that the datascaling trafo is
+ % initialized with THE SAME SCALE IN EACH DIRECTION.
+ % The data scaling also leads to (potentially non-uniform) scaling per component.
+ %
+ % Note that we could handle the datascaling here -- but we would
+ % leave the supported number range easily. That's why that part of
+ % the 'scale mode=scale uniformly' implementation has been moved
+ % to \pgfplots@set@optimal@datatrafos@allaxes
+ %
+ % This here handles the limits only.
+ \edef\pgfplots@scale@unitx{#1}%
+ \edef\pgfplots@scale@unity{#2}%
+ \edef\pgfplots@scale@unitz{#3}%
+ %
+ % compute extreme + arg extreme of these scales:
+ \def\pgfplots@extreme@scale{-16300}%
+ \def\pgfplots@extreme@scale@arg{NONE}%
+ %
+ \if0\b@pgfplots@unitvec@is@zero@x
+ \ifdim\pgfplots@extreme@scale pt<\pgfplots@scale@unitx pt
+ \let\pgfplots@extreme@scale=\pgfplots@scale@unitx
+ \def\pgfplots@extreme@scale@arg{x}%
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@y
+ \ifdim\pgfplots@extreme@scale pt<\pgfplots@scale@unity pt
+ \let\pgfplots@extreme@scale=\pgfplots@scale@unity
+ \def\pgfplots@extreme@scale@arg{y}%
+ \fi
+ \fi
+ \if0\b@pgfplots@unitvec@is@zero@z
+ \ifdim\pgfplots@extreme@scale pt<\pgfplots@scale@unitz pt
+ \let\pgfplots@extreme@scale=\pgfplots@scale@unitz
+ \def\pgfplots@extreme@scale@arg{z}%
+ \fi
+ \fi
+ %
+ % Now, adjust axis limits to compensate for the effect: we still
+ % want to have a plot box which is as close as possible to the
+ % target plot box.
+ \def\pgfplots@loc@TMPa##1##2{%
+ \if0\csname b@pgfplots@unitvec@is@zero@##1\endcsname
+ \if1\pgfplots@scaleuniformly@choice % FIXME : this appears to be too much. Disable this!?
+ % ok, nothing to do for this direction.
+ \pgfplotscoordmath{pgfbasic}{one}%
+ \let##2=\pgfmathresult
+ \else
+ \if\pgfplots@extreme@scale@arg ##1%
+ % ok, nothing to do for this direction.
+ \pgfplotscoordmath{pgfbasic}{one}%
+ \let##2=\pgfmathresult
+ \else
+ \pgfplotscoordmath{pgfbasic}{op}{divide}{{\pgfplots@extreme@scale}{\csname pgfplots@scale@unit##1\endcsname}}%
+ % do not call apply@unit@rescale immediately because the
+ % unit vectors may not be in their final state. Postpone until
+ % they are final.
+ \edef##2{\pgfmathresult}%
+ \fi
+ \fi
+ \else
+ \def##2{1}%
+ \fi
+ }%
+ \pgfplots@loc@TMPa{x}{#4}%
+ \pgfplots@loc@TMPa{y}{#5}%
+ \pgfplots@loc@TMPa{z}{#6}%
+ %
+ \toks0=\expandafter{#4}%
+ \toks1=\expandafter{#5}%
+ \toks2=\expandafter{#6}%
+ \xdef\pgfplots@glob@TMPa{%
+ % same scale in each dir:
+ \def\noexpand#1{\pgfplots@extreme@scale}%
+ \def\noexpand#2{\pgfplots@extreme@scale}%
+ \def\noexpand#3{\pgfplots@extreme@scale}%
+ \def\noexpand#4{\the\toks0}%
+ \def\noexpand#5{\the\toks1}%
+ \def\noexpand#6{\the\toks2}%
+ }%
+ \endgroup
+ \pgfplots@glob@TMPa
+}
+
+% #1 : a dimen register
+% #2 : x, y, or z
+\def\pgfplots@BB@for@plotbox@getunitheight#1#2{%
+ #1=\csname pgfplots@plotbox@#2max\endcsname\csname pgf@#2y\endcsname
+ \advance#1 by -\csname pgfplots@plotbox@#2min\endcsname\csname pgf@#2y\endcsname
+ \ifdim#1<0pt %
+ % we want to return a height. It is also bigger than 0.
+ % the difference above may be negative if the unit points
+ % downward (special combinations of view/h and view/v)
+ #1=-#1\relax
+ \fi
+}%
+
+
+% Modifies the AXIS LIMITS to ensure that a suitable width/height is
+% achieved.
+%
+% This does NOT introduce a further scale to the unit vectors.
+%
+% #1: a direction (x,y, or z)
+% #2: a macro name. It will be assigned globally. It will contain
+% EXECUTABLE instructions which will modify the axis limits to fit the
+% scaling.
+%
+% PRECONDITION:
+% - \pgfplots@glob@TMPa contains the already computed
+% scaling factor for 'scale uniformly'
+% - \pgf@xb is the actual height and \pgf@yb is the desired height
+% (set as in the scaling routine)
+%
+% POSTCONDITION:
+% #2 will contain the argument <arg> for \pgfplots@apply@unit@vector@rescale@keep@size{#1}{<arg>}
+\def\pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir#1\returninto#2{%
+ % The strategy is as follows:
+ % 1. I want to fit the axis into width #1 (\pgf@ya) and
+ % height #1 (\pgf@yb).
+ % 2. I want to MAINTAIN the unit vector ratio.
+ % 3. I want to MAINTAIN the unit vector directions.
+ %
+ % I already know the scaling factor to fit the width (it
+ % is stored in \scalex = \scaley).
+ % Let's call it "s".
+ %
+ % Consequently, a uniform scaling by "s" leads to the image
+ % height
+ % h = s* (r_x * e_xy + r_y * e_yy + r_z * e_zy)
+ % where r_i = (imax - imin). This here is essentially the
+ % same as the bounding box computation above (at least for
+ % standart orthographic 3D axes).
+ %
+ % What I want now is to enlarge the limits such that I
+ % have BOTH, width #1 AND height #2, without obscuring the
+ % unit vector ratio. Recall that width #1 is already
+ % given.
+ %
+ % This strategy achieves this goal by
+ % modifying axis limits for an axis whose unit vector is
+ % parallel to the canvas y axis, i.e. e_i = (0,*).
+ %
+ % That means I have to introduce a SECOND scale s_z which
+ % applies only to the Z unit vector (since e_z = (0,*) ).
+ % If H = #2 is the desired height, I find the target
+ % equation for s_z,
+ %
+ % H = s* r_x e_xy + s * r_y e_yy + s_z * s * r_z * e_zy
+ % =>
+ % s_z = ( H- s*r_x e_xy - s*r_y e_yy) / ( s * r_z * e_zy).
+ %
+ % Remember that
+ % s = \scalex
+ % H = \H
+ % h = r_x * e_xy + r_y * e_yy + r_z * e_zy = \h
+ % =>
+ % s_z = ( H- s*( h - r_z * e_zy) ) / ( s * r_z * e_zy).
+ %
+ \begingroup
+ \pgfplots@BB@for@plotbox@getunitheight{\pgf@xc}{#1}%
+ %
+ % compute the rest in floating point - intermediate results may
+ % become too huge for TeX.
+ \pgfplotscoordmath{default}{parsenumber}{\expandafter\pgf@sys@tonumber\csname pgf@xc\endcsname}%
+ \let\pgfplots@diff=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{parsenumber}{\scalex}%
+ \let\pgfplots@s=\pgfmathresult
+ %
+ % this is a precondition of this method:
+ \pgfplotscoordmath{default}{parsenumber}{\h}%
+ \let\h=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\H}%
+ \let\H=\pgfmathresult
+ %
+ % compute counter := H - s * (h - (max-min))
+ \pgfplotscoordmath{default}{op}{subtract}{{\h}{\pgfplots@diff}}%
+ \pgfplotscoordmath{default}{op}{multiply}{{\pgfplots@s}{\pgfmathresult}}%
+ \pgfplotscoordmath{default}{op}{subtract}{{\H}{\pgfmathresult}}%
+ \let\pgfplots@counter=\pgfmathresult
+ %
+ % computer denom := s * (max-min)
+ \pgfplotscoordmath{default}{op}{multiply}{{\pgfplots@s}{\pgfplots@diff}}%
+ \let\pgfplots@denom=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{op}{divide}{{\pgfplots@counter}{\pgfplots@denom}}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ %
+ % Now, s_z = \pgfmathresult .
+ %
+ % Now, adjust the z limits.
+ % Note that \pgfplots@apply@unit@vector@rescale@keep@size
+ % has a slightly different context; it assumes that the
+ % unit vector has been rescaled, not the axis limits.
+ % Consequently, the inverse of the scaling factor enters.
+ % Since \pgfplots@apply@unit@vector@rescale@keep@size
+ % expects the inverse of the scale, we can provide
+ % \pgfmathresult:
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \let#2=\pgfmathresult
+}
+
+\def\pgfplots@computeunitvectorlengths{%
+ \pgfplotsutil@edef@invoke\pgfmathveclen@{%
+ {\pgf@sys@tonumber\pgf@xx}%
+ {\pgf@sys@tonumber\pgf@xy}%
+ }%
+ \let\pgfplots@x@veclength=\pgfmathresult
+ \pgfplotsmath@ifzero{\pgfplots@x@veclength}{%
+ \def\pgfmathresult{infty}%
+ % this case will be caught in \pgfplots@initsizes
+ }{%
+ \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
+ }%
+ \let\pgfplots@x@inverseveclength=\pgfmathresult
+ %
+ \pgfplotsutil@edef@invoke\pgfmathveclen@{%
+ {\pgf@sys@tonumber\pgf@yx}%
+ {\pgf@sys@tonumber\pgf@yy}%
+ }%
+ \let\pgfplots@y@veclength=\pgfmathresult
+ \pgfplotsmath@ifzero{\pgfplots@y@veclength}{%
+ \def\pgfmathresult{infty}%
+ % this case will be caught in \pgfplots@initsizes
+ }{%
+ \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
+ }%
+ \let\pgfplots@y@inverseveclength=\pgfmathresult
+ %
+ \ifpgfplots@threedim
+ \pgfplotsutil@edef@invoke\pgfmathveclen@{%
+ {\pgf@sys@tonumber\pgf@zx}%
+ {\pgf@sys@tonumber\pgf@zy}%
+ }%
+ \let\pgfplots@z@veclength=\pgfmathresult
+ \pgfplotsmath@ifzero{\pgfplots@z@veclength}{%
+ \def\pgfmathresult{infty}%
+ % this case will be caught in \pgfplots@initsizes
+ }{%
+ \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
+ }%
+ \let\pgfplots@z@inverseveclength=\pgfmathresult
+ \else
+ \def\pgfplots@z@veclength{0}%
+ \def\pgfplots@z@inverseveclength{infty}%
+ \fi
+}%
+
+% Defines \pgfplots@view@dir@threedim according to the actual
+% configuration of x,y,z (2d) unit vectors, assuming the associated
+% unit vectors form a right-handed-system.
+%
+% The algorithm works for standard three dimensional axes. It works as
+% follows:
+%
+% First, observe that we have a normal direction N if all its
+% multiples are mapped onto the same point in 2D canvas
+% coordinates. In other words: all 3D coordinates which are mapped
+% onto an arbitrary point in 2D canvas coordinates (take, for example,
+% the origin (0,0) ) are on a line in direction of N.
+%
+% We use this observation to compute the normal axis, i.e. we search
+% for all points which are mapped onto the 2D canvas coordinate (0,0):
+% N_x e_xx + N_y e_yx + N_z e_zx = 0
+% N_x e_xy + N_y e_yy + N_z e_zy = 0.
+% All solutions make up a linear space of dimension 1 (up to special
+% cases). In the general case, we can chose an arbitrary N_z != 0
+% and reduce the linear system to
+% N_x e_xx + N_y e_yx = - N_z e_zx
+% N_x e_xy + N_y e_yy = - N_z e_zy.
+% Choosing *any* N_z != 0, say, N_z=-1 (which corresponds to view
+% from above) will lead to a vector parallel to the normal direction.
+% But it might have the wrong sign.
+%
+% FIXME : this fails if one of e_x or e_y is zero.
+%
+% To find the correct sign for N, I have made several case
+% distinctions to identify the cases when we have to multiply with -1.
+% The key idea is to assume a right-handed-system of unit vectors;
+% this is the condition which allows to determine the sign.
+%
+% Furthermore, I assume that e_z points to the top, i.e. that e_zy >0.
+% Then, there are (mainly) four conditions on the signs of e_x and e_y
+% which indicate that we are viewing from below and should switch the
+% sign of N (keep in mind that our initial choice was N_z =-1, see above).
+%
+% The conditions can be identified by drawing a 3D box and
+% identifying the corner which represents the lower left 3D limits.
+%
+% You can visualize these cases using
+%--------------------------------------------------
+% \pgfplotsset{
+% separate axis lines,
+% every outer x axis line/.append style= {-stealth},
+% every outer y axis line/.append style= {-stealth},
+% every outer z axis line/.append style= {-stealth},
+% samples=2,shader=interp,title={view=\h,\v},
+% domain=0:1,
+% enlargelimits=false,
+% view=\h\v,xlabel=x,ylabel=y,
+% extra description/.code={%
+% \node[draw,fill=white] at (axis cs:0,0,0) {};
+% },
+% }
+%
+% \def\v{30}
+% \foreach \h in {30,120,210,300} {
+% \message{VIEW={\h}{\v}^^J}
+% \begin{tikzpicture}
+% \begin{axis}
+% \addplot3[surf] {x};
+% \end{axis}
+% \end{tikzpicture}
+%
+% }
+%
+% \def\v{-30}
+% \foreach \h in {30,120,210,300} {
+% \message{VIEW={\h}{\v}^^J}
+% \begin{tikzpicture}
+% \begin{axis}
+% \addplot3[surf] {x};
+% \end{axis}
+% \end{tikzpicture}
+%
+% }
+%--------------------------------------------------
+% The precise formulas can be found below in the source code.
+%
+% You can override this function by the /pgfplots/view dir key.
+\def\pgfplotsgetnormalforcurrentview{%
+ \pgfkeysgetvalue{/pgfplots/view dir}\pgfplots@loc@TMPc
+ \ifx\pgfplots@loc@TMPc\pgfutil@empty
+ \begingroup
+ % temporarily undo the effects of reversed axes -- we *really*
+ % need a right-handed-coordinate system here:
+ \if r\pgfkeysvalueof{/pgfplots/x dir/value}%
+ \pgf@xx=-\pgf@xx
+ \pgf@xy=-\pgf@xy
+ \fi
+ \if r\pgfkeysvalueof{/pgfplots/y dir/value}%
+ \pgf@yx=-\pgf@yx
+ \pgf@yy=-\pgf@yy
+ \fi
+ \if r\pgfkeysvalueof{/pgfplots/z dir/value}%
+ \pgf@zx=-\pgf@zx
+ \pgf@zy=-\pgf@zy
+ \fi
+ % FIRST: check for special cases.
+ \let\pgfplots@view@dir@threedim=\pgfutil@empty%
+ % Special case:
+ % e_xx = e_xy = 0
+ %
+ % i.e.:
+ %
+ % ^
+ % | |---|
+ % z | |
+ % |---|
+ % y->
+ %
+ % In this case, N must be the x axis.
+ \ifdim\pgf@xx=0pt %
+ \ifdim\pgf@xy=0pt %
+ \def\pgfplots@view@dir@threedim{-1,0,0}%
+ \fi
+ \fi
+ % Special case:
+ % e_yx = e_yy = 0
+ %
+ % i.e.:
+ %
+ % ^
+ % | |---|
+ % z | |
+ % |---|
+ % x->
+ %
+ % In this case, N must be the y axis.
+ \ifdim\pgf@yx=0pt %
+ \ifdim\pgf@yy=0pt %
+ \def\pgfplots@view@dir@threedim{0,1,0}%
+ \fi
+ \fi
+ % Special case:
+ % e_xy = e_yy = 0 (i.e. one row)
+ %
+ % that is hard to draw, use view={30}{0} to see it.
+ %
+ % In this case, N_z must be 0 and we have a different system.
+ \ifdim\pgf@xy=0pt %
+ \ifdim\pgf@yy=0pt %
+ \ifx\pgfplots@view@dir@threedim\pgfutil@empty
+ % we have N_x e_xx + N_y e_yx = 0
+ % Note that e_xx != 0 and e_yx != 0 (otherwise one
+ % of our other special cases above would have
+ % caught the case)
+ % -> we have N_x = -N_y e_yx / e_xx and N_y
+ % arbitrary. only the sign needs to be fixed.
+ \def\pgfplots@view@dir@threedim@z{0}%
+ \def\pgfplots@view@dir@threedim@y{1}% fix it somehow. We correct the sign later.
+ \edef\pgfplots@loc@TMPa{-(\pgfplots@view@dir@threedim@y) * \pgf@sys@tonumber\pgf@yx / (\pgf@sys@tonumber\pgf@xx)}%
+ \pgfmathparse{\pgfplots@loc@TMPa}%
+ \let\pgfplots@view@dir@threedim@x=\pgfmathresult
+ %
+ \def\pgfplots@scale{1}%
+ % I identified these cases by comparing the
+ % results with \pgfplots@scale{1} with those of
+ % the view dir generated by
+ % \pgfplotssetaxesfromazel (which has the correct quality of solution)
+ \ifdim\pgf@zy>0pt %
+ \ifdim\pgf@xx<0pt %
+ \def\pgfplots@scale{-1}%
+ \fi
+ \else
+ \ifdim\pgf@xx>0pt %
+ \def\pgfplots@scale{-1}%
+ \fi
+ \fi
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@x}%
+ \let\pgfplots@view@dir@threedim@x\pgfmathresult
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@y}%
+ \let\pgfplots@view@dir@threedim@y\pgfmathresult
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@z}%
+ \let\pgfplots@view@dir@threedim@z\pgfmathresult
+ %
+ \edef\pgfplots@view@dir@threedim{\pgfplots@view@dir@threedim@x,\pgfplots@view@dir@threedim@y,\pgfplots@view@dir@threedim@z}%
+ \else
+ % Ah - we already caught that special case above.
+ \fi
+ \fi
+ \fi
+ %
+ % NOTE : the case e_xx = e_yx = 0 IS NO USE-CASE (would
+ % require a rotated z axis which is forbidden currently)
+ %
+ \ifx\pgfplots@view@dir@threedim\pgfutil@empty
+ \def\pgfplots@view@dir@threedim@z{-1}% hold it at some arbitrary value
+ \pgf@xa=-\pgfplots@view@dir@threedim@z\pgf@zx
+ \pgf@ya=-\pgfplots@view@dir@threedim@z\pgf@zy
+ \edef\pgfplots@loc@TMPa{%
+ {%
+ {\pgf@sys@tonumber\pgf@xx}{\pgf@sys@tonumber\pgf@yx}%
+ {\pgf@sys@tonumber\pgf@xy}{\pgf@sys@tonumber\pgf@yy}%
+ }%
+ {%
+ {\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@ya}%
+ }%
+ }%
+ \expandafter\pgfutilsolvetwotwoleq\pgfplots@loc@TMPa
+ \def\pgfplots@loc@TMPb##1##2{%
+ \def\pgfplots@view@dir@threedim@x{##1}%
+ \def\pgfplots@view@dir@threedim@y{##2}%
+ }%
+ \expandafter\pgfplots@loc@TMPb\pgfmathresult
+ %
+ % Identify if we need to switch the sign.
+ % To verify that these cases are useful, I suggest visualizing
+ % that stuff using the TeX code from above...
+ %
+ % I guess it is correct up to collapsing views (as you see, I
+ % did not properly identify the cases with "=0" )
+ \def\pgfplots@scale{1}%
+ \ifdim\pgf@xx>0pt
+ \ifdim\pgf@yx<0pt
+ \else
+ %
+ \ifdim\pgf@xy<0pt
+ \else
+ \ifdim\pgf@yy<0pt
+ \def\pgfplots@scale{-1}%
+ \fi
+ \fi
+ %
+ \fi
+ \else
+ \ifdim\pgf@xx<0pt
+ \ifdim\pgf@yx>0pt
+ \else
+ %
+ \ifdim\pgf@xy>0pt
+ \else
+ \ifdim\pgf@yy>0pt
+ \def\pgfplots@scale{-1}%
+ \fi
+ \fi
+ %
+ \fi
+ \fi
+ \fi
+ \ifdim\pgf@xy>0pt
+ \ifdim\pgf@yy<0pt
+ \else
+ %
+ \ifdim\pgf@xx>0pt
+ \else
+ \ifdim\pgf@yx>0pt
+ \def\pgfplots@scale{-1}%
+ \fi
+ \fi
+ %
+ \fi
+ \else
+ \ifdim\pgf@xy<0pt
+ \ifdim\pgf@yy>0pt
+ \else
+ %
+ \ifdim\pgf@xx<0pt
+ \else
+ \ifdim\pgf@yx<0pt
+ \def\pgfplots@scale{-1}%
+ \fi
+ \fi
+ %
+ \fi
+ \fi
+ \fi
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@x}%
+ \let\pgfplots@view@dir@threedim@x\pgfmathresult
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@y}%
+ \let\pgfplots@view@dir@threedim@y\pgfmathresult
+ \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@z}%
+ \let\pgfplots@view@dir@threedim@z\pgfmathresult
+ %
+ \pgfplotsmathvectorfromstring{\pgfplots@view@dir@threedim@x,\pgfplots@view@dir@threedim@y,\pgfplots@view@dir@threedim@z}{default}%
+ \let\pgfplots@view@dir@threedim=\pgfplotsretval
+ % normalize. This is not absolutely required -- but it is used
+ % to accumulate point depth (for the mesh handler) in pgfmath
+ % arithmetics. At least \pgfplotsmathviewdepthxyz should use
+ % a properly scaled view dir.
+ \pgfplotsmathvectorlength{\pgfplotsretval}{default}%
+ \pgfplotscoordmath{default}{op}{reciprocal}{{\pgfplotsretval}}%
+ \pgfplotsmathvectorscale{\pgfplots@view@dir@threedim}{\pgfmathresult}{default}%
+ \else
+ \pgfplotsmathvectorfromstring{\pgfplots@view@dir@threedim}{default}%
+ \fi
+ %
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+ \let\pgfplots@view@dir@threedim=\pgfplotsretval
+ \else
+ \def\pgfplots@loc@TMPb##1##2##3{%
+ \pgfplotsmathvectorfromstring{##1,##2,##3}{default}%
+ \let\pgfplots@view@dir@threedim=\pgfplotsretval
+ }%
+ \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPc
+ \fi
+%\message{\string\pgfplotsgetnormalforcurrentview: got (\pgfplots@view@dir@threedim)^^J}%
+}%
+
+% PRECONDITION:
+% none
+% POSTCONDITION:
+% \pgfplots@default@aspect@ratio is set.
+\def\pgfplots@compute@default@aspect@ratio{%
+ \expandafter\pgfmath@x\axisdefaultwidth
+ \expandafter\pgfmath@y\axisdefaultheight
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber{\pgfmath@x}}%
+ {\pgf@sys@tonumber{\pgfmath@y}}%
+ }%
+ \let\pgfplots@default@aspect@ratio=\pgfmathresult
+}
+
+\def\pgfplots@ifneeds@one@uniform@datascale#1#2{%
+ \if3\pgfplots@scale@mode@choice
+ % scale mode=scale uniformly
+ \def\pgfplots@loc@TMPa{1}%
+ %
+ % if we have at least one unit vector given explicitly, the
+ % meaning changes: in that case, we can (and probably should)
+ % use different data scale factors in each direction.
+ \ifx\pgfplots@x\pgfutil@empty
+ \else
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \ifx\pgfplots@y\pgfutil@empty
+ \else
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \ifx\pgfplots@z\pgfutil@empty
+ \else
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \else
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \if1\pgfplots@loc@TMPa
+ #1%
+ \else
+ #2%
+ \fi
+}%
+
+\def\pgfplots@set@default@size@options{%
+ % The axes 'x' and 'y' vectors will be scaled such that the total
+ % size is (\axisdefaultwidth, \axisdefaultheight).
+ %
+ % If the user specifies ONE of width OR height,
+ % the plot will be resized; keeping the aspect ratio.
+ %
+ \let\pgfplots@default@aspect@ratio=\pgfutil@empty
+ \pgfkeysgetvalue{/pgfplots/x}{\pgfplots@x}%
+ \pgfkeysgetvalue{/pgfplots/y}{\pgfplots@y}%
+ \pgfkeysgetvalue{/pgfplots/z}{\pgfplots@z}%
+ %\pgfkeysgetvalue{/pgfplots/viewdir}{\pgfplots@viewdir}%
+ \pgfkeysgetvalue{/pgfplots/width}{\pgfplots@width}%
+ \pgfkeysgetvalue{/pgfplots/height}{\pgfplots@height}%
+ \ifx\pgfplots@width\pgfutil@empty
+ \def\pgfplots@user@provided@width{0}%
+ \else
+ \def\pgfplots@user@provided@width{1}%
+ \pgfmathparse{\pgfplots@width}%
+ \edef\pgfplots@width{\pgfmathresult pt}%
+ \fi
+ \ifx\pgfplots@height\pgfutil@empty
+ \def\pgfplots@user@provided@height{0}%
+ \else
+ \def\pgfplots@user@provided@height{1}%
+ \pgfmathparse{\pgfplots@height}%
+ \edef\pgfplots@height{\pgfmathresult pt}%
+ \fi
+ %
+ % CASES:
+ % W := 'width' option non-empty
+ % H := 'height' option non-empty
+ %
+ % W H
+ % 0 0 -> \axisdefaultwidth
+ % 0 1 -> determine width out of H and the default aspect ratio
+ % 1 X -> ok, use the user parameter.
+ % -> KEEP ASPECT RATIO if just one W, or H is given!
+ \ifx\pgfplots@width\pgfutil@empty
+ \ifx\pgfplots@height\pgfutil@empty
+ % The case W=0 H=0:
+ \let\pgfplots@width=\axisdefaultwidth
+ \let\pgfplots@height=\axisdefaultheight
+ \else
+ % The case W=0 H=1:
+ \pgfplots@compute@default@aspect@ratio
+ \expandafter\pgfmath@y\pgfplots@height
+ \pgfmathlog@invoke@expanded\pgfmathmultiply@{%
+ {\pgf@sys@tonumber{\pgfmath@y}}%
+ {\pgfplots@default@aspect@ratio}%
+ }%
+ \edef\pgfplots@width{\pgfmathresult pt}%
+ \fi
+ \else
+ \ifx\pgfplots@height\pgfutil@empty
+ % The case W=1 H=0:
+ \pgfplots@compute@default@aspect@ratio
+ \expandafter\pgfmath@x\pgfplots@width
+ \pgfmathlog@invoke@expanded\pgfmathdivide@{%
+ {\pgf@sys@tonumber{\pgfmath@x}}%
+ {\pgfplots@default@aspect@ratio}%
+ }%
+ \edef\pgfplots@height{\pgfmathresult pt}%
+ \else
+ % The case W=1 H=1:
+ \fi
+ \fi
+ \pgfkeyslet{/pgfplots/width}{\pgfplots@width}%
+ \pgfkeyslet{/pgfplots/height}{\pgfplots@height}%
+ %
+ \ifpgfplots@threedim
+ \pgfplots@set@default@size@options@threedim
+ \fi
+ %
+ \pgfplots@set@scale@mode
+}
+
+% This method must be called BEFORE THE DATASCALING is initialized.
+\def\pgfplots@set@scale@mode{%
+ \pgfkeysgetvalue{/pgfplots/unit vector ratio}\pgfplots@loc@TMPb
+ \ifx\pgfplots@loc@TMPb\pgfutil@empty
+ \else
+ \ifcase\pgfplots@scale@mode@choice
+ % 'scale mode'=auto
+ \def\pgfplots@scale@mode@choice{3}% set to 'scale uniformly'
+ %
+ \if1\pgfplots@compat@scale@mode@compatible@mode
+ % backwards compatibility mode...
+ \ifpgfplots@threedim
+ % ... for 3d: there is no backwards compatibility
+ % mode here; it was plain wrong for 3d axes:
+ % neither lengths nor angles have been correct.
+ \pgfplots@compat@scale@mode@compatible@mode@warning
+ \fi
+ \fi
+ \or
+ % scale mode=none: keep it this way.
+ \immediate\write-1{PGFPlots: scale mode=none and unit vector ratio is incompatible. Ignoring unit vector ratio.^^J}%
+ \or
+ % scale mode=stretch to fill
+ \immediate\write-1{PGFPlots: scale mode=stretch to fill and unit vector ratio might produce unexpected results. Consider using scale mode=auto^^J}%
+ \fi
+ \fi
+ %
+}
+
+\def\pgfplots@compat@scale@mode@compatible@mode@warning{%
+ \pgfplots@warning{The content of your 3d axis has CHANGED compared to previous versions of pgfplots. Please review it. ^^J %
+ [continued] Explanation: you have a 3d axis with 'axis equal' and/or 'unit vector ratio' which has (probably) been optimized for an older version of pgfplots. Any version older than 1.6 produced wrong output.^^J %
+ [continued] To remove this warning, write \string\pgfplotsset{compat=1.6} (or newer) in your preamble (may change all figures in your document) or by adding that to the affected axis.}%
+}%
+
+\def\pgfplots@set@default@size@options@threedim{%
+ \pgfplots@loc@tmpfalse
+ \ifx\pgfplots@x\pgfutil@empty
+ \else
+ \pgfplots@loc@tmptrue
+ \fi
+ \ifx\pgfplots@y\pgfutil@empty
+ \else
+ \pgfplots@loc@tmptrue
+ \fi
+ \ifx\pgfplots@z\pgfutil@empty
+ \else
+ \pgfplots@loc@tmptrue
+ \fi
+ \ifpgfplots@loc@tmp
+ % oh - we have at least one of the [xyz] unit vectors!
+ % make sure all of them are there
+ \ifx\pgfplots@x\pgfutil@empty
+ \pgfplots@set@default@size@options@threedim@{x}{(1pt,0pt)}%
+ \fi
+ \ifx\pgfplots@y\pgfutil@empty
+ \pgfplots@set@default@size@options@threedim@{y}{(0pt,1pt)}%
+ \fi
+ \ifx\pgfplots@z\pgfutil@empty
+ \pgfplots@set@default@size@options@threedim@{z}{(0pt,1pt)}%
+ \fi
+ \pgfkeyslet{/pgfplots/view/az}\pgfutil@empty
+ \pgfkeyslet{/pgfplots/view/el}\pgfutil@empty
+ \fi
+}
+\def\pgfplots@set@default@size@options@threedim@#1#2{%
+ \pgfplots@error{Sorry, a 3D axis needs either NONE or ALL of "x,y,z". I found partial information, but (at least) '#1' is lacking... please add '#1'}%
+ \expandafter\def\csname pgfplots@#1\endcsname{#2}%
+}
+
+% A helper method for \pgfplots@initsizes which
+% - applies the data scaling trafo to user arguments
+% - sets calls pgfset#1vec
+%
+% #1: the vector to set (either 'x' or 'y')
+% #2: the index of the vector to set (either 0 or 1)
+% #3: the already precomputed temporary scale (see pgfplots@initsizes)
+% #4: an output argument. It is a macro name which will be defined to
+% '1' if and only if the finally set vector is parallel to the #1 axis
+% of PGF, that means (x,0) for #1=x and (0,y) for #2=y.
+\def\pgfplots@initsizes@setunitvector#1#2#3#4{%
+ \pgfkeysgetvalue{/pgfplots/#1 dir/value}\pgfplots@loc@dirvalue
+ \expandafter\let\expandafter\pgfplots@loc@TMPb\csname pgfplots@#1\endcsname
+ \ifx\pgfplots@loc@TMPb\pgfutil@empty
+ \def#4{1}% we have (#1,0) or (0,#1)
+ %
+%\message{Setting unitvector(#1) to auto-computed multiple of e_#2 ...}%
+ \edef\pgfplots@loc@TMPa{#3}%
+ \if r\pgfplots@loc@dirvalue
+ \edef\pgfplots@loc@TMPa{-#3}%
+ \fi
+ \ifcase#2\relax
+ \pgfsetxvec{\pgfqpoint{\pgfplots@loc@TMPa pt}{0pt}}%
+ \or
+ \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@loc@TMPa pt}}%
+ \or
+ \pgfsetzvec{\pgfqpoint{\pgfplots@loc@TMPa pt}{\pgfplots@loc@TMPa pt}}%
+ \fi
+ \else
+ % Ok, we have a user-defined unit vector.
+ %
+ % That means we also need to apply the scaling trafo!
+ %
+ % 1. Check whether we have a complete vector of type (x,y):
+ \expandafter\pgfutil@in@\expandafter(\expandafter{\pgfplots@loc@TMPb}%
+ \ifpgfutil@in@
+ % YES: we have (x,y):
+ %
+ \def#4{0}% we DON'T have (#1,0) or (0,#1). At least I think so.
+ %
+%\message{Setting unitvector(#1) to non-standard \csname pgfplots@#1\endcsname ...}%
+ \def\pgfplots@loc@TMPa(##1,##2){%
+ \pgfplotscoordmath{default}{parse}{##1}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ \let\pgfplots@loc@TMPb=\pgfmathresult
+ \pgfplotscoordmath{default}{parse}{##2}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ \let\pgfplots@loc@TMPc=\pgfmathresult
+ %
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfplots@loc@TMPb}%
+ \let\pgfplots@loc@TMPb=\pgfmathresult
+ \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfplots@loc@TMPc}%
+ \let\pgfplots@loc@TMPc=\pgfmathresult
+ }{}%
+ \csname pgfset#1vec\endcsname{%
+ \pgfqpoint
+ {\if r\pgfplots@loc@dirvalue -\fi\pgfplots@loc@TMPb pt}
+ {\if r\pgfplots@loc@dirvalue -\fi\pgfplots@loc@TMPc pt}}%
+ }%
+ \expandafter\pgfplots@loc@TMPa\pgfplots@loc@TMPb%
+ %
+ \else
+ % NO we simply have a scalar value.
+ \def#4{1}% we have (#1,0) or (0,#1)
+%\message{Setting unitvector(#1) to \csname pgfplots@#1\endcsname * e_{#2}...}%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ \pgfplotscoordmath{default}{parse}{\csname pgfplots@#1\endcsname}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+ \pgfplotscoordmath{#1}{datascaletrafo noshift inverse to fixed}{\pgfmathresult}%
+ \edef\pgfplots@loc@TMPb{\pgfmathresult pt}%
+ }{\relax}%
+ \edef\pgfplots@loc@TMPb{\if r\pgfplots@loc@dirvalue -\fi\pgfplots@loc@TMPb}%
+ \begingroup
+ \pgf@xa=\pgfplots@loc@TMPb\relax
+ \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
+ \endgroup
+ \ifcase#2\relax
+ \pgfsetxvec{\pgfqpoint{\pgfplots@loc@TMPb}{0pt}}%
+ \or
+ \pgfsetyvec{\pgfqpoint{0pt}{\pgfplots@loc@TMPb}}%
+ \or
+ \pgfsetzvec{\pgfqpoint{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPb}}%
+ \fi
+ \fi
+ \fi
+%\message{-> got unitvector(#1) = (\the\csname pgf@#1x\endcsname, \the\csname pgf@#1y\endcsname).^^J}%
+}%
+
+% Applies the 'axis equal' feature.
+%
+% PRECONDITION:
+% - #1, #2, #3 contains the current scaling
+% factors in x,y, z, resp. which are to be applied to unit vectors
+% - neither unit vectors nor limits are in their final shape
+% - \pgfplots@set@default@size@options has been invoked before
+%
+% POSTCONDITION:
+% - #1, #2, #3 have been changed to accomodate unit vector ratio
+% - #4, #5, #6 [output] contain axis limit compensation scales
+%
+% There is just one algorithmic difficulty: the data scaling
+% transformation. All unit vector length above are only meaningful in
+% the UNTRANSFORMED range, so we have to mingle with the scaling
+% transformation.
+\def\pgfplots@apply@unit@ratio#1#2#3#4#5#6{%
+ \begingroup
+ \edef\pgfplots@target@unit@scale@inv@x{#1}%
+ \edef\pgfplots@target@unit@scale@inv@y{#2}%
+ \edef\pgfplots@target@unit@scale@inv@z{#3}%
+ \def\pgfplots@target@limitrescale@x@{1}%
+ \def\pgfplots@target@limitrescale@y@{1}%
+ \def\pgfplots@target@limitrescale@z@{1}%
+ %
+ \pgfkeysgetvalue{/pgfplots/unit vector ratio}\pgfplots@unit@vector@ratio
+ \ifx\pgfplots@unit@vector@ratio\pgfutil@empty
+ \else
+ \edef\pgfplots@unit@vector@ratio{\pgfplots@unit@vector@ratio\space1 1 }%
+ %
+ \expandafter\pgfplots@unit@vector@ratio@check@nop\pgfplots@unit@vector@ratio\pgfplots@EOI
+ \ifpgfplots@loc@tmp
+ %
+ % Step 1: compute the unit vector which STAYS CONSTANT.
+ %
+ \pgfkeysgetvalue{/pgfplots/unit vector ratio axis}\pgfplots@apply@unit@ratio@reference
+ \ifx\pgfplots@apply@unit@ratio@reference\pgfutil@empty
+ \pgfplots@apply@unit@ratio@find@reference%
+ \fi
+ %
+ % FIXME : I could spent some attention here to save work:
+ % both, unit ratios and the resulting scales are computed at
+ % least twice (once in \pgfplots@apply@unit@ratio@find@reference and once in the
+ % following).
+ \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
+ %
+%\message{USING REFERENCE UNIT VECTOR FROM \pgfplots@apply@unit@ratio@reference; ratio \pgfplots@unit@ratio@x\space \pgfplots@unit@ratio@y\space \pgfplots@unit@ratio@z.^^J}%
+ %
+ % Step 2: apply the scaling:
+ \pgfplots@rescale@unit@vector@reltoreference{x}{\pgfplots@unit@ratio@x}%
+ \pgfplots@rescale@unit@vector@reltoreference{y}{\pgfplots@unit@ratio@y}%
+ \ifpgfplots@threedim
+ \pgfplots@rescale@unit@vector@reltoreference{z}{\pgfplots@unit@ratio@z}%
+ \fi
+ %
+ \else
+%\message{Skipped application of 'unit vector ratio=\pgfkeysvalueof{/pgfplots/unit vector ratio}': it is already done by 'scale uniformly'.^^J}%
+ \fi
+ \fi
+ \xdef\pgfplots@glob@TMPa{%
+ \noexpand\def\noexpand#1{\pgfplots@target@unit@scale@inv@x}%
+ \noexpand\def\noexpand#2{\pgfplots@target@unit@scale@inv@y}%
+ \noexpand\def\noexpand#3{\pgfplots@target@unit@scale@inv@z}%
+ \noexpand\def\noexpand#4{\pgfplots@target@limitrescale@x@}%
+ \noexpand\def\noexpand#5{\pgfplots@target@limitrescale@y@}%
+ \noexpand\def\noexpand#6{\pgfplots@target@limitrescale@z@}%
+ }%
+ \endgroup
+ \pgfplots@glob@TMPa
+}%
+
+\def\pgfplots@appy@unit@ratio@reciprocal#1{%
+ \pgfplotscoordmath{default}{parsenumber}{#1}%
+ \pgfplotscoordmath{default}{op}{reciprocal}{{\pgfmathresult}}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfmathresult}%
+}%
+
+% Defines \ifpgfplots@loc@tmp := need to modify scaling factors
+\def\pgfplots@unit@vector@ratio@check@nop#1 #2 #3 #4\pgfplots@EOI{%
+ \pgfplots@loc@tmptrue
+ \if3\pgfplots@scale@mode@choice
+ % scale mode=scale uniformly
+ \ifpgfplots@threedim
+ \ifdim#1pt=#2pt
+ \ifdim#1pt=#3pt
+ % 'axis equal' is implicitly done by 'scale mode=scale
+ % uniformly' anyway
+ \pgfplots@loc@tmpfalse
+ \fi
+ \fi
+ \else
+ \ifdim#1pt=#2pt
+ % 'axis equal' is implicitly done by 'scale mode=scale
+ % uniformly' anyway
+ \pgfplots@loc@tmpfalse
+ \fi
+ \fi
+ \fi
+ % activate the following line to deactivate optimization: [FIXME]
+ %\pgfplots@loc@tmpfalse
+}%
+
+% This macro determines the reference axis for unit vector rescaling.
+% The reference axis remains unscaled (it gets scaling factor 1 if you
+% want it this way).
+%
+% The other axes are scaled such that the desired unit vector ratios
+% are fulfilled.
+%
+% The idea to select a reference axis is as follows:
+% 1. Every unit vector scaling factor s should fulfill s <= 1.
+% 2. Choose the reference axis such that the minimal amount of scaling
+% is performed.
+%
+% The motivation for (1) is: if all involved scaling factors are at
+% most 1, the resulting picture will only become *smaller*.
+% Consequently, we can simply enlarge axis limits to restore the
+% original width/height!
+%
+% The motivation for (2) is: a huge amount of scaling might reduce the
+% size of the image too much. Of course, the figure will be enlarged
+% to fit the original width/height, but most of it will be empty. So,
+% use the smallest scaling.
+%
+% @POSTCONDITION The reference axis is stored in
+% \pgfplots@apply@unit@ratio@reference .
+%
+% @see the key 'unit vector ratio axis=y' which allows to manually
+% select the reference axis. This will illustrate what happens here.
+\def\pgfplots@apply@unit@ratio@find@reference{%
+ %
+ \begingroup
+ \let\pgfplots@ONE=\pgf@x
+ \global\pgfplots@ONE=1.002pt
+ %
+ \def\pgfplots@optimum@sofar@axis{}%
+ \let\pgfplots@optimum@sofar@value=\pgf@y
+ \global\pgfplots@optimum@sofar@value=16000pt
+ %
+ %\pgfplots@apply@unit@ratio@find@reference@checkexplicitlimits
+ %
+ \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty
+ % set \pgfplots@loc@TMPa := 1 if and only if the axis is 3d
+ \def\pgfplots@loc@TMPa{0}%
+ \if0\b@pgfplots@unitvec@is@zero@z
+ % ah, it IS 3d!
+ \def\pgfplots@loc@TMPa{1}%
+ \else
+ % ok, 2d mode (includes view={0}{90})
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \if1\pgfplots@loc@TMPa
+ % 3D is more complicated than 2D:
+ % for every fixed reference axis, we have to check *two*
+ % scaling factors.
+ %
+ % Furthermore, the optimality condition (2) needs to be
+ % performed on the maximum max{1-s_a, 1-s_b} provided both of
+ % these numbers are positive.
+ %
+ \def\pgfplots@check@##1##2{%
+ % PRECONDITION: \pgfplots@apply@unit@ratio@reference is defined.
+ %
+ % renormalize \pgfplots@unit@[xyz] :
+ \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
+ %
+ % compute s_a :
+ \pgfplots@getscale@unit@vector@reltoreference ##1{\csname pgfplots@unit@ratio@##1\endcsname}%
+ \let\pgfplots@scale@a=\pgfmathresult
+ %
+ % compute s_b :
+ \pgfplots@getscale@unit@vector@reltoreference ##2{\csname pgfplots@unit@ratio@##2\endcsname}%
+ \let\pgfplots@scale@b=\pgfmathresult
+ %
+ % check if the actual choice of
+ % \pgfplots@apply@unit@ratio@reference is FEASIBLE.
+ % That is the case if s_a <= 1 && s_b <= 1.
+ % We check
+ % (1 - s_a >= 0 ) && ( 1 - s_b >= 0 )
+ % instead, since I need the value
+ % max( 1-s_a, 1-s_b )
+ % anyway.
+ \def\pgfplots@ref@is@feasible{1}%
+ \pgf@xa=\pgfplots@ONE \advance\pgf@xa by-\pgfplots@scale@a pt
+ \ifdim\pgf@xa<0sp
+ \def\pgfplots@ref@is@feasible{0}%
+ \else
+ \pgf@xb=\pgfplots@ONE \advance\pgf@xb by-\pgfplots@scale@b pt
+ \ifdim\pgf@xb<0sp
+ \def\pgfplots@ref@is@feasible{0}%
+ \fi
+ \fi
+ % compute max(1-s_a,1-s_b) into \pgf@xa:
+ % pgf@xa= max(pgf@xa,pgf@xb):
+ \ifdim\pgf@xb>\pgf@xa \pgf@xa=\pgf@xb \fi
+ \if1\pgfplots@ref@is@feasible
+ \ifdim\pgf@xa<\pgfplots@optimum@sofar@value
+ % Ah, ok. The actual choice is BETTER as it
+ % involves less scaling.
+ %
+ % Remember it!
+ \let\pgfplots@optimum@sofar@axis=\pgfplots@apply@unit@ratio@reference
+ \global\pgfplots@optimum@sofar@value=\pgf@xa
+ \fi
+ \fi
+%\message{^^Junit vector ratio 3D searching reference: checking \pgfplots@apply@unit@ratio@reference. feasable=\pgfplots@ref@is@feasible. \if1\pgfplots@ref@is@feasible max=\the\pgf@xa. \fi Optimum so far: value =\the\pgfplots@optimum@sofar@value\space for axis \pgfplots@optimum@sofar@axis.^^J}%
+ }%
+ %
+ % Check 'x' as reference :
+ \def\pgfplots@apply@unit@ratio@reference{x}%
+ \pgfplots@check@ yz%
+ %
+ % Check 'y' as reference :
+ \def\pgfplots@apply@unit@ratio@reference{y}%
+ \pgfplots@check@ xz%
+ %
+ % Check 'z' as reference :
+ \def\pgfplots@apply@unit@ratio@reference{z}%
+ \pgfplots@check@ xy%
+ %
+ \else
+ % 2D is much simpler: find the scale s which fulfills s <= 1.
+ % One of them MUST fulfill it.
+ %
+ % try 'x' axis as reference:
+ \def\pgfplots@apply@unit@ratio@reference{x}%
+ %
+ % renormalize:
+ \expandafter\pgfplots@apply@unit@ratio@prepareratios\pgfplots@unit@vector@ratio\pgfplots@EOI
+ %
+ % compute scaling factor:
+ \pgfplots@getscale@unit@vector@reltoreference y\pgfplots@unit@ratio@y%
+ %
+%\message{^^Junit vector ratio 2D searching reference: checking \pgfplots@apply@unit@ratio@reference. feasable=\pgfmathresult < 1: \ifdim\pgfmathresult pt <\pgfplots@ONE YES-> use x\else NO->use y\fi^^J}%
+ % and check (1). The condition (2) is irrelevant; it is met
+ % anyway.
+ \ifdim\pgfmathresult pt<\pgfplots@ONE
+ \def\pgfplots@optimum@sofar@axis{x}%
+ \else
+ \def\pgfplots@optimum@sofar@axis{y}%
+ \fi
+ \fi
+ \else
+%\message{^^Junit vector ratio chose \pgfplots@optimum@sofar@axis\space to fulfill explicitly provided limits (at least partially).^^J}%
+ \fi
+ %
+ \ifx\pgfplots@optimum@sofar@axis\pgfutil@empty
+ \if1\b@pgfplots@unitvec@is@zero@z
+ \def\pgfplots@optimum@sofar@axis{y}%
+ \else
+ \def\pgfplots@optimum@sofar@axis{z}%
+ \fi
+ \pgfplots@warning{The algorithm to implement 'unit vector ratio' failed! It could not determine the axis which shall be scaled and decided to use 'unit vector ratio axis=\pgfplots@optimum@sofar@axis'.}%
+ \fi
+ \let\pgfplots@apply@unit@ratio@reference=\pgfplots@optimum@sofar@axis
+ \pgfmath@smuggleone\pgfplots@apply@unit@ratio@reference
+ \endgroup
+}%
+\def\pgfplots@apply@unit@ratio@find@reference@checkexplicitlimits{%
+ \ifpgfplots@autocompute@ymax \else \def\pgfplots@optimum@sofar@axis{y}\fi
+ \ifpgfplots@autocompute@ymin \else \def\pgfplots@optimum@sofar@axis{y}\fi
+ \ifpgfplots@autocompute@xmax \else \def\pgfplots@optimum@sofar@axis{x}\fi
+ \ifpgfplots@autocompute@xmin \else \def\pgfplots@optimum@sofar@axis{x}\fi
+ \ifpgfplots@threedim
+ \ifpgfplots@autocompute@zmax \else \def\pgfplots@optimum@sofar@axis{z}\fi
+ \ifpgfplots@autocompute@zmin \else \def\pgfplots@optimum@sofar@axis{z}\fi
+ \fi
+}%
+
+% This is ONLY applied to the value of 'unit vector ratio'. It does
+% not touch the current axis scaling factors.
+\def\pgfplots@apply@unit@ratio@prepareratios#1 #2 #3 #4\pgfplots@EOI{%
+ \def\pgfplots@unit@ratio@x{#1}%
+ \def\pgfplots@unit@ratio@y{#2}%
+ \def\pgfplots@unit@ratio@z{#3}%
+ %
+ % 'unit vector ratio' is measured relative to the y axis for 2d
+ % and relative to the z axis for 3d plots.
+ % renormalize such that it is relative to
+ % \pgfplots@apply@unit@ratio@reference.
+ %
+ % Furthermore, renormalize such that
+ % unit@ratio@\pgfplots@apply@unit@ratio@reference is 1.
+ \pgfmathreciprocal@{\csname pgfplots@unit@ratio@\pgfplots@apply@unit@ratio@reference\endcsname}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \ifpgfplots@threedim
+ \if z\pgfplots@apply@unit@ratio@reference
+ \else
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@z}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \fi
+ %
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@x}%
+ \let\pgfplots@unit@ratio@x=\pgfmathresult
+ %
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
+ \let\pgfplots@unit@ratio@y=\pgfmathresult
+ %
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@z}%
+ \let\pgfplots@unit@ratio@z=\pgfmathresult
+ \else
+ \if y\pgfplots@apply@unit@ratio@reference
+ \else
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \fi
+ %
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@x}%
+ \let\pgfplots@unit@ratio@x=\pgfmathresult
+ %
+ \pgfmathmultiply@{\pgfplots@loc@TMPa}{\pgfplots@unit@ratio@y}%
+ \let\pgfplots@unit@ratio@y=\pgfmathresult
+ %
+ \def\pgfplots@unit@ratio@z{<unused>}%
+ \fi
+ %
+}%
+
+
+% Computes a new unit vector E_#1 for direction #1 such that
+% ||E_#1|| = #2 * ||e_reference||.
+% Here, #2 is a scaling factor and e_reference is a reference axis.
+% The reference axis is stored in
+% \pgfplots@apply@unit@ratio@reference, the macro contains one of
+% {x,y,z}.
+%
+% The data limits for '#1' will be enlarged as well (for 'unit rescale
+% keep size').
+%
+% #1 is the axis which should be scaled (i.e. #1 in {x,y,z}).
+% It is allowed if #1 = \pgfplots@apply@unit@ratio@reference. In this
+% case, you can provide a scale '#2' to rescale the axis.
+%
+% #2 is a desired scale, relative to
+% \pgfplots@apply@unit@ratio@reference. #2 should be a number without
+% unit.
+%
+% The parameter \pgfplots@apply@unit@ratio@reference is also one of
+% {x,y,z}.
+%
+\def\pgfplots@rescale@unit@vector@reltoreference#1#2{%
+ \def\pgfplots@loc@TMPa{0}%
+ \if#1\pgfplots@apply@unit@ratio@reference
+ \pgfplotsmath@ifapproxequal@dim{#2pt}{1pt}{0.0002pt}{%
+ }{%
+ \def\pgfplots@loc@TMPa{1}%
+ }%
+ \else
+ \def\pgfplots@loc@TMPa{1}%
+ \fi
+ \if1\csname b@pgfplots@unitvec@is@zero@#1\endcsname
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \if1\pgfplots@loc@TMPa
+ %
+ \pgfplots@getscale@unit@vector@reltoreference{#1}{#2}%
+ \global\let\pgfplots@glob@TMPa=\pgfmathresult
+ %
+%\message{Rescaling '#1' by \pgfplots@glob@TMPa.^^J}%
+ %
+ \pgfmathdivide@{\csname pgfplots@target@unit@scale@inv@#1\endcsname}{\pgfplots@glob@TMPa}%
+ \expandafter\let\csname pgfplots@target@unit@scale@inv@#1\endcsname=\pgfmathresult
+ %
+ \pgfmathreciprocal@\pgfplots@glob@TMPa
+ \expandafter\let\csname pgfplots@target@limitrescale@#1@\endcsname=\pgfmathresult
+ %
+ \fi
+}
+
+% Updates the #1 axis limits such that the axis' dimensions
+% stay the same after scaling the #1 unit vector by a scale 's'.
+%
+% PRECONDITION:
+% - the #1 unit vector has been rescaled by a factor s.
+% For example, e_xnew := e_x * 0.5 .
+%
+% POSTCONDITION:
+% - the axis limits are enlarged by a factor 1/s such that
+% 1/s (#1max - #1min) * e_xnew = (#1max- #1min) * e_x.
+%
+% In other words, the unit vector rescale is componensated by
+% modifying the axis limits: we want to add an absolute component 'd'
+% to the range:
+% 1/s (xmax - xmin ) = xmax - xmin +d
+% =>
+% d = (1/s - 1) * (xmax - xmin)
+%
+% The only remaining thing to do is to distribute 'd' to 'xmax' and
+% 'xmin'. Typically, 50% to each will be fine, I guess...
+%
+% #1: either x, y or z. It denotes the direction which has been
+% modified.
+% #2: the INVERSE of the scaling factor, #2 = 1/s .
+%
+\def\pgfplots@apply@unit@vector@rescale@keep@size#1#2{%
+ \ifdim#2pt=1pt
+ \else
+ \if0\pgfplots@unit@vector@rescale@keep@size
+ % unit rescale keep size=false : do nothing. Ignore the
+ % scaling request.
+ \else
+ % unit rescale keep size=true|unless limits declared
+ %
+%\message{'unit rescale keep size': Resizing data range for #1 by #2: from \csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname\ to}%
+ \pgfmathsubtract@{\csname pgfplots@#1max\endcsname}{\csname pgfplots@#1min\endcsname}%
+ \begingroup
+ \pgf@xa=\pgfmathresult pt
+ \pgfmathsubtract@{#2}{1.0}%
+ \pgf@xa=\pgfmathresult \pgf@xa% this is 'd'
+ %
+ % \pgfplots@glob@TMPb : will be subtracted from #1min
+ % \pgfplots@glob@TMPc : will be added to #1max
+ \pgfplots@if{pgfplots@autocompute@#1min}{%
+ \pgfplots@if{pgfplots@autocompute@#1max}{%
+ \pgf@xa=0.5 \pgf@xa
+ \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
+ \xdef\pgfplots@glob@TMPc{\pgfplots@glob@TMPb}%
+ }{%
+ \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
+ \xdef\pgfplots@glob@TMPc{0.0}%
+ }%
+ }{%
+ \pgfplots@if{pgfplots@autocompute@#1max}{%
+ \xdef\pgfplots@glob@TMPb{0.0}%
+ \xdef\pgfplots@glob@TMPc{\pgf@sys@tonumber{\pgf@xa}}%
+ }{%
+ \if1\pgfplots@unit@vector@rescale@keep@size
+ % unit rescale keep size=true : FORCE
+ % enlargement!
+ \pgf@xa=0.5 \pgf@xa
+ \xdef\pgfplots@glob@TMPb{\pgf@sys@tonumber{\pgf@xa}}%
+ \xdef\pgfplots@glob@TMPc{\pgfplots@glob@TMPb}%
+ \else
+ % unit rescale keep size=unless limits declared:
+ % do not scale - all limits are declared
+ % explicitly
+ \xdef\pgfplots@glob@TMPb{0.0}%
+ \xdef\pgfplots@glob@TMPc{0.0}%
+ \fi
+ }%
+ }%
+ \endgroup
+ \pgfmathsubtract@{\csname pgfplots@#1min\endcsname}{\pgfplots@glob@TMPb}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ \pgfmathadd@{\csname pgfplots@#1max\endcsname}{\pgfplots@glob@TMPc}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+%\message{\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname. [- \pgfplots@glob@TMPb; + \pgfplots@glob@TMPc]^^J}%
+ %
+ % Update auxiliary data members:
+ \pgfplots@visphase@notify@changeofcanvaslimits{#1}%
+ \fi
+ \fi
+}%
+
+% #1: an axis which should be scaled
+% #2: the desired final ratio ||e_#1||/||e_ref||
+\def\pgfplots@getscale@unit@vector@reltoreference#1#2{%
+ %
+ % If the datascaling transformation is active (which is almost
+ % everytime the case here), we have a transformation
+ % T^{-1}(x)= 10^scale * x
+ % with different scales for every axis.
+ %
+ % If the datascaling transformation is NOT active, scale is 0
+ % and T^{-1} = Identity.
+ %
+ % Note that the datascaling transformation also has
+ % translations (shifts). These are not important here.
+ %
+ % Goal:
+ % compute E_#1 such that
+ % #2* || T^{-1} e_ref || = || T^{-1} E_#1 ||
+ % where T^{-1} is the data scaling transformation and e_ref the
+ % reference unit vector. Keep in mind that there are
+ % *different* data scaling transformations for each axis.
+ %
+ % We are given e_ref and e_#1 and the desired aspect ratio
+ % between e_ref and E_#1, which is available as #2.
+ %
+ % So: T^{-1} E_#1 := s* T^{-1} e_#1 where
+ % s = #2 * ||T^{-1} e_ref|| / || T^{-1} e_#1 ||
+ % = |10^{scale_ref}| / |10^{scale_#1}| * #2 * || e_ref|| / ||e_#1||.
+ %
+ % Then, E_#1 = T ( T^{-1} E_#1 ) = s * e_#1.
+ %
+ % -> compute 's'!
+ %
+ % Part 1: compute
+ % #2 * ||e_ref|| / ||e_#1||.
+ %
+ \def\pgfplots@loc@TMPa{1}%
+ \if1\csname b@pgfplots@unitvec@is@zero@#1\endcsname
+ \def\pgfplots@loc@TMPa{0}%
+ \else
+ \if1\csname b@pgfplots@unitvec@is@zero@\pgfplots@apply@unit@ratio@reference\endcsname
+ \def\pgfplots@loc@TMPa{0}%
+ \fi
+ \fi
+ \if0\pgfplots@loc@TMPa
+ \def\pgfmathresult{16001}%
+ \else
+ % note that x^{-1} / y^{-1} == ( x/y )^{-1} == y/x .
+ % consequently, we can use our @inv@[xyz] values here:
+ \pgfmathdivide@
+ {\csname pgfplots@target@unit@scale@inv@#1\endcsname}%
+ {\csname pgfplots@target@unit@scale@inv@\pgfplots@apply@unit@ratio@reference\endcsname}
+ \pgfmathmultiply@
+ {\pgfmathresult}%
+ {#2}%
+ \global\let\pgfplots@glob@TMPa=\pgfmathresult
+ %
+ % also compute 1/s, required as temporary value:
+ %\pgfmathmultiply@
+ % {\csname pgfplots@\pgfplots@apply@unit@ratio@reference @inverseveclength\endcsname}
+ % {\csname pgfplots@target@unit@scale@#1\endcsname}%
+ %\ifdim#2pt=1pt
+ %\else
+ % \pgfmathdivide@{\pgfmathresult}{#2}%
+ %\fi
+ %\global\let\pgfplots@glob@TMPb=\pgfmathresult
+ %
+ % Part 2: handle data scaling trafo scales:
+ \begingroup
+ \def\pgfplots@tmp@exponentref{0}%
+ \def\pgfplots@tmp@exponentK{0}%
+ \pgfplots@if{pgfplots@apply@datatrafo@\pgfplots@apply@unit@ratio@reference }{%
+ \pgfplots@letcsname{pgfplots@tmp@exponentref}={pgfplots@data@scale@trafo@EXPONENT@\pgfplots@apply@unit@ratio@reference }%
+ }{}%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ \pgfplots@letcsname{pgfplots@tmp@exponentK}={pgfplots@data@scale@trafo@EXPONENT@#1}%
+ }{}%
+ \c@pgf@counta=\pgfplots@tmp@exponentref\relax
+ \advance\c@pgf@counta by-\pgfplots@tmp@exponentK\relax
+ \ifnum\c@pgf@counta=0
+ \else
+ \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPa}{\c@pgf@counta}%
+ \global\let\pgfplots@glob@TMPa=\pgfmathresult
+ % \pgfplotsmathmultiplypowten@{\pgfplots@glob@TMPb}{-\c@pgf@counta}%
+ % \global\let\pgfplots@glob@TMPb=\pgfmathresult
+ \fi
+ \xdef\pgfplots@glob@TMPc{\the\c@pgf@counta}%
+ \endgroup
+ \let\pgfmathresult=\pgfplots@glob@TMPa
+ \fi
+%\message{\string\pgfplots@getscale@unit@vector@reltoreference{#1}{#2} (reference \pgfplots@apply@unit@ratio@reference) = \pgfmathresult.^^J}%
+}
+
+% helper for \pgfplots@check@and@apply@datatrafo@for.
+\def\pgfplots@compute@number@order@for@trafo@isdimen#1\tocount#2{%
+ \edef\pgfplots@loc@TMPa{\pgf@sys@tonumber{#1}}%
+ \pgfmathfloatparsenumber{\pgfplots@loc@TMPa}%
+ \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2
+ \advance#2 by1\relax
+}
+
+% helper for \pgfplots@check@and@apply@datatrafo@for.
+%
+\def\pgfplots@compute@number@order@for@trafo@isfloat#1\tocount#2{%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathfloat@decompose@E\pgfmathresult\relax#2\relax
+ \advance#2 by1\relax
+}
+
+% Initialises the data scale transformation such that it is optimal
+% for direction #1 (using its axis limits and the target scaling size).
+%
+% Note that it will not be applied in any way; and it may still be
+% modified.
+%
+% PRECONDITION:
+% - all axis limits are available in float representation
+% - \pgfplots@set@default@size@options has been called before
+% POSTCONDITION:
+% - the scaling transformation is set up,
+\def\pgfplots@set@optimal@datatrafo@for@#1{%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ % initialise data scale transformation
+ % T(x) = 10^{q-m} * x
+ %
+ \ifpgfplots@disabledatascaling
+ % this here is a waste of time, because the NO-OP trafo
+ % will be applied to all coordinates. One could really
+ % safe a lot of CPU time when disabledatascaling is enabled...
+ % but it requires so much extra cases; I really don't want
+ % that!
+ \gdef\pgfplots@glob@TMPa{0}%
+ \gdef\pgfplots@glob@TMPb{0}%
+ \else
+ \begingroup
+ \let\data@max@order=\c@pgf@counta
+ \let\data@cur@order=\c@pgf@countb
+ \let\data@dimen=\pgf@xa
+ \let\data@tmp=\pgf@xb
+ \let\data@dimen@order=\c@pgf@countc
+ \let\data@EXPONENT=\c@pgf@countd
+ \expandafter\let\expandafter\pgfplots@display@min@float\csname pgfplots@#1min\endcsname
+ \expandafter\let\expandafter\pgfplots@display@max@float\csname pgfplots@#1max\endcsname
+ \expandafter\let\expandafter\pgfplots@data@min@float\csname pgfplots@data@#1min\endcsname
+ \expandafter\let\expandafter\pgfplots@data@max@float\csname pgfplots@data@#1max\endcsname
+ \ifpgfplots@autocompute@all@limits
+ \else
+ \pgfplotscoordmath{#1}{max}{\pgfplots@display@max@float}{\pgfplots@data@max@float}%
+ \let\pgfplots@data@max@float=\pgfmathresult
+ \pgfplotscoordmath{#1}{min}{\pgfplots@display@min@float}{\pgfplots@data@min@float}%
+ \let\pgfplots@data@min@float=\pgfmathresult
+ \fi
+ %
+%\message{minmax = [\pgfplots@data@min@float,\pgfplots@data@max@float]}%
+ % Step 1: compute 'm', the data order
+ \pgfplots@compute@number@order@for@trafo@isfloat
+ \pgfplots@data@min@float
+ \tocount\data@cur@order
+ %
+ \data@max@order=\data@cur@order
+ %
+ \pgfplots@compute@number@order@for@trafo@isfloat
+ \pgfplots@data@max@float
+ \tocount\data@cur@order
+ %
+ \ifnum\data@cur@order>\data@max@order
+ \data@max@order=\data@cur@order
+ \fi
+ %
+ % Step 2: compute 'q', the #1-size of the axis.
+ %\expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil@empty
+ % We have 'width' or 'height' (I always have them).
+ %
+ % Use the order of these parameters.
+ \def\pgfplots@loc@TMPa{#1}%
+ \def\pgfplots@loc@TMPb{x}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ \data@dimen=\pgfplots@width\relax
+ \else
+ \if1\pgfplots@compat@scaling@zunitfix@enable
+ \data@dimen=\pgfplots@height\relax
+ \else
+ % this code here belongs to versions up to
+ % 1.3.1.
+ % It is now deprecated and produces small
+ % pixel differences.
+ \def\pgfplots@loc@TMPb{y}%
+ \ifx\pgfplots@loc@TMPa\pgfplots@loc@TMPb
+ \data@dimen=\pgfplots@height\relax
+ \else
+ \data@dimen=42pt % this is actually different from 1.3.1: there, it was UNDEFINED.
+ \fi
+ \fi
+ \fi
+ \pgfplots@compute@number@order@for@trafo@isdimen
+ \data@dimen
+ \tocount\data@dimen@order
+ % This here is to avoid inaccuracies in the final
+ % axis rectangle size, see \pgfplots@initsizes:
+ %\advance\data@dimen@order by-1
+ %\else
+ % FIXME:
+ % we have either the 'x=1cm' or 'y=1cm' option!
+ % How should I initialise the trafo!?
+ % \data@dimen@order=3
+ %\fi
+ %
+%\message{Direction #1: data max order=\the\data@max@order; data dimen order=\the\data@dimen@order. }%
+ \data@EXPONENT=\data@dimen@order
+ \advance\data@EXPONENT by-\data@max@order
+ % Now, I introduce a loop which shall avoid cancellation of
+ % significant digits.
+ %
+ % Harmless Example:
+ % if we have data shift = -3 and
+ % max = 2e6, min = 1e6, then max-min = 1e6; T(max)-T(min) = 1e3 which is ok.
+ % In this case, the loop won't change anything.
+ %
+ % Critical Example:
+ % if we have data shift = -3 and
+ % max = 1980, min = 1930 then
+ % T(max) = 1.98 and T(min) = 1.93
+ % and thus T(max)-T(min) = 0.05 .
+ % Considering that this is the axis range
+ % in which tick labels and plot points need to be computed, we
+ % only have two or three digits left! That happens because the
+ % prefix '19' is common and is cancelled in the subtraction.
+ % Idea: while T(max)-T(min) < O(10^2) -> increase shift by +1
+ % (and make sure that T(max) < MAX_VALID_TEX_NUMBER).
+ %
+ \def\pgfplotscoordmathnotifydatascalesetfor##1{}% disable temporarily. We are just testing it.
+ \pgfplots@loop@CONTINUEtrue
+ \pgfutil@loop
+ \pgfplotscoordmath{#1}{datascaletrafo set params}{\the\data@EXPONENT}{0}%
+ \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@data@min@float}%
+ \let\pgfplots@min@fixed=\pgfmathresult
+ \ifpgfplots@loop@CONTINUE
+ \pgfplotscoordmath{#1}{datascaletrafo}{\pgfplots@data@max@float}%
+ \let\pgfplots@max@fixed=\pgfmathresult
+ \data@tmp=\pgfplots@max@fixed pt
+%\message{Current trafo EXPONENT for #1 direction: \the\data@EXPONENT; original #1 data limits: [\pgfplots@data@min@float:\pgfplots@data@max@float]; current transformed #1 limits: [\pgfplots@min@fixed:\pgfplots@max@fixed]; cancellation check max-min running...}%
+ \ifdim\data@tmp<0pt
+ % I need absolute values here:
+ \multiply\data@tmp by-1\relax
+ \fi
+ \pgfmathsubtract@{\pgfplots@max@fixed}{\pgfplots@min@fixed}%
+ \data@dimen=\pgfmathresult pt
+ \pgfplots@loop@CONTINUEfalse
+ \ifdim\data@tmp<1500pt % a multiplication with '10' results in max = 15000 which is the upper limit.
+ \ifdim\data@dimen<100pt % I guess if max-min = O(100), we have quite good accuracy
+ \ifdim\data@dimen<0.0001pt
+ \else
+ \advance\data@EXPONENT by1
+ \pgfplots@loop@CONTINUEtrue
+ \fi
+ \fi
+ \fi
+ %--------------------------------------------------
+ % \ifdim\data@dimen>1200pt% FIXME : is this here ok!? CHECK IT!
+ % \ifdim\data@dimen>7999pt
+ % \advance\data@EXPONENT by-2
+ % \else
+ % \advance\data@EXPONENT by-1
+ % \fi
+ % \pgfplots@loop@CONTINUEfalse
+ % \fi
+ %--------------------------------------------------
+ \pgfutil@repeat
+ \xdef\pgfplots@glob@TMPa{\the\data@EXPONENT}%
+ \xdef\pgfplots@glob@TMPb{\pgfplots@min@fixed}%
+ \endgroup
+ \fi
+ % COMPLETE INITIALISATION:
+%\message{Initialising the data scale transformation in direction #1 to 10^\pgfplots@glob@TMPa*#1 - \pgfplots@glob@TMPb...^^J}%
+ \pgfplotscoordmath{#1}{datascaletrafo set params}{\pgfplots@glob@TMPa}{\pgfplots@glob@TMPb}%
+ }{%
+ % case apply trafo == false:
+ \pgfplotscoordmath{#1}{datascaletrafo set params}{0}{0}%
+ }%
+}
+
+
+\def\pgfplots@set@optimal@datatrafos@allaxes{%
+ \pgfplots@letcsname pgfplots@xmin@unscaled@as@float={pgfplots@xmin}%
+ \pgfplots@letcsname pgfplots@xmax@unscaled@as@float={pgfplots@xmax}%
+ %
+ \pgfplots@letcsname pgfplots@ymin@unscaled@as@float={pgfplots@ymin}%
+ \pgfplots@letcsname pgfplots@ymax@unscaled@as@float={pgfplots@ymax}%
+ %
+ \pgfplots@letcsname pgfplots@zmin@unscaled@as@float={pgfplots@zmin}%
+ \pgfplots@letcsname pgfplots@zmax@unscaled@as@float={pgfplots@zmax}%
+ %
+ \pgfplots@ifneeds@one@uniform@datascale{%
+ % Ah - we have to ensure that there is ONE common scale for
+ % each unit (x, y, and z have the same).
+ %
+ % In this case, we need to choose one of the transformations
+ % and apply it to all axes -- such that each axis gets the
+ % same scale.
+ %
+ % this mode is used for axis equal and its variants.
+ %
+ % The strategy to fix the transformation is as follows:
+ % 1. we assume that axis limits will be enlarged in order to
+ % satisfy 'scale uniformly'.
+ % 2. we assume that the LARGEST axis limit dominates the
+ % others.
+ % 3. if one of the axes does not have datascaling (i.e. is
+ % log scale), we disable all other datascalings.
+ %
+ % Consequently, we search for the axis with the largest limit
+ % - and copy its data scaling to all other axes. If one of the
+ % axes is log, that one overrules it and all data scaling
+ % effects are disabled..
+ \begingroup
+ \let\pgfplots@data@scale@trafo@EXPONENT@common=\pgfutil@empty
+ \def\pgfplots@data@scale@trafo@EXPONENT@common@arg{-}% this should not match anything in this context.
+ \pgfplots@if{pgfplots@apply@datatrafo@x}{%
+ }{%
+ \def\pgfplots@data@scale@trafo@EXPONENT@common{{0}{0}}% disable scaling!
+ }%
+ \pgfplots@if{pgfplots@apply@datatrafo@y}{%
+ }{%
+ \def\pgfplots@data@scale@trafo@EXPONENT@common{{0}{0}}% disable scaling!
+ }%
+ \ifpgfplots@threedim
+ \pgfplots@if{pgfplots@apply@datatrafo@z}{%
+ }{%
+ \def\pgfplots@data@scale@trafo@EXPONENT@common{{0}{0}}% disable scaling!
+ }%
+ \fi
+ \ifx\pgfplots@data@scale@trafo@EXPONENT@common\pgfutil@empty
+ % ah - we still need to compute one. ok, search for the
+ % largest limit.
+ %
+ \pgfplots@get@axis@with@largest@limits
+ \let\pgfplots@data@scale@trafo@EXPONENT@common@arg=\pgfplotsretval
+ %
+ % ok, compute data scaling transformation for the target axis:
+ \expandafter\pgfplots@set@optimal@datatrafo@for@\pgfplots@data@scale@trafo@EXPONENT@common@arg%
+ %
+ \pgfplotscoordmath{\pgfplots@data@scale@trafo@EXPONENT@common@arg}{datascaletrafo get params}%
+ \let\pgfplots@data@scale@trafo@EXPONENT@common=\pgfmathresult%
+ \else
+ % hm. early-out - we already have the scaling trafo.
+ % return it.
+ \fi
+ \global\let\pgfplots@glob@TMPa=\pgfplots@data@scale@trafo@EXPONENT@common
+ \global\let\pgfplots@glob@TMPb=\pgfplots@data@scale@trafo@EXPONENT@common@arg
+ \endgroup
+ %
+ \xdef\pgfplots@glob@TMPc{\expandafter\pgfutil@firstoftwo\pgfplots@glob@TMPa}%
+%\message{using datascaletrafo of axis '\pgfplots@glob@TMPb' for each axis.^^J}%
+ %
+ \def\pgfplots@loc@TMPd##1{%
+ \if ##1\pgfplots@glob@TMPb
+ % we need to set the scaling trafo for the target direction
+ % (was lost after \endgroup)
+ \def\pgfplots@loc@TMPa{\pgfplotscoordmath{##1}{datascaletrafo set params}}%
+ \expandafter\pgfplots@loc@TMPa\pgfplots@glob@TMPa%
+ \else
+ \pgfplotscoordmath{##1}{datascaletrafo set params}{\pgfplots@glob@TMPc}{0}%
+ \pgfplotscoordmath{##1}{datascaletrafo}{\csname pgfplots@##1min\endcsname}%
+%\message{Initialising the data scale transformation in direction ##1 to 10^\pgfplots@glob@TMPc*##1 - \pgfmathresult...^^J}%
+ \pgfplotscoordmath{##1}{datascaletrafo set params}{\pgfplots@glob@TMPc}{\pgfmathresult}%
+ \fi
+ }%
+ \pgfplots@loc@TMPd x%
+ \pgfplots@loc@TMPd y%
+ \ifpgfplots@threedim
+ \pgfplots@loc@TMPd z%
+ \fi
+ }{%
+ % optimize individually:
+ \pgfplots@set@optimal@datatrafo@for@ x%
+ \pgfplots@set@optimal@datatrafo@for@ y%
+ \ifpgfplots@threedim
+ \pgfplots@set@optimal@datatrafo@for@ z%
+ \fi
+ }%
+ %
+}%
+
+% Defines \pgfplotsretval to be one of x, y, or z, such that the
+% return value indicates the axis with largest untransformed axis
+% limits.
+\def\pgfplots@get@axis@with@largest@limits{%
+ \begingroup
+ \let\pgfplotsretval@extreme=\pgfutil@empty
+ \let\pgfplotsretval@extreme@arg=\pgfutil@empty
+ \def\pgfplots@@##1{%
+ % compute axis range for axis ##1 ...
+ \pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@##1min\endcsname}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@##1max\endcsname}%
+ \pgfplotscoordmath{default}{op}{subtract}{{\pgfmathresult}{\pgfplots@loc@TMPa}}%
+ % ... ok, it is in \pgfmathresult.
+ \let\candidate=\pgfmathresult
+ \ifx\pgfplotsretval@extreme@arg\pgfutil@empty
+ % ah: no extreme value so far. use ours.
+ \def\pgfplotsretval@extreme@arg{##1}%
+ \let\pgfplotsretval@extreme=\candidate
+ \else
+ \pgfplotscoordmath{default}{if less than}{\pgfplotsretval@extreme}{\candidate}{%
+ % update extreme value:
+ \def\pgfplotsretval@extreme@arg{##1}%
+ \let\pgfplotsretval@extreme=\candidate
+ }{%
+ }%
+ \fi
+ }%
+ \pgfplots@@ x%
+ \pgfplots@@ y%
+ \ifpgfplots@threedim
+ \pgfplots@@ z%
+ \fi
+ \let\pgfplotsretval=\pgfplotsretval@extreme@arg
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Initialises the data scale transformation and applies it to any
+% user specified options.
+%
+% PRECONDITION:
+% - all axis limits are available in float representation
+% - \pgfplots@set@default@size@options has been called before
+% - the scaling transformation for direction x is set up
+% (\pgfplots@set@optimal@datatrafo@for@),
+% POSTCONDITION:
+% - all axis limits are transformed, but no other axis inputs.
+%
+% Unit vectors and other axis input parameters will be scaled later.
+%
+% @see \pgfplots@check@and@apply@datatrafo@for
+\def\pgfplots@apply@datatrafo@to@axis@limits#1{%
+ \pgfplots@if{pgfplots@apply@datatrafo@#1}{%
+ % Transform axis limits:
+%\message{#1- display limits BEFORE data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]^^J}%
+ \pgfplotscoordmath{#1}{datascaletrafo}{\csname pgfplots@#1min\endcsname}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1min\endcsname=\pgfmathresult
+ %
+ \pgfplotscoordmath{#1}{datascaletrafo}{\csname pgfplots@#1max\endcsname}%
+ \expandafter\global\expandafter\let\csname pgfplots@#1max\endcsname=\pgfmathresult
+%\message{#1- display limits after data transformation: [\csname pgfplots@#1min\endcsname:\csname pgfplots@#1max\endcsname]^^J}%
+ }{%
+ % case apply trafo == false:
+ \expandafter\let\csname pgfplots@#1min@unscaled@as@float\endcsname=\pgfutil@empty
+ \expandafter\let\csname pgfplots@#1max@unscaled@as@float\endcsname=\pgfutil@empty
+ }%
+}
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
index d230e0d1ed7..a80e77884ce 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
@@ -64,7 +64,9 @@
\pgf@zy=0pt
}%
%
- %
+ % The \pgfplotsqpointxyz method (or its 2d counterpart) are THE
+ % point method. If you override them, all other coordinate systems
+ % should inherit the changes as well.
\edef\pgfplotsplothandlerpointxyz##1##2##3{%
\ifpgfplots@curplot@threedim
\noexpand\pgfplotsqpointxyz{##1}{##2}{##3}%
@@ -765,33 +767,6 @@
\ifpgfplots@loc@tmp #2\else #3\fi
}%
-% Returns either '' (empty) or '-' (minus) for each of the two variing sides of the
-% oriented surface described by #1.
-%
-% The output value #2 = '' means that the positive b axis points to
-% the direction of the convex hull of the projected figure.
-%
-% The output value #2 = '-' means that the NEGATIVE b axis points to
-% the direction of the convex hull of the projected figure.
-%
-% The output value #3 is also either '' or '-'. It refers to the
-% direction of the 'n' axis of the surface which points to the convex
-% hull of the projected figure.
-%
-% The returned values are used to decide how to align tick labels such
-% that they are always outside of the convex hull of the projected
-% axis.
-%
-% #1: three characters denoting an oriented surface.
-% #2: a macro name. Will be filled either with '' (empty string) or
-% '-', encoding the direction of the 'b' axis of surface #1 which
-% points to the convex hull.
-% #3: a macro name. It takes the same values as '#2', but it refers to
-% the 'n' axis of surface #1.
-\def\pgfplotsgetdirectionstoconvexhullforsurf#1#2#3{%
- \pgfplotsgetdirectionstoconvexhullforsurf@#1\relax{#2}{#3}%
-}
-
% Executes code '#2' if the axis line with 'b=#1' on the current
% oriented surface shall be drawn.
% If that is not the case, the code '#3' will be executed.
@@ -1231,16 +1206,22 @@
\def\pgfplots@loc@naxis{y}%
\fi
\fi
- \if0\pgfplots@loc@char@for@baxis%
+ \ifcase\pgfplots@loc@char@for@baxis\relax%
+ % case 0:
% this means : the '##1' direction of the surface
% orthogonal to the 'v' vector is on the lower axis
% limit. Since I need a vector pointing to the OUTSIDE of
% the axis, I need sign = -1
\def\pgfplots@loc@baxissign{-}%
- \else
+ \or
+ % case 1:
% in this case, the OUTSIDE area requires a plus sign - the b
% axis already points to the inside.
\def\pgfplots@loc@baxissign{+}%
+ \or
+ % case 2: we have the 'axis lines=centered' case.
+ % FIXME :
+ \def\pgfplots@loc@baxissign{+}%
\fi
\pgfplotsmath@ifzero{\csname pgfplots@\pgfplots@loc@baxis @veclength\endcsname}{%
\def\pgfplots@loc@baxissign{0}%
@@ -1250,16 +1231,22 @@
}%
%
% Now the same game for the other axis:
- \if0\pgfplots@loc@char@for@naxis%
+ \ifcase\pgfplots@loc@char@for@naxis\relax
+ % case 0:
% this means : the '##2' direction of the surface
% orthogonal to the 'v' vector is on the lower axis
% limit. Since I need a vector pointing to the OUTSIDE of
% the axis, I need sign = -1
\def\pgfplots@loc@naxissign{-}%
- \else
+ \or
+ % case 1:
% in this case, the OUTSIDE area requires a plus sign - the n
% axis already points to the inside.
\def\pgfplots@loc@naxissign{+}%
+ \or
+ % case 2: centered.
+ % FIXME
+ \def\pgfplots@loc@naxissign{+}%
\fi
\pgfplotsmath@ifzero{\csname pgfplots@\pgfplots@loc@naxis @veclength\endcsname}{%
\def\pgfplots@loc@naxissign{0}%
@@ -1331,6 +1318,7 @@
\pgf@xa=#5pt\relax
\edef\pgfplots@loc@distalong@normal{\pgf@sys@tonumber\pgf@xa}%
%
+%\message{pgfplotspointoutsideofaxis{#1#2#3}{#4}{#5}: A = \pgfplots@loc@A, B = \pgfplots@loc@B.^^J}%
%
\pgf@process{%
\pgfpointadd
@@ -1415,6 +1403,8 @@
\else
\if#21%
\expandafter\let\expandafter\pgfmathresult\csname pgfplots@#1max\endcsname
+ \else
+ \expandafter\let\expandafter\pgfmathresult\csname pgfplots@logical@ZERO@#1\endcsname
\fi
\fi
}%
@@ -1714,171 +1704,11 @@
\endgroup
}%
-% Takes azimuth (horizontal angle) '#1' and elongation (vertical
-% angle) '#2' (both in degrees) and computes
-% x,y and z vectors which define the view in the direction
-% defined by '#1' and '#2'.
-%
-% 'azimuth' means a rotation around the viewport's x axis. 'elongation' means
-% a rotation around the original coordinate system's z axis.
-%
-% The method works by computing
-% Az = [ cos(azimuth) -sin(azimuth) 0; ...
-% sin(azimuth) cos(azimuth) 0; ...
-% 0 0 1 ];
-%
-%
-% Ax = [ 1 0 0; ...
-% 0 cos(elevation) -sin(elevation) ;...
-% 0 sin(elevation) cos(elevation) ];
-%
-% v= Ax * Az;
-% = [ ...
-% cosaz -sinaz cosel sinaz sinel; ...
-% sinaz cosaz cosel -sinel cosaz; ...
-% 0 sinel cosel ];
-%
-% Then, we use the rotated XZ plane as viewport, that means
-% xvec = v * [1 0 0]' = <first column of v>
-% zvec = v * [0 0 1]' = <third column of v>
-% and we define the projection onto the twodimensional surface
-% spanned by 'xvec' and 'zvec' as
-% P( q ) = [ q^T xvec, q^T zvec ]'
-% for q in R^3.
-% As a consequence, we compute the three unit vectors as
-% x = P( [1 0 0] )
-% = [ cosaz, sinaz sinel ]'
-% y = P( [0 1 0] )
-% = [ sinaz, -sinel cosaz ]'
-% z = P( [0 0 1] )
-% = [ 0, cosel]'
-%
-% Furthermore, the 3D view vector which points into the direction of the view
-% is
-% n = v * [0 1 0 ]' = <second column of v> = [-sinaz cosel, cosaz cosel, sinel]'
-% because the normal view point was the XZ plane with y as its normal
-% vector.
-% The 3D vector n is returned by this routine as well - it is
-% necessary for some kind of z buffering (determining what is
-% foreground and what is background).
-%
-% INPUT:
-% - #1 : azimuth ("yaw")
-% - #2 : elevation ("pitch")
-% OUTPUT:
-% - #3 : a macro which will be set to '1' if and only if
-% the viewport is the standard XY axis (i.e. azimuth=0, elevation=90).
-% - [xyz] vectors,
-% \pgfplots@[xyz]@veclength,
-% \pgfplots@[xyz]@inverseveclength
-% are set properly
-% \pgfplots@view@dir@threedim@[xyz] will contain the three components
-% of 'n' (without the suffix 'pt', but in units of 'pt').
-\def\pgfplotssetaxesfromazel#1#2#3{%
- \begingroup
- \pgfmathparse{#1}%
- \let\pgfplots@az=\pgfmathresult
- \pgfmathparse{#2}%
- \edef\pgfplots@el{-\pgfmathresult}%
- \pgfmathsin@{\pgfplots@az}%
- \let\sinaz=\pgfmathresult
- \pgfmathcos@{\pgfplots@az}%
- \let\cosaz=\pgfmathresult
- \pgfmathsin@{\pgfplots@el}%
- \let\sinel=\pgfmathresult
- \pgfmathcos@{\pgfplots@el}%
- \let\cosel=\pgfmathresult
- % x:
- \pgfmathmultiply@{\sinaz}{\sinel}%
- \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpoint{\cosaz pt}{\pgfmathresult pt}}%
- % y:
- \pgfmathmultiply@{-\sinel}{\cosaz}%
- \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpoint{\sinaz pt}{\pgfmathresult pt}}%
- % z:
- \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpoint{0pt}{\cosel pt}}%
- %
- \pgfkeysgetvalue{/pgfplots/x dir/value}\pgfplots@loc@dirvalue@x
- \pgfkeysgetvalue{/pgfplots/y dir/value}\pgfplots@loc@dirvalue@y
- \pgfkeysgetvalue{/pgfplots/z dir/value}\pgfplots@loc@dirvalue@z
- \if r\pgfplots@loc@dirvalue@x
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}%
- \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
- \fi
- \if r\pgfplots@loc@dirvalue@y
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPb}%
- \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
- \fi
- \if r\pgfplots@loc@dirvalue@z
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPc}%
- \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpointscale{-1}{\the\t@pgfplots@toka}}%
- \fi
- %
- % Process 'plot box ratio':
- \def\pgfplots@extract@plot@box@ratio##1##2##3##4\pgfplots@EOI{%
- \pgfmathparse{##1}\let\pgfplots@plotboxratio@x=\pgfmathresult
- \pgfmathparse{##2}\let\pgfplots@plotboxratio@y=\pgfmathresult
- \pgfmathparse{##3}\let\pgfplots@plotboxratio@z=\pgfmathresult
- }%
- \def\pgfplots@extract@plot@box@ratio@spaces##1 ##2 ##3 ##4\pgfplots@EOI{%
- \pgfplots@extract@plot@box@ratio{##1}{##2}{##3}{##4}\pgfplots@EOI
- }%
- \pgfkeysgetvalue{/pgfplots/plot box ratio}\pgfplots@loc@TMPa
- % Auto-determine input format which is either '{x}{y}{z}' or 'x y z'
- \def\pgfplots@loc@TMPb{%
- \pgfutil@ifnextchar\bgroup{%
- \pgfplots@loc@tmptrue
- \pgfplots@gobble@until@EOI
- }{%
- \pgfplots@loc@tmpfalse
- \pgfplots@gobble@until@EOI
- }%
- }%
- \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPa\pgfplots@EOI
- \ifpgfplots@loc@tmp
- % Ah- braces format.
- \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa{1}{1}{1}}%
- \expandafter\pgfplots@extract@plot@box@ratio\pgfplots@loc@TMPa\pgfplots@EOI
- \else
- % Ah- space-separated
- \edef\pgfplots@loc@TMPa{\pgfplots@loc@TMPa\space 1 1 1}%
- \expandafter\pgfplots@extract@plot@box@ratio@spaces\pgfplots@loc@TMPa\pgfplots@EOI
- \fi
- %
- % process it:
- \ifdim\pgfplots@plotboxratio@x pt=1pt
- \else
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPa}%
- \xdef\pgfplots@glob@TMPa{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@x}{\the\t@pgfplots@toka}}%
- \fi
- \ifdim\pgfplots@plotboxratio@y pt=1pt
- \else
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPb}%
- \xdef\pgfplots@glob@TMPb{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@y}{\the\t@pgfplots@toka}}%
- \fi
- \ifdim\pgfplots@plotboxratio@z pt=1pt
- \else
- \t@pgfplots@toka=\expandafter{\pgfplots@glob@TMPc}%
- \xdef\pgfplots@glob@TMPc{\noexpand\pgfqpointscale{\pgfplots@plotboxratio@z}{\the\t@pgfplots@toka}}%
- \fi
- %
- % n (3D!)
- \pgfmathmultiply@{-\sinaz}{\cosel}%
- \let\pgfmathresultNx=\pgfmathresult
- \pgfmathmultiply@{\cosaz}{\cosel}%
- \xdef\pgfplots@glob@TMPd{{\pgfmathresultNx}{\pgfmathresult}{\sinel}}%
- \endgroup
-%\message{Setting x,y and z from {#1}{#2} to^^J x = \meaning\pgfplots@glob@TMPa,^^J y = \meaning\pgfplots@glob@TMPb,^^J z = \meaning\pgfplots@glob@TMPc,^^J n = \pgfplots@glob@TMPd.^^J}%
- \pgfsetxvec{\pgfplots@glob@TMPa}%
- \pgfsetyvec{\pgfplots@glob@TMPb}%
- \pgfsetzvec{\pgfplots@glob@TMPc}%
- \def\pgfplots@loc@TMPa##1##2##3{%
- \def\pgfplots@view@dir@threedim@x{##1}%
- \def\pgfplots@view@dir@threedim@y{##2}%
- \def\pgfplots@view@dir@threedim@z{##3}%
- }%
- \expandafter\pgfplots@loc@TMPa\pgfplots@glob@TMPd\relax
- \def#3{0}%
- \pgfplots@scale@plotbox@to@widthheight
+
+\def\pgfplotspointviewdir{%
+ %\pgfplotsmathvectordatascaletrafoinverse{\pgfplots@view@dir@threedim}{default}%
+ \let\pgfplotsretval=\pgfplots@view@dir@threedim
+ \pgfplotspointfromcsvvector{\pgfplotsretval}{default}%
}%
\def\message@pgfplots@units{%
@@ -1889,542 +1719,21 @@
\fi
\pgfmathparse{veclen(\pgf@xx,\pgf@xy)/\Z}\let\X=\pgfmathresult
\pgfmathparse{veclen(\pgf@yx,\pgf@yy)/\Z}\let\Y=\pgfmathresult
+ \expandafter\ifx\csname pgfplots@view@dir@threedim\endcsname\relax
+ \def\normal{view = (---),^^J}%
+ \else
+ \pgfplotsmathvectortostring{\pgfplots@view@dir@threedim}{default}%
+ \edef\normal{view = (\pgfplotsretval),^^J}%
+ \fi
\message{^^J
x = (\the\pgf@xx,\the\pgf@xy),^^J
y =(\the\pgf@yx,\the\pgf@yy),^^J
z = (\the\pgf@zx,\the\pgf@zy),^^J
- \expandafter\ifx\csname pgfplots@view@dir@threedim@x\endcsname\relax
- \else
- n = (\pgfplots@view@dir@threedim@x,\pgfplots@view@dir@threedim@y,\pgfplots@view@dir@threedim@z),^^J
- \fi
+ \normal
unit vector ratio=[\X\space\Y\space 1],^^J}%
\endgroup
}%
-% Takes the current plot box, defined by the actual PGF x,y and z unit
-% vectors, and re-scales it such that it fits into the
-% width and height of the axis (as they have been provided by the
-% user).
-%
-% @see \pgfplots@scale@axisbox@to@widthheight
-% @see\pgfplots@scaleaxes@to@BB
-\def\pgfplots@scale@plotbox@to@widthheight{%
- \pgfplots@initsizes@get@width@withoutlabels
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \pgfplots@initsizes@get@height@withoutlabels
- \edef\pgfplots@loc@TMPa{{\pgfplots@loc@TMPa}{\pgfmathresult}}%
- \let\pgfplots@BB@for@plotbox=\pgfplots@BB@for@plotbox@relative
- \let\pgfplots@BB@for@plotbox@compute@post@scales=\pgfplots@BB@for@plotbox@compute@post@scales@relative
- \expandafter\pgfplots@scaleaxes@to@BB\pgfplots@loc@TMPa
-}
-
-
-% A variant of \pgfplots@scale@plotbox@to@widthheight which does not
-% use the given x,y,z vectors to define the plot box. Instead, it uses
-% the lower and upper axis limits.
-\def\pgfplots@scale@axisbox@to@widthheight{%
- \pgfplots@initsizes@get@width@withoutlabels
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \pgfplots@initsizes@get@height@withoutlabels
- \edef\pgfplots@loc@TMPa{{\pgfplots@loc@TMPa}{\pgfmathresult}}%
- \let\pgfplots@BB@for@plotbox=\pgfplots@BB@for@plotbox@computelimits
- \let\pgfplots@BB@for@plotbox@compute@post@scales=\pgfplots@BB@for@plotbox@compute@post@scales@NOP
- \expandafter\pgfplots@scaleaxes@to@BB\pgfplots@loc@TMPa
-}
-
-
-% Takes the current PGF x,y and z unit vectors and scales them such
-% that the bounding box of the final image has width #1 and height #2.
-%
-% The relative length of the input vectors is important for the 3D case: it
-% will be scaled as-is.
-%
-% PRECONDITION
-% - the x, y and z unit vectors have been set to the proper
-% DIRECTIONS. Their relative vector lengths are set-up properly
-% (i.e. y is twice as large as x and half as large as z or so).
-% - \pgfplots@[xyz]@veclength and
-% \pgfplots@[xyz]@inverseveclength
-% are set correctly.
-% - the \ifpgfplots@threedim boolean is set.
-% - the data limits have been initialised and transformed according
-% to the data transformation.
-%
-% POSTCONDITION
-% - the unit vectors have been re-scaled such that the final plot
-% has the desired dimensions.
-% - the @veclength and @inverseveclength have been re-scaled as
-% well.
-\def\pgfplots@scaleaxes@to@BB#1#2{%
-%\message{before scaling:}\message@pgfplots@units
- \if0\pgfplots@scale@mode@choice
- % scale mode=auto
- \def\pgfplots@scale@mode@choice{2}% stretch to fill
- \fi
- \if1\pgfplots@scale@mode@choice
- % scale mode=none
- \else
- \pgfplots@scaleaxes@to@BB@{#1}{#2}%
- \fi
- % FIXME
- % I suppose I should call \pgfplotsgetnormalforcurrentview now?
- \pgfplots@computeunitvectorlengths
-%\message{after scaling:}\message@pgfplots@units
-}%
-\def\pgfplots@BB@for@plotbox@relative{%
- % We just need the
- % relative sizes, i.e.
- % "0" == lower axis limit
- % "1" == upper axis limit
- %
- \ifpgfplots@threedim
- \pgfpathmoveto{\pgfqpointxyz000}%
- \pgfpathmoveto{\pgfqpointxyz001}%
- \pgfpathmoveto{\pgfqpointxyz010}%
- \pgfpathmoveto{\pgfqpointxyz011}%
- \pgfpathmoveto{\pgfqpointxyz100}%
- \pgfpathmoveto{\pgfqpointxyz101}%
- \pgfpathmoveto{\pgfqpointxyz110}%
- \pgfpathmoveto{\pgfqpointxyz111}%
- \else
- \pgfpathmoveto{\pgfqpointxy00}%
- \pgfpathmoveto{\pgfqpointxy01}%
- \pgfpathmoveto{\pgfqpointxy10}%
- \pgfpathmoveto{\pgfqpointxy11}%
- \fi
-}%
-\let\pgfplots@BB@for@plotbox=\pgfplots@BB@for@plotbox@relative
-\def\pgfplots@BB@for@plotbox@compute@post@scales@relative#1#2#3{%
- % Consequently, we have to multiply with 1/(max-min):
- \pgfmathsubtract@{\pgfplots@xmax}{\pgfplots@xmin}%
- % compute 1/(xmax - xmin) in float for more recent versions (see /pgfplots/compat/scaling).
- % I observed that it is much more accurate
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{\pgfmathresult}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{op}{reciprocal}{{\pgfmathresult}}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{tofixed}{\pgfmathresult}%
- \let#1=\pgfmathresult
- %
- \pgfmathsubtract@{\pgfplots@ymax}{\pgfplots@ymin}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{\pgfmathresult}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{op}{reciprocal}{{\pgfmathresult}}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{tofixed}{\pgfmathresult}%
- \let#2=\pgfmathresult
- %
- \ifpgfplots@threedim
- \pgfmathsubtract@{\pgfplots@zmax}{\pgfplots@zmin}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{parsenumber}{\pgfmathresult}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{op}{reciprocal}{{\pgfmathresult}}%
- \pgfplotscoordmath{\pgfplots@compat@scaling@coordmath}{tofixed}{\pgfmathresult}%
- \else
- \def\pgfmathresult{1}%
- \fi
- \let#3=\pgfmathresult
-}%
-\let\pgfplots@BB@for@plotbox@compute@post@scales=\pgfplots@BB@for@plotbox@compute@post@scales@relative
-\def\pgfplots@BB@for@plotbox@computelimits{%
- \ifpgfplots@threedim
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmin\pgfplots@ymin\pgfplots@zmin}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmin\pgfplots@ymin\pgfplots@zmax}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmin\pgfplots@ymax\pgfplots@zmin}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmin\pgfplots@ymax\pgfplots@zmax}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmax\pgfplots@ymin\pgfplots@zmin}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmax\pgfplots@ymin\pgfplots@zmax}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmax\pgfplots@ymax\pgfplots@zmin}%
- \pgfpathmoveto{\pgfqpointxyz\pgfplots@xmax\pgfplots@ymax\pgfplots@zmax}%
- \else
- \pgfpathmoveto{\pgfqpointxy\pgfplots@xmin\pgfplots@ymin}%
- \pgfpathmoveto{\pgfqpointxy\pgfplots@xmin\pgfplots@ymax}%
- \pgfpathmoveto{\pgfqpointxy\pgfplots@xmax\pgfplots@ymin}%
- \pgfpathmoveto{\pgfqpointxy\pgfplots@xmax\pgfplots@ymax}%
- \fi
-}%
-\def\pgfplots@BB@for@plotbox@compute@post@scales@NOP#1#2#3{%
- \let#1=\pgfutil@empty
- \let#2=\pgfutil@empty
- \let#3=\pgfutil@empty
-}%
-\def\pgfplots@scaleaxes@to@BB@#1#2{%
- \begingroup
- \pgfinterruptboundingbox
- % STEP 1: compute the bounding box for the plot box.
- \pgfplots@BB@for@plotbox
- %
- % TMPa = width
- \pgf@xa=\pgf@pathmaxx
- \advance\pgf@xa by-\pgf@pathminx
- % TMPb = height
- \pgf@xb=\pgf@pathmaxy
- \advance\pgf@xb by-\pgf@pathminy
- \pgf@ya=#1\relax
- \pgf@yb=#2\relax
-%\message{PGFPLOTS: the current unit vectors result in a UNIT BB of (\the\pgf@xa,\the\pgf@xb). Scaling it to (\the\pgf@ya,\the\pgf@yb)...}%
- \ifcase\pgfplots@scale@mode@choice
- % scale mode=auto does not happen here
- \or
- % scale mode=none does not happen here
- \or
- % scale mode=stretch to fill
- % Compute individual scaling factors for X and Y
- % such that the UNIT-BB will have size #1,#2:
- \pgfplotsutil@edef@invoke\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@ya}%
- {\pgf@sys@tonumber\pgf@xa}%
- }%
- % TMPa = scalex
- \global\let\pgfplots@glob@TMPa=\pgfmathresult
- \pgfplotsutil@edef@invoke\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@yb}%
- {\pgf@sys@tonumber\pgf@xb}%
- }%
- % TMPb = scaley
- \global\let\pgfplots@glob@TMPb=\pgfmathresult
- \global\let\pgfplots@glob@TMPc=\relax
- \or
- % scale mode=scale uniformly
- % compute ONE common scale for both, X and Y.
- %
- \pgfplotsutil@edef@invoke\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@ya}%
- {\pgf@sys@tonumber\pgf@xa}%
- }%
- \global\let\pgfplots@glob@TMPa=\pgfmathresult
- \global\let\pgfplots@glob@TMPb=\pgfplots@glob@TMPa
- \global\let\pgfplots@glob@TMPc=\relax
- \ifdim\pgf@zy=0pt
- \ifdim\pgf@yx=0pt
- \pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir{y}\returninto\pgfplots@glob@TMPc
- \else
- \pgfplots@error@scale@uniformly@failed
- \fi
- \else
- \ifdim\pgf@zx=0pt
- \pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir{z}\returninto\pgfplots@glob@TMPc
- \else
- \pgfplots@error@scale@uniformly@failed
- \fi
- \fi
- \fi
- \pgfusepath{discard}%
- \endpgfinterruptboundingbox
- \endgroup
- % Ok, we know the W,H scalings now.
- %
- % But remember that we have worked with RELATIVE scales up to now.
- % We have to convert them now, by interpreting "1 == upper limit"
- % and "0 == lower limit" for every direction.
- %
- \pgfplots@BB@for@plotbox@compute@post@scales{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPc}%
- %
- % ok. Now apply all scalings.
- % Let's hope all these temporary macros are still valid!
-%\message{got scaleW = \pgfplots@glob@TMPa\space and scaleH = \pgfplots@glob@TMPb; scalex=\pgfplots@loc@TMPa, scaley=\pgfplots@loc@TMPb, scalez=\pgfplots@loc@TMPc.}%
- \pgf@xx=\pgfplots@glob@TMPa\pgf@xx
- \pgf@xy=\pgfplots@glob@TMPb\pgf@xy
- \pgf@xx=\pgfplots@loc@TMPa\pgf@xx
- \pgf@xy=\pgfplots@loc@TMPa\pgf@xy
- %
- \pgf@yx=\pgfplots@glob@TMPa\pgf@yx
- \pgf@yy=\pgfplots@glob@TMPb\pgf@yy
- \pgf@yx=\pgfplots@loc@TMPb\pgf@yx
- \pgf@yy=\pgfplots@loc@TMPb\pgf@yy
- %
- \ifpgfplots@threedim
- \pgf@zx=\pgfplots@glob@TMPa\pgf@zx
- \pgf@zy=\pgfplots@glob@TMPb\pgf@zy
- \pgf@zx=\pgfplots@loc@TMPc\pgf@zx
- \pgf@zy=\pgfplots@loc@TMPc\pgf@zy
- \fi
- \pgfplots@glob@TMPc
-}%
-
-\def\pgfplots@error@scale@uniformly@failed{%
- \pgfplots@error{Sorry, 'scale uniformly' failed because its actual implementation works only if y_x = 0 (for 2d axes) or if z_x = 0 (for 3d axes). The result will not fill the prescribed dimensions. For 2d axes, you may also want to consider the 'unit vector ratio' key}%
-}%
-\def\pgfplots@prepare@vertical@rescaling@for@scale@uniformly@in@dir#1\returninto#2{%
- % The strategy is as follows:
- % 1. I want to fit the axis into width #1 (\pgf@ya) and
- % height #1 (\pgf@yb).
- % 2. I want to MAINTAIN the unit vector ratio.
- % 3. I want to MAINTAIN the unit vector directions.
- %
- % I already know the scaling factor to fit the width (it
- % is stored in \pgfplots@glob@TMPa = \pgfplots@glob@TMPb).
- % Let's call it "s".
- %
- % Consequently, a uniform scaling by "s" leads the image
- % height
- % h = s* (r_x * e_xy + r_y * e_yy + r_z * e_zy)
- % where r_i = (imax - imin). This here is essentially the
- % same as the bounding box computation above (at least for
- % standart orthographic 3D axes).
- %
- % What I want now is to enlarge the limits such that I
- % have BOTH, width #1 AND height #2, without obscuring the
- % unit vector ratio. Recall that width #1 is already
- % given.
- %
- % In my opinion the ONLY way to achieve this goal is to
- % modify axis limits for an axis whose unit vector is
- % parallel to the canvas y axis, i.e. e_i = (0,*). To see
- % this, remember that a rescaling of the other limits will
- % also modify the width.
- %
- % That means I have to introduce a SECOND scale s_z which
- % applies only to the Z unit vector (since e_z = (0,*) ).
- % If H = #2 is the desired height, I find the target
- % equation for s_z,
- %
- % H = s* r_x e_xy + s * r_y e_yy + s_z * s * r_z * e_zy
- % =>
- % s_z = ( H- s*r_x e_xy - s*r_y e_yy) / ( s * r_z * e_zy).
- %
- % Remember that
- % s = \pgfplots@glob@TMPa
- % and
- % \pgfplots@glob@TMPa * \pgf@xb = s*h
- %
- \pgf@xc=\csname pgfplots@#1max\endcsname\csname pgf@#1y\endcsname% FIXME : what if we are working with relative coords?
- \advance\pgf@xc by -\csname pgfplots@#1min\endcsname\csname pgf@#1y\endcsname
- %
- \advance\pgf@xb by-\pgf@xc
- \pgf@xb=\pgfplots@glob@TMPa\pgf@xb
- \advance\pgf@yb by-\pgf@xb
- \pgf@xb=\pgfplots@glob@TMPa\pgf@xc
- \pgfplotsutil@edef@invoke\pgfmathdivide@{%
- {\pgf@sys@tonumber\pgf@yb}%
- {\pgf@sys@tonumber\pgf@xb}%
- }%
- % Now, s_z = \pgfmathresult .
- %
- % Now, adjust the z limits.
- % Note that \pgfplots@apply@unit@vector@rescale@keep@size
- % has a slightly different context; it assumes that the
- % unit vector has been rescaled, not the axis limits.
- % Consequently, the inverse of the scaling factor enters.
- % Since \pgfplots@apply@unit@vector@rescale@keep@size
- % expects the inverse of the scale, we can provide
- % \pgfmathresult:
- \xdef#2{%
- \noexpand\pgfplots@apply@unit@vector@rescale@keep@size{#1}{\pgfmathresult}%
- }%
-}
-
-\def\pgfplots@computeunitvectorlengths{%
- \pgfplotsutil@edef@invoke\pgfmathveclen@{%
- {\pgf@sys@tonumber\pgf@xx}%
- {\pgf@sys@tonumber\pgf@xy}%
- }%
- \let\pgfplots@x@veclength=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfplots@x@veclength}{%
- \def\pgfmathresult{infty}%
- % this case will be caught in \pgfplots@initsizes
- }{%
- \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
- }%
- \let\pgfplots@x@inverseveclength=\pgfmathresult
- %
- \pgfplotsutil@edef@invoke\pgfmathveclen@{%
- {\pgf@sys@tonumber\pgf@yx}%
- {\pgf@sys@tonumber\pgf@yy}%
- }%
- \let\pgfplots@y@veclength=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfplots@y@veclength}{%
- \def\pgfmathresult{infty}%
- % this case will be caught in \pgfplots@initsizes
- }{%
- \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
- }%
- \let\pgfplots@y@inverseveclength=\pgfmathresult
- %
- \ifpgfplots@threedim
- \pgfplotsutil@edef@invoke\pgfmathveclen@{%
- {\pgf@sys@tonumber\pgf@zx}%
- {\pgf@sys@tonumber\pgf@zy}%
- }%
- \let\pgfplots@z@veclength=\pgfmathresult
- \pgfplotsmath@ifzero{\pgfplots@z@veclength}{%
- \def\pgfmathresult{infty}%
- % this case will be caught in \pgfplots@initsizes
- }{%
- \expandafter\pgfmath@basic@reciprocal@\expandafter{\pgfmathresult}%
- }%
- \let\pgfplots@z@inverseveclength=\pgfmathresult
- \fi
-}%
-
-% Defines \pgfplots@view@dir@threedim@[xyz] according to the actual
-% configuration of x,y,z (2d) unit vectors, assuming the associated
-% unit vectors form a right-handed-system.
-%
-% The algorithm works for standard three dimensional axes. It works as
-% follows:
-%
-% First, observe that we have a normal direction N if all its
-% multiples are on the mapped onto the same point in 2D canvas
-% coordinates. In other words: all 3D coordinates which are mapped
-% onto an arbitrary point in 2D canvas coordinates (take, for example,
-% the origin (0,0) ) are on a line in direction of N.
-%
-% We use this observation to compute the normal axis, i.e. we search
-% for all points which are mapped onto the 2D canvas coordinate (0,0):
-% N_x e_xx + N_y e_yx + N_z e_zx = 0
-% N_x e_xy + N_y e_yy + N_z e_zy = 0.
-% All solutions make up a linear space of dimension 1 (up to special
-% cases). In the general case, we can chose an arbitrary N_z != 0
-% and reduce the linear system to
-% N_x e_xx + N_y e_yx = - N_z e_zx
-% N_x e_xy + N_y e_yy = - N_z e_zy.
-% Choosing *any* N_z != 0, say, N_z=-1 (which corresponds to view
-% from above) will lead to a vector parallel to the normal direction.
-% But it might have the wrong sign.
-%
-% To find the correct sign for N, I have made several case
-% distinctions to identify the cases when we have to multiply with -1.
-% The key idea is to assume a right-handed-system of unit vectors;
-% this is the condition which allows to determine the sign.
-%
-% Furthermore, I assume that e_z points to the top, i.e. that e_zy >0.
-% Then, there are (mainly) four conditions on the signs of e_x and e_y
-% which indicate that we are viewing from below and should switch the
-% sign of N (keep in mind that our initial choice was N_z =-1, see above).
-%
-% The conditions can be identified by drawing a 3D box and
-% identifying the corner which represents the lower left 3D limits.
-%
-% You can visualize these cases using
-%--------------------------------------------------
-% \pgfplotsset{
-% separate axis lines,
-% every outer x axis line/.append style= {-stealth},
-% every outer y axis line/.append style= {-stealth},
-% every outer z axis line/.append style= {-stealth},
-% samples=2,shader=interp,title={view=\h,\v},
-% domain=0:1,
-% enlargelimits=false,
-% view=\h\v,xlabel=x,ylabel=y,
-% extra description/.code={%
-% \node[draw,fill=white] at (axis cs:0,0,0) {};
-% },
-% }
-%
-% \def\v{30}
-% \foreach \h in {30,120,210,300} {
-% \message{VIEW={\h}{\v}^^J}
-% \begin{tikzpicture}
-% \begin{axis}
-% \addplot3[surf] {x};
-% \end{axis}
-% \end{tikzpicture}
-%
-% }
-%
-% \def\v{-30}
-% \foreach \h in {30,120,210,300} {
-% \message{VIEW={\h}{\v}^^J}
-% \begin{tikzpicture}
-% \begin{axis}
-% \addplot3[surf] {x};
-% \end{axis}
-% \end{tikzpicture}
-%
-% }
-%--------------------------------------------------
-% The precise formulas can be found below in the source code.
-%
-% You can override this function by the /pgfplots/view dir key.
-\def\pgfplotsgetnormalforcurrentview{%
- \pgfkeysgetvalue{/pgfplots/view dir}\pgfplots@loc@TMPc
- \ifx\pgfplots@loc@TMPc\pgfutil@empty
- \begingroup
- \xdef\pgfplots@view@dir@threedim@z{-1}% hold it at some arbitrary value
- \pgf@xa=-\pgfplots@view@dir@threedim@z\pgf@zx
- \pgf@ya=-\pgfplots@view@dir@threedim@z\pgf@zy
- \edef\pgfplots@loc@TMPa{%
- {%
- {\pgf@sys@tonumber\pgf@xx}{\pgf@sys@tonumber\pgf@yx}%
- {\pgf@sys@tonumber\pgf@xy}{\pgf@sys@tonumber\pgf@yy}%
- }%
- {%
- {\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@ya}%
- }%
- }%
- \expandafter\pgfutilsolvetwotwoleq\pgfplots@loc@TMPa
- \def\pgfplots@loc@TMPb##1##2{%
- \xdef\pgfplots@view@dir@threedim@x{##1}%
- \xdef\pgfplots@view@dir@threedim@y{##2}%
- }%
- \expandafter\pgfplots@loc@TMPb\pgfmathresult
- %
- % Identify if we need to switch the sign.
- % To verify that these cases are useful, I suggest visualizing
- % that stuff using the TeX code from above...
- %
- % I guess it is correct up to collapsing views (as you see, I
- % did not properly identify the cases with "=0" )
- \def\pgfplots@scale{1}%
- \ifdim\pgf@xx>0pt
- \ifdim\pgf@yx>0pt
- %
- \ifdim\pgf@xy>0pt
- \ifdim\pgf@yy<0pt
- \def\pgfplots@scale{-1}%
- \fi
- \fi
- %
- \fi
- \else
- \ifdim\pgf@xx<0pt
- \ifdim\pgf@yx<0pt
- %
- \ifdim\pgf@xy<0pt
- \ifdim\pgf@yy>0pt
- \def\pgfplots@scale{-1}%
- \fi
- \fi
- %
- \fi
- \fi
- \fi
- \ifdim\pgf@xy>0pt
- \ifdim\pgf@yy>0pt
- %
- \ifdim\pgf@xx<0pt
- \ifdim\pgf@yx>0pt
- \def\pgfplots@scale{-1}%
- \fi
- \fi
- %
- \fi
- \else
- \ifdim\pgf@xy<0pt
- \ifdim\pgf@yy<0pt
- %
- \ifdim\pgf@xx>0pt
- \ifdim\pgf@yx<0pt
- \def\pgfplots@scale{-1}%
- \fi
- \fi
- %
- \fi
- \fi
- \fi
- \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@x}%
- \global\let\pgfplots@view@dir@threedim@x\pgfmathresult
- \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@y}%
- \global\let\pgfplots@view@dir@threedim@y\pgfmathresult
- \pgfmathmultiply@{\pgfplots@scale}{\pgfplots@view@dir@threedim@z}%
- \global\let\pgfplots@view@dir@threedim@z\pgfmathresult
- \endgroup
- \else
- \def\pgfplots@loc@TMPb##1##2##3{%
- \xdef\pgfplots@view@dir@threedim@x{##1}%
- \xdef\pgfplots@view@dir@threedim@y{##2}%
- \xdef\pgfplots@view@dir@threedim@z{##3}%
- }%
- \expandafter\pgfplots@loc@TMPb\pgfplots@loc@TMPc
- \fi
-%\message{\string\pgfplotsgetnormalforcurrentview: got (\pgfplots@view@dir@threedim@x,\pgfplots@view@dir@threedim@y,\pgfplots@view@dir@threedim@z)^^J}%
-}%
% ==================================================================================
%
@@ -2513,7 +1822,7 @@
if is bounded=\edef\pgfplotsretval{##1}\ifx\pgfplotsretval\pgfutil@empty ##3\else ##2\fi,
suffix= #1,%
datascaletrafo set params=,
- datascaletrafo get params= \def\pgfmathresult{{}{}},
+ datascaletrafo get params= \def\pgfmathresult{{0}{0}},
datascaletrafo= \edef\pgfmathresult{##1},
datascaletrafo inverse= \edef\pgfmathresult{##1},
datascaletrafo noshift inverse= \edef\pgfmathresult{##1},
@@ -2680,8 +1989,10 @@
#1\relax\pgfplotscoordmathnotifydatascalesetfor{\pgfplotscoordmathid}%
}},%
%
- % Defines \pgfmathresult to contain the two parameters required
- % for 'datascaletrafo set params'.
+ % Defines \pgfmathresult to contain the two parameters in the form
+ % {#1}{#2} required for 'datascaletrafo set params':
+ % #1: the EXPONENT (as integer)
+ % #2: the SHIFT (as fixed point number)
datascaletrafo get params/.code=
{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo get params\endcsname{#1}},%
datascaletrafo/.code=
@@ -2738,6 +2049,7 @@
\pgfplotscoordmath{\pgfplotscoordmathid}{op}{reciprocal}{{\pgfmathresult}}%
\let\pgfplots@loc@TMPb=\pgfmathresult% TMPb = 1/log_e(#2)
%
+ % log_a(x) = log_e(x) / log_e(a)
\expandafter\edef\csname pgfpmth\pgfplotsdeclarecoordmath@ @\pgfplotscoordmathid @log\endcsname##1{%
\noexpand\pgfplotscoordmath{\pgfplotscoordmathid}{log e}{##1}%
\noexpand\ifx\noexpand\pgfmathresult\noexpand\pgfutil@empty
@@ -2748,6 +2060,8 @@
}%
\noexpand\fi
}%
+ %
+ % a^x = exp(log_e(a^x)) = exp(x*log_e(a))
\expandafter\edef\csname pgfpmth\pgfplotsdeclarecoordmath@ @\pgfplotscoordmathid @exp\endcsname##1{%
\noexpand\edef\noexpand\pgfmathresult{##1}%
\noexpand\ifx\noexpand\pgfmathresult\noexpand\pgfutil@empty
@@ -2859,7 +2173,15 @@
\pgfplotsdeclarecoordmath{pgfbasic}{%
- parsenumber=\pgfmathfloatparsenumber{#1}\pgfmathfloattofixed\pgfmathresult,
+ parsenumber={%
+ \pgfmathfloatparsenumber{#1}%
+ \expandafter\pgfmathfloatgetflagstomacro\expandafter{\pgfmathresult}\pgfplotsretval
+ \ifnum\pgfplotsretval>2
+ \let\pgfmathresult=\pgfutil@empty
+ \else
+ \pgfmathfloattofixed\pgfmathresult
+ \fi
+ },
suffix=@basic@,
zero=\def\pgfmathresult{0},
one=\def\pgfmathresult{1},
@@ -3998,7 +3320,10 @@
\noexpand\pgfkeyssetvalue{/pgfplots/y coord sorting}{\pgfkeysvalueof{/pgfplots/y coord sorting}}%
%
\noexpand\pgfplots@initzerolevelhandler
- \noexpand\pgfplots@define@currentplotstyle@as{\the\t@pgfplots@toka}% remember 'current plot style'
+ % remember 'current plot style':
+ \noexpand\pgfplots@define@currentplotstyle@as{%
+ \the\t@pgfplots@toka
+ }%
% per-point meta data ranges which apply only to
% this plot:
\noexpand\xdef\noexpand\pgfplots@metamin{\pgfplots@metamin}%
@@ -4007,6 +3332,7 @@
\noexpand\def\noexpand\pgfplots@serialized@state@plothandler{\the\t@pgfplots@tokb}%
\noexpand\def\noexpand\pgfplotsaxisfilteredcoordsaway{\pgfplotsaxisfilteredcoordsaway}%
\noexpand\def\noexpand\pgfplotsaxisplothasjumps{\pgfplotsaxisplothasjumps}%
+ \noexpand\pgfkeyssetvalue{/pgfplots/on layer}{\pgfkeysvalueof{/pgfplots/on layer}}%
}%
{% draw command:
\noexpand\path%
@@ -4471,7 +3797,7 @@
\fi
\fi
\begingroup
- % no, assemble the macro which will invoke
+ % now, assemble the macro which will invoke
% \pgfplots@streamerrorbarcoords:
\let\E=\noexpand
\expandafter\xdef\csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname{%
@@ -4545,21 +3871,25 @@
\ifx\pgfplots@error@coord\pgfutil@empty
\else
\pgfplotscoordmath{#1}{parsenumber}{\pgfplots@error@coord}%
- \let\pgfplots@error@coord=\pgfmathresult
- % remember result here - will be used in case
- % of '+' AND '-' error bars:
- \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
- \if +##1%
- \def\pgfplots@loc@TMPb{add}%
- \else
- \def\pgfplots@loc@TMPb{subtract}%
- \fi
- \pgfplotscoordmath{#1}{op}{\pgfplots@loc@TMPb}{%
- {\csname pgfplots@current@point@#1\endcsname}%
- {\pgfplots@error@coord}%
+ \pgfplotscoordmath{#1}{if is bounded}{\pgfmathresult}{%
+ \let\pgfplots@error@coord=\pgfmathresult
+ % remember result here - will be used in case
+ % of '+' AND '-' error bars:
+ \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
+ \if +##1%
+ \def\pgfplots@loc@TMPb{add}%
+ \else
+ \def\pgfplots@loc@TMPb{subtract}%
+ \fi
+ \pgfplotscoordmath{#1}{op}{\pgfplots@loc@TMPb}{%
+ {\csname pgfplots@current@point@#1\endcsname}%
+ {\pgfplots@error@coord}%
+ }%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
+ }{%
+ % input is unbounded. Skip it.
}%
- \let\pgfplots@error@coord=\pgfmathresult
- \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
\fi
}%
\or% explicit relative:
@@ -4567,14 +3897,30 @@
\edef\pgfplots@error@coord{\csname pgfplots@current@point@#1@error\endcsname}%
\ifx\pgfplots@error@coord\pgfutil@empty
\else
- \pgfmathparse{1##1\pgfplots@error@coord}%
- \let\pgfplots@error@coord=\pgfmathresult
- \pgfplotscoordmath{#1}{multiply}{%
- {\csname pgfplots@current@point@#1\endcsname}
- {\pgfplots@error@coord}%
+ \pgfplotscoordmath{#1}{parsenumber}{\pgfplots@error@coord}%
+ \pgfplotscoordmath{#1}{if is bounded}{\pgfmathresult}{%
+ \let\pgfplots@error@coord=\pgfmathresult
+ % compute ' 1 + value' or '1-value':
+ \pgfplotscoordmath{#1}{one}%
+ \if +##1%
+ \def\pgfplots@loc@TMPb{add}%
+ \else
+ \def\pgfplots@loc@TMPb{subtract}%
+ \fi
+ \pgfplotscoordmath{#1}{op}{\pgfplots@loc@TMPb}{%
+ {\pgfmathresult}%
+ {\pgfplots@error@coord}%
+ }%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \pgfplotscoordmath{#1}{multiply}{%
+ {\csname pgfplots@current@point@#1\endcsname}
+ {\pgfplots@error@coord}%
+ }%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
+ }{%
+ % input is unbounded. Skip it.
}%
- \let\pgfplots@error@coord=\pgfmathresult
- \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
\fi
}%
\fi
@@ -4662,25 +4008,29 @@
\ifx\pgfplots@error@coord\pgfutil@empty
\else
\pgfplotscoordmath{default}{parsenumber}{\pgfplots@error@coord}%
- \let\pgfplots@error@coord=\pgfmathresult
- % remember result here - will be used in case
- % of '+' AND '-' error bars:
- \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
- \pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@current@point@#1@unfiltered\endcsname}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \if +##1%
- \def\pgfplots@loc@op{add}%
- \else
- \def\pgfplots@loc@op{subtract}%
- \fi
- \pgfplotscoordmath{default}{op}{\pgfplots@loc@op}{%
- {\pgfplots@loc@TMPa}%
- {\pgfplots@error@coord}%
+ \pgfplotscoordmath{default}{if is bounded}{\pgfmathresult}{%
+ \let\pgfplots@error@coord=\pgfmathresult
+ % remember result here - will be used in case
+ % of '+' AND '-' error bars:
+ \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
+ \pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@current@point@#1@unfiltered\endcsname}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \if +##1%
+ \def\pgfplots@loc@op{add}%
+ \else
+ \def\pgfplots@loc@op{subtract}%
+ \fi
+ \pgfplotscoordmath{default}{op}{\pgfplots@loc@op}{%
+ {\pgfplots@loc@TMPa}%
+ {\pgfplots@error@coord}%
+ }%
+ \pgfplotscoordmath{default}{tostring}{\pgfmathresult}%
+ \pgfplotscoordmath{#1}{log}{\pgfmathresult}%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
+ }{%
+ % input is unbounded. Skip it.
}%
- \pgfplotscoordmath{default}{tostring}{\pgfmathresult}%
- \pgfplotscoordmath{#1}{log}{\pgfmathresult}%
- \let\pgfplots@error@coord=\pgfmathresult
- \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
\fi
}%
%
@@ -4691,34 +4041,38 @@
\ifx\pgfplots@error@coord\pgfutil@empty
\else
\pgfplotscoordmath{default}{parsenumber}{\pgfplots@error@coord}%
- \let\pgfplots@error@coord=\pgfmathresult
- % remember result here - will be used in case
- % of '+' AND '-' error bars:
- \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
- %
- \pgfplotscoordmath{default}{one}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \if +##1%
- \def\pgfplots@loc@op{add}%
- \else
- \def\pgfplots@loc@op{subtract}%
- \fi
- \pgfplotscoordmath{default}{op}{\pgfplots@loc@op}{%
- {\pgfplots@loc@TMPa}%
- {\pgfplots@error@coord}%
- }%
- \pgfplotscoordmath{default}{tostring}{\pgfmathresult}%
- \pgfplotscoordmath{#1}{log}{\pgfmathresult}%
- \let\pgfplots@error@coord=\pgfmathresult
- \pgfplotscoordmath{#1}{if is bounded}{\pgfmathresult}{%
- \pgfplotscoordmath{#1}{op}{add}{%
- {\csname pgfplots@current@point@#1\endcsname}
+ \pgfplotscoordmath{default}{if is bounded}{\pgfmathresult}{%
+ \let\pgfplots@error@coord=\pgfmathresult
+ % remember result here - will be used in case
+ % of '+' AND '-' error bars:
+ \expandafter\let\csname pgfplots@current@point@#1@error\endcsname=\pgfmathresult
+ %
+ \pgfplotscoordmath{default}{one}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \if +##1%
+ \def\pgfplots@loc@op{add}%
+ \else
+ \def\pgfplots@loc@op{subtract}%
+ \fi
+ \pgfplotscoordmath{default}{op}{\pgfplots@loc@op}{%
+ {\pgfplots@loc@TMPa}%
{\pgfplots@error@coord}%
}%
+ \pgfplotscoordmath{default}{tostring}{\pgfmathresult}%
+ \pgfplotscoordmath{#1}{log}{\pgfmathresult}%
\let\pgfplots@error@coord=\pgfmathresult
- \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
+ \pgfplotscoordmath{#1}{if is bounded}{\pgfmathresult}{%
+ \pgfplotscoordmath{#1}{op}{add}{%
+ {\csname pgfplots@current@point@#1\endcsname}
+ {\pgfplots@error@coord}%
+ }%
+ \let\pgfplots@error@coord=\pgfmathresult
+ \csname pgfplots@PREPARE@errorbar@stream@it@#1\endcsname
+ }{%
+ % -> log( <= 0 ) -> do nothing.
+ }%
}{%
- % -> log( <= 0 ) -> do nothing.
+ % input is unbounded - do nothing.
}%
\fi
}%
@@ -4838,7 +4192,7 @@
% This unifies the approaches for \pgfplots@axiswide@metamax and
% \pgfplots@metamax.
\def\pgfplots@perpointmeta@preparetrafo@initfrom#1{%
- \edef\pgfplotspointmetarange{\csname #1metamin\endcsname:\csname #1max\endcsname}%
+ \edef\pgfplotspointmetarange{\csname #1metamin\endcsname:\csname #1metamax\endcsname}%
% Now, prepare the trafo as such.
% It assigns \pgfmathresult (in fixed point).
\def\pgfplots@perpointmeta@trafo##1{%
@@ -4848,12 +4202,16 @@
}{%
\pgfplotscoordmath{meta}{op}{subtract}{{##1}{\csname #1metamin\endcsname}}%
\pgfplotscoordmath{meta}{op}{multiply}{{\pgfmathresult}{\pgfplots@perpointmeta@trafo@factor}}%
+ \pgfplots@perpointmeta@trafo@clipresult
\pgfplotscoordmath{meta}{tofixed}{\pgfmathresult}%
}%
}%
\pgfplotscoordmath{meta}{op}{subtract}{{\csname #1metamax\endcsname}{\csname #1metamin\endcsname}}%
\let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{meta}{zero}%
+ \let\pgfplots@perpointmeta@lowerrange=\pgfmathresult
\pgfplotscoordmath{meta}{parsenumber}{1000}%
+ \let\pgfplots@perpointmeta@upperrange=\pgfmathresult
\pgfplotscoordmath{meta}{op}{divide}{{\pgfmathresult}{\pgfplots@loc@TMPa}}%
\let\pgfplots@perpointmeta@trafo@factor=\pgfmathresult
%
@@ -4867,6 +4225,24 @@
\edef\pgfplotspointmetarangeexponent{\the\c@pgf@countd}%
}
+\def\pgfplots@perpointmeta@trafo@clipresult{%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{meta}{if less than}{\pgfplots@loc@TMPa}{\pgfplots@perpointmeta@upperrange}{%
+ \pgfplotscoordmath{meta}{if less than}{\pgfplots@loc@TMPa}{\pgfplots@perpointmeta@lowerrange}{%
+ \let\pgfmathresult=\pgfplots@perpointmeta@lowerrange
+ }{%
+ \let\pgfmathresult=\pgfplots@loc@TMPa
+ }%
+ }{%
+ \let\pgfmathresult=\pgfplots@perpointmeta@upperrange
+ }%
+}%
+
+% define it globally - this simplifies some mesh plots.
+\pgfplotscoordmath{meta}{one}%
+\let\pgfplotspointmeta=\pgfmathresult
+\def\pgfplotspointmetatransformed{1000}% use the maximum because it is usually divided by 1000
+
% A command which is readily available during the visualization phase of each plot.
%
% It takes existing point meta data and transforms it, i.e. it defines
@@ -6548,6 +5924,11 @@
\ifpgfplots@curplot@threedim
\pgfplots@addplotimpl@table@check@createonuse@for{z}%
\fi
+ \pgfplots@addplotimpl@table@check@createonuse@for{x error}%
+ \pgfplots@addplotimpl@table@check@createonuse@for{y error}%
+ \ifpgfplots@curplot@threedim
+ \pgfplots@addplotimpl@table@check@createonuse@for{z error}%
+ \fi
\pgfplots@addplotimpl@table@check@createonuse@for{meta}%
\fi
%
@@ -7094,14 +6475,6 @@
\pgfplots@gettikzinternal@keyval{mark}{tikz@plot@mark}{}%
%
%
- \ifpgfplots@clip@limits
- \else
- % "clip marker paths=true" actually doesn't checks anything --
- % it leaves the checks to the clip path. But since there is no
- % clip path, it is adequate to use it here:
- \pgfplots@clip@marker@pathstrue
- \fi
- %
\pgfplots@perpointmeta@preparetrafo
%
\pgfplots@prepare@visualization@dependencies
@@ -7120,22 +6493,29 @@
\pgfplots@record@marker@streamfalse
\else
% we need markers.
- \ifx\pgfplots@basiclevel@plothandler\pgfplothandlerdiscard
- \ifpgfplots@clip@marker@paths
- % only marks: draw markers directly; no need for the
- % two-pass-approach.
- \let\pgfplots@basiclevel@plothandler=\relax
- \pgfplots@install@plotmark@handler
- \pgfplots@record@marker@streamfalse
+ \pgfkeysgetvalue{/pgfplots/mark layer}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ % no special mark layer. Good!
+ \ifx\pgfplots@basiclevel@plothandler\pgfplothandlerdiscard
+ \ifpgfplots@clip@marker@paths
+ % only marks: draw markers directly; no need for the
+ % two-pass-approach.
+ \let\pgfplots@basiclevel@plothandler=\relax
+ \pgfplots@install@plotmark@handler
+ \pgfplots@record@marker@streamfalse
+ \else
+ % collect mark positions... they will be drawn after
+ % the clipped axis range. Clipping will only be
+ % applied to their *positions*, not their paths.
+ \pgfplots@record@marker@streamtrue
+ \fi
\else
- % collect mark positions... they will be drawn after
- % the clipped axis range. Clipping will only be
- % applied to their *positions*, not their paths.
+ % ok, mark!=none and we also have a plot handler.
+ % So, collect mark positions!
\pgfplots@record@marker@streamtrue
\fi
\else
- % ok, mark!=none and we also have a plot handler.
- % So, collect mark positions!
+ % we need to prepare for a separate mark layer:
\pgfplots@record@marker@streamtrue
\fi
\fi
@@ -7234,8 +6614,17 @@
}
% Takes the current point (defined by a set of macros) as input and defines \pgf@x and \pgf@y
-% as the output point.
+% as the output point. It also defines
+% \pgfplots@current@point@x and its variants to contain the
+% transformed canvas coords (those which can be given to
+% \pgfplotsqpointxyz).
+%
+% Furthermore, it defines keys '/data point/x untransformed' to
+% contain the untransformed coords.
\def\pgfplotsaxisvisphasegetpoint{%
+ \pgfkeyslet{/data point/x untransformed}\pgfplots@current@point@x
+ \pgfkeyslet{/data point/y untransformed}\pgfplots@current@point@y
+ \pgfkeyslet{/data point/z untransformed}\pgfplots@current@point@z
\pgfplotsaxisvisphasetransformcoordinate\pgfplots@current@point@x\pgfplots@current@point@y\pgfplots@current@point@z%
\pgfplotsaxisvisphasepreparedatapoint
\ifpgfplots@curplot@threedim
@@ -7615,6 +7004,15 @@
\def\pgfplots@coord@stream@finalize@storedcoords@START@coords{#1}%
\fi
\pgfplots@assert@tikzinternal@exists{tikz@make@last@position}%
+ %
+ \ifpgfplots@clip
+ \else
+ % "clip marker paths=true" actually doesn't checks anything --
+ % it leaves the checks to the clip path. But since there is no
+ % clip path, it is adequate to use it here:
+ \pgfplots@clip@marker@pathstrue
+ \fi
+ %
\pgfplots@stored@current@cmd%[current plot style] <--- options are already set
\pgfextra
\tikzset{every plot/.try}%
@@ -7633,19 +7031,30 @@
%
\ifx\pgfplots@recorded@marker@stream\pgfutil@empty
\else
- \ifpgfplots@clip@marker@paths
- % Draw markers on top of the plot lines:
- %
- \pgfplots@stored@current@cmd%[current plot style] <--- options are already set
- \pgfextra
- \pgfplots@install@plotmark@handler
- \pgfplots@recorded@marker@stream
- \endpgfextra
- ;
+ \pgfkeysgetvalue{/pgfplots/mark layer}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \ifpgfplots@clip@marker@paths
+ % Draw markers on top of the plot lines:
+ %
+ \pgfplots@stored@current@cmd%[current plot style] <--- options are already set
+ \pgfextra
+ \pgfplots@install@plotmark@handler
+ \pgfplots@recorded@marker@stream
+ \endpgfextra
+ ;
+ \else
+ % sigh... ok, store the marker list (once more again).
+ % They need to be drawn after the clipped area.
+ %
+ % fortunately, the serialization is not expensive.
+ \pgfplots@stored@REMEMBER@MARK@COMMAND
+ \fi
\else
- % sigh... ok, store the marker list (once more again).
- % They need to be drawn after the clipped area.
- \pgfplots@stored@REMEMBER@MARK@COMMAND
+ % oh - we need a mark layer!
+ \pgfplotsonlayer{\pgfkeysvalueof{/pgfplots/mark layer}}{mark layer}%
+ \pgfplots@serialize@mark@command
+ \pgfplotsretval
+ \endpgfplotsonlayer
\fi
\fi
\gdef\pgfplots@recorded@marker@stream{}% clear
@@ -7658,6 +7067,33 @@
% - pgfplots@recorded@marker@stream exists
% - current plot style is valid
\def\pgfplots@stored@REMEMBER@MARK@COMMAND{%
+ \pgfplots@serialize@mark@command
+ \ifpgfplots@clip
+ \if2\pgfplots@clipmode
+ % clip mode=individual:
+ \global\let\pgfplots@stored@markerlist@last=\pgfplotsretval
+ \else
+ % clip mode=global
+ \expandafter\pgfplotslistpushbackglobal\expandafter{\pgfplotsretval}\to\pgfplots@stored@markerlist
+ \fi
+ \fi
+}%
+
+\def\pgfplots@execute@at@begin@plot@visualization@internal{%
+ \global\let\pgfplots@stored@markerlist@last=\relax
+}%
+
+\def\pgfplots@execute@at@end@plot@visualization@internal{%
+ \ifpgfplots@clip
+ \if2\pgfplots@clipmode
+ % clip=true and 'clip mode=individually'
+ \pgfplots@stored@markerlist@last
+ \global\let\pgfplots@stored@markerlist@last=\relax
+ \fi
+ \fi
+}%
+
+\def\pgfplots@serialize@mark@command{%
\pgfkeysgetvalue{/tikz/current plot style/.@cmd}{\pgfplots@loc@TMPa}%
\t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa\pgfeov}%
\t@pgfplots@tokb=\expandafter{\pgfplots@stored@current@cmd[current plot style]}%
@@ -7685,8 +7121,11 @@
}%
\t@pgfplots@toka=\expandafter{\pgfplots@loc@TMPa}%
\t@pgfplots@tokb=\expandafter{\pgfplots@stored@current@precmd}%
- \edef\pgfplots@loc@TMPa{\the\t@pgfplots@tokb\the\t@pgfplots@toka}%
- \expandafter\pgfplotslistpushbackglobal\expandafter{\pgfplots@loc@TMPa}\to\pgfplots@stored@markerlist
+ \edef\pgfplotsretval{%
+ \noexpand\scope% make sure that 'fill opacity' and 'dotted' styles remain local!
+ \the\t@pgfplots@tokb
+ \the\t@pgfplots@toka
+ \noexpand\endscope}%
}%
\def\pgfplots@install@plotmark@handler{%
@@ -7759,11 +7198,17 @@
\the\t@pgfplots@tokc
}%
\fi
- \ifx\tikz@mark@list\pgfutil@empty%
- \expandafter\pgfplothandlermark\expandafter{\pgfplots@loc@TMPa}%
- \else
- \expandafter\pgfplothandlermarklisted\expandafter{\pgfplots@loc@TMPa}{\tikz@mark@list}%
- \fi
+ \def\pgfplots@loc@TMPb##1{%
+ \ifx\tikz@mark@list\pgfutil@empty%
+ \pgfplothandlermark{##1}%
+ \else
+ \pgfplothandlermarklisted{##1}{\tikz@mark@list}%
+ \fi
+ }%
+ \t@pgfplots@tokc=\expandafter\expandafter\expandafter{\expandafter\pgfplots@loc@TMPb\expandafter{\pgfplots@loc@TMPa}}%
+ \edef\pgfplots@basiclevel@plothandler{\the\t@pgfplots@tokc}%
+ %
+ \pgfplots@basiclevel@plothandler
}%
@@ -7980,7 +7425,7 @@
-% the low-level Tikz command which realizes 'plot graphics'.
+% the low-level Tikz command which implements 'plot graphics'.
%
% It's current state is described by some pgfkeys options and two
% coordinates.
@@ -8324,11 +7769,21 @@
\fi
%
%
+ \if1\b@pgfplots@compat@plot@graphics@threedim
+ \pgfplots@warning{plot3 graphics is running in backwards compatibility mode. %
+ Use \string\pgfplotsset{compat=1.6} or higher to benefit from upgraded scaling capabilites.}%
+ \else
+ \fi
+ %
\edef\pgfplotsretval{%
x={(\pgfplots@xx,\pgfplots@xy)},%
y={(\pgfplots@yx,\pgfplots@yy)},%
z={(\pgfplots@zx,\pgfplots@zy)},%
scale mode=scale uniformly,%
+ \if1\b@pgfplots@compat@plot@graphics@threedim
+ % this is the only strategy pre 1.6
+ scale uniformly strategy=change vertical limits,%
+ \fi
}%
%
\if1\pgfplotsplothandlergraphicspointmapcomputerequiredview@debug
@@ -8382,6 +7837,8 @@
\def\n{^^J}%
\def\t{^^I}%
\immediate\write\w@pgf@writea{canvasmapmatrix=[\pgfplotsmatrix@text];^^Jcanvasmaprhs = [\pgfplotsrhs@text];^^J}%
+ %
+ \immediate\write\w@pgf@writea{key configuration = \pgfplotsretval;^^J}%
\immediate\closeout\w@pgf@writea
\endgroup
}%
@@ -8860,6 +8317,7 @@
%\message{z buffer=auto mode chose z buffer= \ifcase\pgfplotsplothandlermesh@zbuffer@choice NONE \or reverse x seq \or reverse y seq \or reverse xy seq \or sort\or default \fi. mesh ordering = \ifcase\pgfplots@plot@mesh@ordering x varies/rowwise\or y varies/colwise\fi}%
% 'z buffer' is no longer 'auto' now:
\pgfplots@apply@zbuffer{#1}%
+ \pgfmath@smuggleone\pgfplotsplothandlermesh@zbuffer@choice
\endgroup
\else
% mesh input=patches
@@ -8973,19 +8431,20 @@
% '#1' is BEHIND #2 with respect to the current 3D view.
\def\pgfplots@apply@zbuffer@SORT@iflessthan#1#2#3#4\pgfeov{%
\pgfplotsaxisdeserializedatapointfrom{#1}%
- \pgfplotsmathfloatviewdepthxyz{\pgfplots@current@point@x}{\pgfplots@current@point@y}{\pgfplots@current@point@z}%
- \let\pgfplots@apply@zbuffer@SORT@iflessthan@a=\pgfmathresult
+ \pgfplotsmathvectorfromstring{\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z}{default}%
+ \pgfplotsmathvectorscalarproduct{\pgfplots@view@dir@threedim}{\pgfplotsretval}{default}%
+ \let\pgfplots@apply@zbuffer@SORT@iflessthan@a=\pgfplotsretval
%
\pgfplotsaxisdeserializedatapointfrom{#2}%
- \pgfplotsmathfloatviewdepthxyz{\pgfplots@current@point@x}{\pgfplots@current@point@y}{\pgfplots@current@point@z}%
- \let\pgfplots@apply@zbuffer@SORT@iflessthan@b=\pgfmathresult
+ \pgfplotsmathvectorfromstring{\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z}{default}%
+ \pgfplotsmathvectorscalarproduct{\pgfplots@view@dir@threedim}{\pgfplotsretval}{default}%
+ \let\pgfplots@apply@zbuffer@SORT@iflessthan@b=\pgfplotsretval
%
- \pgfmathfloatlessthan@{\pgfplots@apply@zbuffer@SORT@iflessthan@b}{\pgfplots@apply@zbuffer@SORT@iflessthan@a}%
- \ifpgfmathfloatcomparison
+ \pgfplotscoordmath{default}{if less than}{\pgfplots@apply@zbuffer@SORT@iflessthan@b}{\pgfplots@apply@zbuffer@SORT@iflessthan@a}{%
#3\relax
- \else
+ }{%
#4\relax
- \fi
+ }%
}%
@@ -8997,53 +8456,51 @@
% The arguments need to be numbers (will be parsed with
% \pgfmathfloatparsenumber).
% @see \pgfplotsmathviewdepthxyz
+% DEPRECATED use \pgfplotsmathvectorviewdepth instead!
\def\pgfplotsmathfloatviewdepthxyz#1#2#3{%
+ \begingroup
\pgfmathfloatparsenumber{#1}\let\pgfplots@loc@TMPa=\pgfmathresult
\pgfmathfloatparsenumber{#2}\let\pgfplots@loc@TMPb=\pgfmathresult
\pgfmathfloatparsenumber{#3}\let\pgfplots@loc@TMPc=\pgfmathresult
\edef\pgfplots@loc@TMPa{{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPc}}%
\expandafter\pgfplotsmathfloatviewdepthxyz@\pgfplots@loc@TMPa
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+% #1: a 3d vector of the form x,y,z in 'default' coordmath format
+% defines \pgfplotsretval to the view depth
+% of the point
+%
+% Use \pgfplotsmathvectorfromstring{x,y,z}{default} to transform a
+% vector into the requested format.
+%
+% Use \pgfplotscoordmath{default}{tofixed}{\pgfplotsretval} to
+% transform the result into fixed point representation.
+\def\pgfplotsmathvectorviewdepth#1{%
+ \pgfplotsmathvectorscalarproduct{#1}{\pgfplots@view@dir@threedim}{default}%
}%
\def\pgfplotsmathfloatviewdepthxyz@#1#2#3{%
\pgfplots@error{Sorry, you can't use \string\pgfplotsmathfloatviewdepthxyz\space in this context.}%
}%
\def\pgfplotsmathfloatviewdepthxyz@infigure#1#2#3{%
- \pgfmathfloatmultiplyfixed@{#1}{\pgfplots@view@dir@threedim@x}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \pgfmathfloatmultiplyfixed@{#2}{\pgfplots@view@dir@threedim@y}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \pgfmathfloatadd@{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPb}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \ifpgfplots@curplot@threedim
- \pgfmathfloatmultiplyfixed@{#3}{\pgfplots@view@dir@threedim@z}%
- \let\pgfplots@loc@TMPc=\pgfmathresult
- \pgfmathfloatadd@{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPc}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \fi
- \let\pgfmathresult=\pgfplots@loc@TMPb
+ \pgfplotsmathvectorfromstring{\pgfplots@view@dir@threedim}{float}%
+ \pgfplotsmathvectorscalarproduct{#1,#2,#3}{\pgfplotsretval}{float}% FIXME : \pgfplots@view@dir@threedim might have a different math format!
+ \let\pgfmathresult=\pgfplotsretval
}%
% Similar to \pgfplotsmathfloatviewdepthxyz, but this always relies on
% fixed point arithmetics.
+% DEPRECATED use \pgfplotsmathvectorviewdepth instead
\def\pgfplotsmathviewdepthxyz#1#2#3{\pgfplotsmathviewdepthxyz@{#1}{#2}{#3}}
\def\pgfplotsmathviewdepthxyz@#1#2#3{%
\pgfplots@error{Sorry, you can't use \string\pgfplotsmathviewdepthxyz\space in this context.}%
}
\def\pgfplotsmathviewdepthxyz@infigure#1#2#3{%
- \pgfmath@basic@multiply@{#1}{\pgfplots@view@dir@threedim@x}%
- \let\pgfplots@loc@TMPa=\pgfmathresult
- \pgfmath@basic@multiply@{#2}{\pgfplots@view@dir@threedim@y}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \pgfmath@basic@add@{\pgfplots@loc@TMPa}{\pgfplots@loc@TMPb}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \ifpgfplots@curplot@threedim
- \pgfmath@basic@multiply@{#3}{\pgfplots@view@dir@threedim@z}%
- \let\pgfplots@loc@TMPc=\pgfmathresult
- \pgfmath@basic@add@{\pgfplots@loc@TMPb}{\pgfplots@loc@TMPc}%
- \let\pgfplots@loc@TMPb=\pgfmathresult
- \fi
- \let\pgfmathresult=\pgfplots@loc@TMPb
+ \pgfplotsmathvectorfromstring{\pgfplots@view@dir@threedim@unitlength}{pgfbasic}%
+ \pgfplotsmathvectorscalarproduct{#1,#2,#3}{\pgfplotsretval}{pgfbasic}% FIXME : \pgfplots@view@dir@threedim might have a different math format!
+ \let\pgfmathresult=\pgfplotsretval
}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex
index fe6106f4380..35f64d032dd 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotscore.code.tex
@@ -27,6 +27,7 @@
\def\pgfplotsset#{\pgfqkeys{/pgfplots}}
+\def\pgfplots@log#1#2{\immediate\write-1{Package pgfplots info: #2}}%
\def\pgfplots@error#1{\PackageError{pgfplots}{#1}{}}%
\def\pgfplotstable@error@pkg#1{\PackageError{pgfplotstable}{#1}{}}%
\def\pgfplots@warning#1{\pgfplots@message{! Package pgfplots Warning: #1}}%
@@ -90,6 +91,15 @@
\fi
\let#1=\pgfutil@empty
},%
+ % #1 : the layer name
+ % #2 : additional context information (message)
+ /pgfplots/exception/inactive layer/.code 2 args={%
+ \ifx\pgfplotsexceptionmsg\relax
+ \pgfplots@error{Sorry, the layer '#1' has not been activated but it is referenced in #2. Perhaps you misspelled it? Each referenced layer must be activated (expect for layer 'discard').}%
+ \else
+ \pgfplots@error{\pgfplotsexceptionmsg}%
+ \fi
+ },%
% #1: the argument which should have been assigned.
% #2: an error message.
/pgfplots/exception/no such element/.code 2 args={%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
index 5084cd21b1e..8641fed58aa 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
@@ -246,14 +246,20 @@
%%
%% Helper structs for patch plots (surfaces)
-\def\pgfplotspatchvertex#1#2#3#4\endvertex{%
- \def\pgfplotspatchvertexstruct{{#1}{#2}{#3}#4}%
+% #1: the canvas x coordinate
+% #2: the canvas y coordinate
+% #3: the point meta data (cdata)
+% #4: the vertex'es depth (if required)
+% #5: the 3d coordinates of the vertex (will only be stored if it is deemed necessary)
+\def\pgfplotspatchvertex#1#2#3#4:#5\endvertex{%
+ \def\pgfplotspatchvertexstruct{{#1}{#2}{#3}#4:#5}%
\def\pgfplotspatchvertexx{#1}%
\def\pgfplotspatchvertexy{#2}%
\def\pgfplotspatchvertexmeta{#3}%
\def\pgfplotspatchvertexdepth{#4}%
+ \def\pgfplotspatchvertexcoords{#5}%
}%
-\def\pgfplotspointpatchvertex#1#2#3#4\endvertex{%
+\def\pgfplotspointpatchvertex#1#2#3#4:#5\endvertex{%
\global\pgf@x=#1
\global\pgf@y=#2
}%
@@ -275,36 +281,36 @@
\pgf@yb=0pt
\pgfplotscoordmath{meta}{zero}%
}%
-\def\pgfplotspatchvertexadd#1#2#3#4\times#5{%
+\def\pgfplotspatchvertexadd#1#2#3#4:#5\times#6{%
\global\pgf@x=#1
\global\pgf@y=#2
- \advance\pgf@xa by#5\pgf@x
- \advance\pgf@ya by#5\pgf@y
+ \advance\pgf@xa by#6\pgf@x
+ \advance\pgf@ya by#6\pgf@y
\let\pgfmathresult@=\pgfmathresult
- \pgfplotscoordmath{meta}{parsenumber}{#5}%
+ \pgfplotscoordmath{meta}{parsenumber}{#6}%
\pgfplotscoordmath{meta}{op}{multiply}{{#3}{\pgfmathresult}}%
\pgfplotscoordmath{meta}{op}{add}{{\pgfmathresult@}{\pgfmathresult}}%
\def\pgfplotspatchvertexdepth{#4}%
\ifx\pgfplotspatchvertexdepth\pgfutil@empty
\else
\global\pgf@y=#4pt
- \advance\pgf@yb by#5\pgf@y
+ \advance\pgf@yb by#6\pgf@y
\fi
}%
\def\pgfplotspatchvertexfinish#1{%
- \edef#1{{\the\pgf@xa}{\the\pgf@ya}{\pgfmathresult}\ifx\pgfplotspatchvertexdepth\pgfutil@empty\else\pgf@sys@tonumber\pgf@yb\fi}%
+ \edef#1{{\the\pgf@xa}{\the\pgf@ya}{\pgfmathresult}\ifx\pgfplotspatchvertexdepth\pgfutil@empty\else\pgf@sys@tonumber\pgf@yb\fi:}%
}
% Same as \pgfplotspatchvertexadd, but it only adds the X and Y
% coordinates (ignoring the rest).
-\def\pgfplotspatchvertexaddXY#1#2#3#4\times#5{%
+\def\pgfplotspatchvertexaddXY#1#2#3#4:#5\times#6{%
\global\pgf@x=#1
\global\pgf@y=#2
- \advance\pgf@xa by#5\pgf@x
- \advance\pgf@ya by#5\pgf@y
+ \advance\pgf@xa by#6\pgf@x
+ \advance\pgf@ya by#6\pgf@y
}%
% Same as \pgfplotspatchvertexfinish, but it only saves X and Y.
\def\pgfplotspatchvertexfinishXY#1{%
- \edef#1{{\the\pgf@xa}{\the\pgf@ya}{}}%
+ \edef#1{{\the\pgf@xa}{\the\pgf@ya}{}:}%
}
% #1 class name
@@ -415,6 +421,9 @@
recursive refine@={%
\pgfplots@error{refine: not yet implemented for \pgfplotspatchclassname}%
},%
+ compute normal={%
+ \pgfplotsplothandlermesh@compute@normal@default
+ },%
}%
}{}%
%
@@ -580,8 +589,80 @@
get pdf shading type/.style={get pdf shading type*={\def\pgfplotsretval{#1}}},
get pdf shading type*/.code=
{\expandafter\def\csname pgfpptch\pgfplotsdeclarepatchclass@ get pdf shading type\endcsname{#1}},%
+ %
+ % A method which defines \pgfplotsretval to be the normal of the current segment.
+ % The values will be given in a format understood by
+ % \pgfplotsmathvectortostring{\pgfplotsretval}{default}
+ %
+ % This method REQUIRES that 3d coordinates are stored (see \pgfplotsplothandlermesh@serialize@logical@coords).
+ compute normal/.code=
+ {\expandafter\def\csname pgfpptch\pgfplotsdeclarepatchclass@ compute normal\endcsname{#1}},%
}
+% This implements 'compute normal' :
+\def\pgfplotsplothandlermesh@compute@normal@default{%
+ \begingroup
+ \c@pgf@countd=0
+ \pgfplotspatchclass{\pgfplotspatchclassname}{foreach vertex}{%
+ \ifx\pgfplotspatchvertexcoords\pgfutil@empty
+ \pgfplotsplothandlermesh@compute@normal@error
+ \fi
+ \pgfplotsmathvectorfromstring{\pgfplotspatchvertexcoords}{default}%
+ \expandafter\let\csname point\the\c@pgf@countd\endcsname=\pgfplotsretval
+ \let\pointlast=\pgfplotsretval
+ \advance\c@pgf@countd by1 %
+ }%
+ \pgfplotsmathvectorsubtract{\csname point1\endcsname}{\csname point0\endcsname}{default}%
+ \let\diffA=\pgfplotsretval
+ % Hm. usually, I would use \point2 here... but it turned out that
+ % the result looks ugly for rectangular patches -- so I used the
+ % last point instead (which is, at least, consistent with the
+ % patch boundaries)
+ \pgfplotsmathvectorsubtract{\csname pointlast\endcsname}{\csname point0\endcsname}{default}%
+ \let\diffB=\pgfplotsretval
+ \pgfplotsmathvectorcrossprod{\diffA}{\diffB}{default}%
+ \let\crossAB=\pgfplotsretval
+ % this here is an experiment to use the MEAN of two normal
+ % vectors for rectangular patches... but it did not work as good
+ % as expected:
+ % \pgfplotspatchclass{\pgfplotspatchclassname}{get num vertices}%
+ % \ifnum\pgfplotsretval=4
+ % \pgfplotsmathvectorsubtract{\csname point3\endcsname}{\csname point0\endcsname}{default}%
+ % \let\diffC=\pgfplotsretval
+ % \pgfplotsmathvectorcrossprod{\diffB}{\diffC}{default}%
+ % \let\crossBC=\pgfplotsretval
+ % \pgfplotsmathvectoradd{\crossAB}{\crossBC}{default}%
+ % \pgfplotscoordmath{default}{parsenumber}{0.5}%
+ % \pgfplotsmathvectorscale{\pgfplotsretval}{\pgfmathresult}{default}%
+ % \let\normal=\pgfplotsretval
+ % \else
+ \let\normal=\crossAB
+ %\fi
+ %
+ % specific choices of z buffering change the sequence of points.
+ % If the number of reversals is off, we need to switch the
+ % normal's sign:
+ \def\pgfplots@switch@normal@dir{0}%
+ \if1\pgfplotsplothandlermesh@zbuffer@choice
+ % z buffer=reverse x seq
+ \def\pgfplots@switch@normal@dir{1}%
+ \else
+ \if2\pgfplotsplothandlermesh@zbuffer@choice
+ % z buffer=reverse y seq
+ \def\pgfplots@switch@normal@dir{1}%
+ \fi
+ \fi
+ \if1\pgfplots@switch@normal@dir
+ \pgfplotscoordmath{default}{parsenumber}{-1}%
+ \pgfplotsmathvectorscale{\normal}{\pgfmathresult}{default}%
+ \fi
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsplothandlermesh@compute@normal@error{%
+ \pgfplots@error{Cannot compute normal vectors: due to some reason, only canvas coordinates of the involved patch are available in this context, but the original input coordinates are required. This indicates an incompatible combination of variables (sorry). Please report this as a bug}%
+}%
+
\def\pgfplotspatchclass@recursiverefine#1{%
\c@pgf@counta=#1
\ifnum\c@pgf@counta=1
@@ -885,8 +966,8 @@
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set edge visible}10%
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set edge visible}21%
\expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotspatchclass@rect@A}%
- \expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotspatchclass@rect@D}%
\expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotspatchclass@rect@B}%
+ \expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotspatchclass@rect@D}%
%
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set edge visible}01%
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set edge visible}11%
@@ -1174,6 +1255,17 @@
\if\pgfplotsplothandlermesh@zbuffer@choice4% 'z buffer=sort':
\def\b@pgfplotsplothandlermesh@matrixoutput{0}%
\fi
+ %
+ \if2\pgfplotsplothandlermesh@shader
+ % shader=interp
+ %
+ \pgfkeysgetvalue{/pgfplots/mesh/interior colormap name}\pgfplots@loc@TMPc
+ \ifx\pgfplots@loc@TMPc\pgfutil@empty
+ \else
+ \pgfplots@warning{the combination 'shader=interp,interior colormap name' is inefficient (it uses 'shader=faceted interp,faceted color=none') and may slow down the *display* of your document}%
+ \pgfplotsset{shader=faceted interp,faceted color=none}%
+ \fi
+ \fi
\if2\pgfplotsplothandlermesh@shader
\else
% 'shader!=interp'
@@ -1194,8 +1286,8 @@
% no matrix output possible
\if5\pgfplotsretval
% pdf shading type=5 (matrix output)
- \ifnum\pgfplotsplothandlermesh@shader>1
- % shader=interp or shader=faceted interp
+ \if2\pgfplotsplothandlermesh@shader
+ % shader=interp
%
% oh. shading type=5 is *essentially* the same as
% matrix output, but matrix output is forbidden.
@@ -1203,6 +1295,9 @@
% triangles:
\def\pgfplotsplothandlermesh@triangulate{1}%
\def\pgfplotsplothandlermesh@patchclass@output{triangle}%
+ % Note shader=faceted interp can be written as
+ % matrix -- it shades individual elements anyway;
+ % and one single patch can be written as matrix.
\fi
\fi
\fi
@@ -1235,6 +1330,12 @@
% handling of jumps.
\pgfplotsplothandlermesh@init@jumphandling
%
+ \ifpgfplotsplothandlermesh@shownormals
+ \let\pgfplotsplothandlermesh@show@normals@if@configured=\pgfplotsplothandlermesh@show@normals
+ % actually store 3d coordinates:
+ \let\pgfplotsplothandlermesh@serialize@logical@coords=\pgfplotsplothandlermesh@serialize@logical@coords@doit
+ \fi
+ %
% z buffering:
\pgfplotsplothandlermesh@init@zbuffer
%
@@ -1245,6 +1346,46 @@
}%
\def\pgfplotsplothandlermesh@patchclass@defaulttext{default}%
+% implements 'show normals'. Keep in mind that this is more-or-less a
+% debugging helper, not productive code.
+\def\pgfplotsplothandlermesh@show@normals{%
+ \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{compute normal}%
+ \let\pgfplots@normal@vector=\pgfplotsretval
+%\pgfplotsmathvectortostring\pgfplots@normal@vector{default}%
+%\message{got normal \pgfplotsretval^^J}%
+ \pgfplotsmathvectorlength{\pgfplots@normal@vector}{default}%
+ \pgfplotscoordmath{default}{parsenumber}{\pgfkeysvalueof{/pgfplots/mesh/show normals length factor}}% FIXME
+ \pgfplotscoordmath{default}{op}{divide}{{\pgfmathresult}{\pgfplotsretval}}%
+ \pgfplotsmathvectorscale{\pgfplots@normal@vector}{\pgfmathresult}{default}%
+ %\pgfplotsmathvectoradd{\pgfplotspatchvertexcoords}{\pgfplotsretval}{default}%
+ \let\pgfplots@normal@vector=\pgfplotsretval
+ %
+ \draw[/pgfplots/every patch normal]
+ \pgfextra{%
+ \pgfpathmoveto
+ {%
+ \pgf@process{%
+ \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{get num vertices}%
+ \pgfmath@basic@reciprocal@{\pgfplotsretval}%
+ \let\scale=\pgfmathresult
+ \pgfplotspatchvertexaccumstart
+ \pgfplotspatchclass{\pgfplotspatchclassname}{foreach vertex}{%
+ \expandafter\pgfplotspatchvertexadd\pgfplotspatchvertexstruct\times{\scale}%
+ }%
+ \pgfplotspatchvertexfinishXY{\pgfplots@loc@TMPa}%
+ \expandafter\pgfplotspointpatchvertex\pgfplots@loc@TMPa\endvertex%
+ }%
+ }%
+ \edef\pgfplots@loc@TMPa{\pgf@x=\the\pgf@x\space\pgf@y=\the\pgf@y\space}%
+ %
+ \pgfpathlineto{%
+ \pgfpointadd
+ {\pgfplots@loc@TMPa}
+ {\pgfplotspointfromcsvvector\pgfplots@normal@vector{default}}%
+ }%
+ }%
+ ;
+}%
% Defines \pgfplotsretval to be either empty or the current point's
% depth according to z buffer information.
@@ -1255,10 +1396,44 @@
% contain the view depth.
%
\def\pgfplotsplothandlermesh@compute@vertex@depth@doit{%
- \pgfplotsmathviewdepthxyz{\pgfplots@current@point@x}{\pgfplots@current@point@y}{\pgfplots@current@point@z}% FIXME relies on pgfplots macros
+ \pgfplotsmathvectorfromstring{\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z}{default}%
+ \pgfplotsmathvectorviewdepth{\pgfplotsretval}%
+ \pgfplotscoordmath{default}{tofixed}{\pgfplotsretval}%
\edef\pgfplotsretval{\pgfmathresult}%
}%
+% A command which defines \pgfplotsretval to be either empty or to
+% the (x,y,z) 3d coordinates of the data point. Usually, the data
+% scaling transformation will already be applied to these points.
+%
+% Note that this is unnecessary for most applications of mesh plots.
+%
+% The resulting value will be available as \pgfplotspatchvertexcoords
+\def\pgfplotsplothandlermesh@serialize@logical@coords{%
+ % empty by default
+ \let\pgfplotsretval=\pgfutil@empty
+}%
+\def\pgfplotsplothandlermesh@serialize@logical@coords@doit{%
+ \ifx\pgfplots@current@point@x\pgfutil@empty
+ \let\pgfplotsretval=\pgfutil@empty
+ \else
+ % note that these points are the result of the data scaling
+ % trafo. That is OK because the view normal is also in the
+ % same coordinate space.
+ \pgfplotsmathvectorfromstring{\pgfplots@current@point@x,\pgfplots@current@point@y,\pgfplots@current@point@z}{default}%
+ \fi
+}
+
+% the inverse for \pgfplotsplothandlermesh@serialize@logical@coords: it defines \pgfplots@current@point@[xyz].
+% You should only call it if you know that there IS something to deserialize.
+\def\pgfplotsplothandlermesh@deserialize@logical@coords#1{%
+ \expandafter\pgfplotsplothandlermesh@deserialize@logical@coords@#1\relax
+}%
+\def\pgfplotsplothandlermesh@deserialize@logical@coords@#1,#2,#3\relax{%
+ \def\pgfplots@current@point@x{#1}%
+ \def\pgfplots@current@point@y{#2}%
+ \def\pgfplots@current@point@z{#3}%
+}%
% The patch visualization works like a PIPELINE:
%
@@ -1285,9 +1460,11 @@
\def\pgfplotsplothandlermesh@PIPE@DECODE#1{%
\let\pgfplotsplothandlermesh@patchclass\pgfplotsplothandlermesh@patchclass@input
\pgfplotsplothandlermesh@compute@vertex@depth% <-- this modifies \pgfplotsretval
+ \let\pgfplots@view@depth=\pgfplotsretval
\pgf@process{#1}%
% calls \pgfplotspatchready when ready
- \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set next vertex}{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplotsretval}%%
+ \pgfplotsplothandlermesh@serialize@logical@coords
+ \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{set next vertex}{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplots@view@depth:\pgfplotsretval}%%
}%
\def\pgfplotspatchready{%
\pgfplotsplothandlermesh@PIPE@CHECKJUMP
@@ -1310,6 +1487,11 @@
% invoked when a patch is completely processed.
% This might be replaced by the z buffering algorithm
\def\pgfplotsplothandlermesh@PIPE@FINISH{%
+ \pgfplotsplothandlermesh@PIPE@interior@exterior@styles
+}%
+
+\def\pgfplotsplothandlermesh@PIPE@interior@exterior@styles{%
+ \pgfplotsplothandlermesh@interior@exterior@hook
\pgfplotsplothandlermesh@VISUALIZE
}%
@@ -1318,11 +1500,14 @@
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{fill path}%
\pgfplotsplothandlermesh@definecolor
\pgfplotsplothandlermesh@usepath
+ \pgfplotsplothandlermesh@show@normals@if@configured
}%
\let\pgfplotsplothandlermesh@VISUALIZE@std=\pgfplotsplothandlermesh@VISUALIZE@std@fill@andor@stroke
\let\pgfplotsplothandlermesh@VISUALIZE=\pgfplotsplothandlermesh@VISUALIZE@std
+\let\pgfplotsplothandlermesh@show@normals@if@configured\relax
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\pgfplotsplothandlermesh@init@DECODE{%
@@ -1582,10 +1767,87 @@
\fi
}%
+\let\pgfplotsplothandlermesh@interior@exterior@hook=\relax
+\def\pgfplotsplothandlermesh@interior@exterior@hook@active@zerothresh{%
+ \begingroup
+ \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{compute normal}%
+% \let\pgfplots@normal=\pgfplotsretval
+% \pgfplotsmathvectorlength{\pgfplotsretval}{default}%
+% \pgfplotscoordmath{default}{op}{reciprocal}{{\pgfplotsretval}}%
+% \pgfplotsmathvectorscale{\pgfplots@normal}{\pgfmathresult}{default}%
+ %
+ \pgfplotsmathvectorscalarproduct{\pgfplots@view@dir@threedim}{\pgfplotsretval}{default}%
+ \pgfplotscoordmath{default}{if is}{\pgfplotsretval}{-}{%
+ % <0:
+ \global\let\pgfplots@glob@TMPc\pgfplotsplothandlermesh@is@interior
+ }{%
+ % >=0:
+ \global\let\pgfplots@glob@TMPc\pgfplotsplothandlermesh@is@exterior
+ }%
+ \endgroup
+ \pgfplots@glob@TMPc
+}%
+
+\def\pgfplotsplothandlermesh@interior@exterior@hook@active{%
+ \begingroup
+ \pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{compute normal}%
+ \let\pgfplots@normal=\pgfplotsretval
+ \pgfplotsmathvectorlength{\pgfplotsretval}{default}%
+ \let\pgfplots@normal@len=\pgfplotsretval
+ %
+ \pgfplotsmathvectorscalarproduct{\pgfplots@view@dir@threedim}{\pgfplots@normal}{default}%
+ \let\pgfplots@dot=\pgfplotsretval
+ \pgfplotscoordmath{default}{op}{multiply}{{\pgfplots@view@dir@threedim@len}{\pgfplots@normal@len}}%
+ \pgfplotscoordmath{default}{op}{divide}{{\pgfplots@dot}{\pgfmathresult}}%
+
+ \pgfplotscoordmath{default}{if less than}{\pgfmathresult}{\pgfplotsplothandlermesh@interior@thresh}{%
+ % <0:
+ \global\let\pgfplots@glob@TMPc\pgfplotsplothandlermesh@is@interior
+ }{%
+ % >=0:
+ \global\let\pgfplots@glob@TMPc\pgfplotsplothandlermesh@is@exterior
+ }%
+ \endgroup
+ \pgfplots@glob@TMPc
+}%
+
+
+% only used if
+% \pgfplotsplothandlermesh@interior@exterior@hook@active is
+% active
+\def\pgfplotsplothandlermesh@is@interior{%
+%\def\pgfplotsplothandlermesh@usepath{\pgfusepath{discard}}%
+ \pgfkeyslet{/pgfplots/colormap name}\pgfplotsplothandlermesh@colormapname@interior
+ \pgfkeyslet{/pgfplots/surf shading/colormap}\pgfplotsplothandlermesh@shader@colormap@interior
+}%
+\def\pgfplotsplothandlermesh@is@exterior{%
+%\let\pgfplotsplothandlermesh@usepath=\pgfusepathqfillstroke
+ \pgfkeyslet{/pgfplots/colormap name}\pgfplotsplothandlermesh@colormapname
+ \pgfkeyslet{/pgfplots/surf shading/colormap}\pgfplotsplothandlermesh@shader@colormap
+}%
\def\pgfplotsplothandlermesh@init@cdata{%
% Ok, we have color data.
%
+ \pgfkeysgetvalue{/pgfplots/colormap name}\pgfplotsplothandlermesh@colormapname
+ %
+ \pgfkeysgetvalue{/pgfplots/mesh/interior colormap name}\pgfplotsplothandlermesh@colormapname@interior
+ \ifx\pgfplotsplothandlermesh@colormapname@interior\pgfutil@empty
+ \else
+ \pgfkeysgetvalue{/pgfplots/mesh/interior colormap thresh}\pgfplotsplothandlermesh@interior@thresh
+ \pgfplotscoordmath{default}{parsenumber}{\pgfplotsplothandlermesh@interior@thresh}%
+ \let\pgfplotsplothandlermesh@interior@thresh=\pgfmathresult
+ \pgfplotscoordmath{default}{if is}{\pgfplotsplothandlermesh@interior@thresh}{0}{%
+ \let\pgfplotsplothandlermesh@interior@exterior@hook=\pgfplotsplothandlermesh@interior@exterior@hook@active@zerothresh
+ }{%
+ \pgfplotsmathvectorlength{\pgfplots@view@dir@threedim}{default}% should be 1, but never mind
+ \let\pgfplots@view@dir@threedim@len=\pgfplotsretval
+ \let\pgfplotsplothandlermesh@interior@exterior@hook=\pgfplotsplothandlermesh@interior@exterior@hook@active
+ }%
+ % actually store 3d coordinates:
+ \let\pgfplotsplothandlermesh@serialize@logical@coords=\pgfplotsplothandlermesh@serialize@logical@coords@doit
+ \fi
+ %
% Prepare:
\def\pgfplotsplothandlermesh@definecolor{%
\pgfplotsplothandlermesh@get@flat@color
@@ -1684,9 +1946,21 @@
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass@output}{get pdf shading type}%
\fi
\pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
+ %
+ \pgfplotsplothandlermesh@set@shader@colormap
+ \pgfkeysgetvalue{/pgfplots/mesh/interior colormap name}\pgfplots@loc@TMPa
+ \ifx\pgfplots@loc@TMPa\pgfutil@empty
+ \else
+ \let\pgfplotsplothandlermesh@shader@colormap=\pgfplotsretval
+ \begingroup
+ \pgfkeyslet{/pgfplots/colormap name}\pgfplots@loc@TMPa
+ \pgfplotsplothandlermesh@set@shader@colormap
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+ \let\pgfplotsplothandlermesh@shader@colormap@interior=\pgfplotsretval
+ \fi
+ %
\pgfkeysgetvalue{/pgfplots/colormap name}\pgfplots@loc@TMPa
- \expandafter\pgfplotscolormaptopdffunction\expandafter{\pgfplots@loc@TMPa}%
- \pgfkeyslet{/pgfplots/surf shading/colormap}\pgfplotsretval
\pgfplotscolormapgetcolorspace\pgfplots@loc@TMPa
\pgfkeyslet{/pgfplots/surf shading/colorspace}\pgfplotsretval
\if2\pgfplotsplothandlermesh@shader
@@ -1909,6 +2183,12 @@
%
\let\pgfplotsplothandlermesh@compute@vertex@depth=\pgfplotsplothandlermesh@compute@vertex@depth@doit%
%
+ % the "element depth" is defined to be the MEAN of all
+ % vertex depths.
+ % And since the mean is 1/n * sum_{i=1}^n V_i, we can
+ % directly omit the 1/n --- it is the same for every
+ % vertex anyway, and we only want to compare the depth
+ % values.
\let\pgfplotsplothandlermesh@accum@element@depth=\pgfmath@basic@add@
%
% and collect each point into the z buffer
@@ -1955,6 +2235,12 @@
\pgfplotspatchclass{\pgfplotsplothandlermesh@patchclass}{new}%
}
+\def\pgfplotsplothandlermesh@set@shader@colormap{%
+ \pgfkeysgetvalue{/pgfplots/colormap name}\pgfplots@loc@TMPa
+ \expandafter\pgfplotscolormaptopdffunction\expandafter{\pgfplots@loc@TMPa}%
+ \pgfkeyslet{/pgfplots/surf shading/colormap}\pgfplotsretval
+}%
+
{
\dimen0=-16000.0pt
\xdef\pgfplotsplothandlermesh@check@unbounded@text{\the\dimen0}%
@@ -2031,7 +2317,7 @@
\pgfkeyslet{/pgfplots/iflessthan/.@cmd}\pgfplotsplothandlermesh@zbuffer@sort@iflessthen
\pgfkeysdef{/pgfplots/array/unscope pre}{%
\let\pgfplotsplothandlermesh@patchclass=\pgfplotsplothandlermesh@patchclass@output
- \def\pgfplotspatchready{\pgfplotsplothandlermesh@VISUALIZE}%
+ \def\pgfplotspatchready{\pgfplotsplothandlermesh@PIPE@interior@exterior@styles}%
\pgfplotsarrayforeachungrouped\pgfplots@zbuffer@local\as\curelem{%
\expandafter\pgfplotsplothandlermesh@draw@zbufferelement\curelem%
}%
@@ -2063,8 +2349,10 @@
\def\pgfplotsplothandlermesh@PIPE@DECODE@matrix@ONEDIMMODE#1{%
\let\pgfplotsplothandlermesh@patchclass\pgfplotsplothandlermesh@patchclass@input
\pgfplotsplothandlermesh@compute@vertex@depth% <-- this modifies \pgfplotsretval
+ \let\pgfplots@view@depth=\pgfplotsretval
\pgf@process{#1}%
- \edef\pgfplotsplothandlermesh@i{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplotsretval}%
+ \pgfplotsplothandlermesh@serialize@logical@coords
+ \edef\pgfplotsplothandlermesh@i{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplots@view@depth:\pgfplotsretval}%
\ifnum\c@pgfplots@scanlineindex>0
\expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotsplothandlermesh@im}%
\expandafter\pgfplotsplothandlermesh@setnextvertex\expandafter{\pgfplotsplothandlermesh@i}%
@@ -2077,8 +2365,10 @@
% the pgf@plotstreampoint routine for the first scan line:
\def\pgfplotsplothandlermesh@PIPE@DECODE@matrix@fillscanline#1{%
\pgfplotsplothandlermesh@compute@vertex@depth% <-- this modifies \pgfplotsretval
+ \let\pgfplots@view@depth=\pgfplotsretval
\pgf@process{#1}%
- \edef\pgfplots@loc@TMPa{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplotsretval}%
+ \pgfplotsplothandlermesh@serialize@logical@coords
+ \edef\pgfplots@loc@TMPa{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplots@view@depth:\pgfplotsretval}%
\expandafter\pgfplotsdequepushback\pgfplots@loc@TMPa\to{lastscanline}%
\advance\c@pgfplots@scanlineindex by1
\ifnum\c@pgfplots@scanlineindex=\pgfplotsplothandlermesh@scanlinelength\relax
@@ -2114,8 +2404,10 @@
% 'im == (i-1)'
% 'jm == (j-1)'
\pgfplotsplothandlermesh@compute@vertex@depth% <-- this modifies \pgfplotsretval
+ \let\pgfplots@view@depth=\pgfplotsretval
\pgf@process{#1}%
- \edef\pgfplotsplothandlermesh@i@j{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplotsretval}% FIXME relies on pgfplots macros
+ \pgfplotsplothandlermesh@serialize@logical@coords
+ \edef\pgfplotsplothandlermesh@i@j{{\the\pgf@x}{\the\pgf@y}{\pgfplots@current@point@meta}\pgfplots@view@depth:\pgfplotsretval}% FIXME relies on pgfplots macros
%\message{##\the\c@pgfplots@scanlineindex: prepare rectangle with corner \meaning\pgfplotsplothandlermesh@i@j.}%
\pgfplotsdequepopfront{lastscanline}\to\pgfplotsplothandlermesh@im@j
\expandafter\pgfplotsdequepushback\pgfplotsplothandlermesh@i@j\to{lastscanline}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex
index 724f1546e22..961362a1857 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex
@@ -302,17 +302,109 @@
\def\pgfplotssurveyphaseinputclass{direct}
+\def\pgfplotsplothandlers@tikz@with@snap@to@nearest{%
+ \pgfplothandlerdiscard,%
+ \pgfplothandlermark,%
+ \pgfplothandlermarklisted,%
+ \pgfplothandlerxbar,%
+ \pgfplothandlerybar,%
+ \pgfplothandlerxbarinterval,%
+ \pgfplothandlerybarinterval%
+}%
+
+\def\pgfplotsplothandlers@tikz@std{%
+ \pgfplothandlerdiscard,%
+ \pgfplothandlermark,%
+ \pgfplothandlermarklisted,%
+ \pgfplothandlerxbar,%
+ \pgfplothandlerybar,%
+ \pgfplothandlerxbarinterval,%
+ \pgfplothandlerybarinterval,%
+ \pgfplothandlerlineto,%
+ \pgfplothandlercurveto,%
+ \pgfplothandlerconstantlineto,%
+ \pgfplothandlerconstantlinetomarkright,%
+ \pgfplothandlerconstantlinetomarkmid,%
+ \pgfplothandlerpolarcomb,%
+ \pgfplothandlerjumpmarkmid,%
+ \pgfplothandlerjumpmarkleft,%
+ \pgfplothandlerjumpmarkright%
+}%
+
+% Defines \pgfplotsretval to be the csname for the BACKUP of plot
+% handler #1.
+%
+% For example:
+% \pgfplotsplothandlers@get@tikz@backup@name{\pgfplothandlerlineto}
+% will return \pgfplotsretval={\\pgfplothandlerlineto@tikz}
+% (up to \escapechar)
+\def\pgfplotsplothandlers@get@tikz@backup@name#1{%
+ \begingroup
+ %\escapechar=-1 % drop the leading backslash
+ \expandafter\gdef\expandafter\pgfplotsretval\expandafter{\csname \string#1@tikz\endcsname}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Takes the CURRENT \tikz@plot@handler and checks if it is an UNPATCHED tikz plot
+% handler. If so, it replaced it with the correct patched version.
+%
+% The motivation is that uf \tikz@plot@handler has been set outside of
+% an axis, it will not reflect the most recent changes (which are only
+% applied within an axis).
+\def\pgfplotsplothandlers@init@map@to@patched@versions{%
+ % iterate through all tikz plot handlers...
+ \expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplotsplothandlers@tikz@std}%
+ \as\pgfplots@loc@TMPa{%
+ % ... get the name of the backup (see \pgfplotsplothandlers@init)
+ \expandafter\pgfplotsplothandlers@get@tikz@backup@name\pgfplots@loc@TMPa
+ \expandafter\ifx\pgfplotsretval\tikz@plot@handler
+ % AH! \tikz@plot@handler is the same as some backup name!
+ % Replace it:
+ \expandafter\let\expandafter\tikz@plot@handler\pgfplots@loc@TMPa
+ \fi
+ }%
+}%
+
\def\pgfplotsplothandlers@init{%
\def\pgfplotsplothandlers@init@##1{%
- \expandafter\def\expandafter##1\expandafter{%
- ##1%
+ \pgfplotsutil@add@to@macro##1{%
\let\pgfplotsplothandlersurveydifflen=\pgfplotsplothandlersurveydifflen@snaptonearest
\let\pgfplotsplothandlersurveypointattime=\pgfplotsplothandlersurveypointattime@snaptonearest
}%
}%
- \pgfplotsutilforeachcommasep{\pgfplothandlerdiscard,\pgfplothandlerxbar,\pgfplothandlerybar,\pgfplothandlerxbarinterval,\pgfplothandlerybarinterval}\as\pgfplots@loc@TMPa{%
+ \def\pgfplotsplothandlers@init@@##1{%
+ % create backup:
+ %
+ % if ##1 = \pgfplothandlerlineto, this defines
+ % \pgfplothandlerlineto@tikz as backup.
+ \pgfplotsplothandlers@get@tikz@backup@name{##1}%
+ \expandafter\let\pgfplotsretval=##1%
+ %
+ %
+ % assign more suitable names:
+ \pgfplotsutil@add@to@macro##1{%
+ \begingroup
+ \escapechar=-1 % drop the leading backslash
+ \edef\pgfplotsplothandlername{\string##1}%
+ \pgfmath@smuggleone\pgfplotsplothandlername
+ \endgroup
+ }%
+ }%
+ % Patch all TikZ plot handlers:
+ % this here also creates backups
+ \expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplotsplothandlers@tikz@std}%
+ \as\pgfplots@loc@TMPa{%
+ \expandafter\pgfplotsplothandlers@init@@\expandafter{\pgfplots@loc@TMPa}%
+ }%
+ %
+ % Patch only selected ones:
+ \expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplotsplothandlers@tikz@with@snap@to@nearest}%
+ \as\pgfplots@loc@TMPa{%
\expandafter\pgfplotsplothandlers@init@\expandafter{\pgfplots@loc@TMPa}%
}%
+ %
+ \pgfplotsplothandlers@init@map@to@patched@versions
}%
% Resets the plot handler routines.
@@ -924,12 +1016,12 @@
%
\E\ifx\E\pgfplots@current@point@x\E\pgfutil@empty
\E\else
- \ifpgfplots@xislinear
- \E\pgfplotscoordmath{x}{parsenumber}{\E\pgfplots@current@point@x}%
- \E\let\E\pgfplots@current@point@x=\E\pgfmathresult
- \else
- % logs are already parsed (in prepare routine)
- \fi
+ % parse for numbers. Note that this might cause
+ % unnecessary overhead of logs (which are already
+ % normalized unless someone provided filters). But do it
+ % anyway to ensure that filters produce valid output.
+ \E\pgfplotscoordmath{x}{parsenumber}{\E\pgfplots@current@point@x}%
+ \E\let\E\pgfplots@current@point@x=\E\pgfmathresult
\E\pgfplotscoordmath{x}{if is bounded}{\E\pgfplots@current@point@x}%
{}%
{% this clears nan, inf and -inf points.
@@ -940,12 +1032,8 @@
%
\E\ifx\E\pgfplots@current@point@y\E\pgfutil@empty
\E\else
- \ifpgfplots@yislinear
- \E\pgfplotscoordmath{y}{parsenumber}{\E\pgfplots@current@point@y}%
- \E\let\E\pgfplots@current@point@y=\E\pgfmathresult
- \else
- % logs are already parsed (in prepare routine)
- \fi
+ \E\pgfplotscoordmath{y}{parsenumber}{\E\pgfplots@current@point@y}%
+ \E\let\E\pgfplots@current@point@y=\E\pgfmathresult
\E\pgfplotscoordmath{y}{if is bounded}{\E\pgfplots@current@point@y}%
{}%
{% this clears nan, inf and -inf points.
@@ -958,12 +1046,8 @@
%
\E\ifx\E\pgfplots@current@point@z\E\pgfutil@empty
\E\else
- \ifpgfplots@zislinear
- \E\pgfplotscoordmath{z}{parsenumber}{\E\pgfplots@current@point@z}%
- \E\let\E\pgfplots@current@point@z=\E\pgfmathresult
- \else
- % logs are already parsed (in prepare routine)
- \fi
+ \E\pgfplotscoordmath{z}{parsenumber}{\E\pgfplots@current@point@z}%
+ \E\let\E\pgfplots@current@point@z=\E\pgfmathresult
\E\pgfplotscoordmath{z}{if is bounded}{\E\pgfplots@current@point@z}%
{}%
{% this clears nan, inf and -inf points.
@@ -1014,7 +1098,7 @@
% for 'v' and 'w' instead of 'u'.
quiver/.code={%
\let\tikz@plot@handler=\pgfplotsplothandlerquiver
- \pgfqkeys{/pgfplots/quiver}{#1}%
+ \pgfqkeys{/pgfplots/quiver}{quiver legend,#1}%
},%
quiver/u value*/.initial=0,
quiver/v value*/.initial=0,
@@ -1022,6 +1106,25 @@
quiver/u value is expr/.initial=0,
quiver/v value is expr/.initial=0,
quiver/w value is expr/.initial=0,
+ quiver/quiver legend/.style={
+ /pgfplots/legend image code/.code={%
+ \draw[x=0.6cm,y=0cm,z=0pt,##1,
+ /pgfplots/quiver/before arrow/.add code={}{
+ % quiver is a pgfplots-specific plot-handler. We need to
+ % fix the additional input data somehow.
+ %
+ % this is an *absolute* coordinate, interpreted
+ % relative to 'x', 'y', 'z'
+ \def\pgfplots@quiver@u{1}%
+ \def\pgfplots@quiver@v{1}%
+ \def\pgfplots@quiver@w{1}%
+ },%
+ ]
+ plot coordinates {
+ (0cm,0cm)
+ };%
+ }%
+ },
quiver/u filter/.code=,
quiver/v filter/.code=,
quiver/w filter/.code=,
@@ -1380,6 +1483,7 @@
\newif\ifpgfplotsplothandlerhistogram@intervals
\newif\ifpgfplotsplothandlerhistogram@cumulative
+\newif\ifpgfplotsplothandlerhistogram@density
\pgfplotsset{
hist/.code={%
\let\tikz@plot@handler=\pgfplotsplothandlerhistogram
@@ -1398,6 +1502,9 @@
hist/intervals=true,
hist/cumulative/.is if=pgfplotsplothandlerhistogram@cumulative,
hist/cumulative/.default=true,
+ hist/density/.is if=pgfplotsplothandlerhistogram@density,
+ hist/density/.default=true,
+ hist/density=false,
hist/handler/.style={/tikz/ybar interval},
hist/symbolic coords/.style={%
/pgfplots/symbolic coords={hist/data}{A,B,C,D,E,F,G,H,I,J},
@@ -1521,15 +1628,52 @@
\expandafter\pgfplotsplothandlersurveyend@hist@loop\pgfplots@hist@data\pgfplots@EOI
\let\pgfplots@hist@data=\relax
%
+
+ % Calculate total count
+ \c@pgf@counta=0
+ \pgfplotsarrayforeachungrouped{pgfp@hist}\as\pgfplots@hist@count{%
+ \advance\c@pgf@counta by\pgfplots@hist@count\relax
+ \def\pgfplots@loc@TMPa{\pgfplotsarrayset{\pgfplotsarrayforeachindex}\of{pgfp@hist}\to}%
+ }%
+ \pgfmathfloatparsenumber{\the\c@pgf@counta}%
+ \let\pgfp@hist@totalcount=\pgfmathresult
+ \pgfmathfloatreciprocal@{\pgfp@hist@totalcount}%
+ \let\pgfp@hist@totalcount@inv=\pgfmathresult
+ %
\ifpgfplotsplothandlerhistogram@cumulative
\c@pgf@counta=0
\pgfplotsarrayforeachungrouped{pgfp@hist}\as\pgfplots@hist@count{%
\advance\c@pgf@counta by\pgfplots@hist@count\relax
\def\pgfplots@loc@TMPa{\pgfplotsarrayset{\pgfplotsarrayforeachindex}\of{pgfp@hist}\to}%
- \expandafter\pgfplots@loc@TMPa\expandafter{\the\c@pgf@counta}%
+ \ifpgfplotsplothandlerhistogram@density
+ \pgfmathfloatparsenumber{\the\c@pgf@counta}%
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfp@hist@totalcount@inv}%
+ \pgfmathfloattosci@{\pgfmathresult}%
+ \expandafter\pgfplots@loc@TMPa\expandafter{\pgfmathresult}%
+ \else
+ \expandafter\pgfplots@loc@TMPa\expandafter{\the\c@pgf@counta}%
+ \fi
}%
+ \fi%
+ %
+ %% Density histogram
+ % Divide count in each bin by (totalcount*range/bins)
+ \ifpgfplotsplothandlerhistogram@density
+ \ifpgfplotsplothandlerhistogram@cumulative
+ \else
+ \pgfmathfloatmultiply@{\pgfp@hist@totalcount@inv}{\pgfplotsplothandlerhistogram@invh}%
+ \let\pgfp@hist@totalcount@times@h@inv=\pgfmathresult
+ \pgfplotsarrayforeachungrouped{pgfp@hist}\as\pgfplots@hist@count{%
+ \pgfmathfloatparsenumber{\pgfplots@hist@count}%
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfp@hist@totalcount@times@h@inv}%
+ \pgfmathfloattosci@{\pgfmathresult}%
+ \def\pgfplots@loc@TMPa{\pgfplotsarrayset{\pgfplotsarrayforeachindex}\of{pgfp@hist}\to}%
+ \expandafter\pgfplots@loc@TMPa\expandafter{\pgfmathresult}%
+ }%
+ \fi
\fi
%
+ %% End density histogram
\pgfplots@curplot@threedimfalse
%
\pgfplotsset{/pgfplots/hist/handler}%
@@ -1694,6 +1838,7 @@
%
% Shared parameters:
contour/number/.initial=5,
+ contour/levels/.initial=,
%
%
% Interface to external tools:
@@ -1715,7 +1860,17 @@
contour gnuplot/.style={
contour external={%
scanline marks=required,
- script={unset surface; set cntrparam levels \pgfkeysvalueof{/pgfplots/contour/number}; set contour; set table \"\outfile\"; splot \"\infile\";},
+ script={
+ unset surface;
+ \ifx\thecontourlevels\empty
+ set cntrparam levels \thecontournumber;
+ \else
+ set cntrparam levels discrete \thecontourlevels;
+ \fi
+ set contour;
+ set table \"\outfile\";
+ splot \"\infile\";
+ },
cmd={gnuplot \"\script\"},
#1,%
},
@@ -2311,6 +2466,8 @@
\edef\infile{\pgfplotsplothandlercontourexternal@file.dat}%
\edef\outfile{\pgfplotsplothandlercontourexternal@file.table}%
\edef\script{\pgfplotsplothandlercontourexternal@file.\pgfkeysvalueof{/pgfplots/contour external/script extension}}%
+ \edef\thecontourlevels{\pgfkeysvalueof{/pgfplots/contour/levels}}%
+ \edef\thecontournumber{\pgfkeysvalueof{/pgfplots/contour/number}}%
\immediate\openout\w@pgf@writea=\script
\immediate\write\w@pgf@writea{\pgfkeysvalueof{/pgfplots/contour external/script}}%
\immediate\closeout\w@pgf@writea
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex
index 15e78f6c8fd..b908154f070 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsstackedplots.code.tex
@@ -266,6 +266,10 @@
{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}}%
}{%
% LOG. we need to compute log(zerolevel + current):
+ % FIXME : this is WRONG!
+ % 1. I need 'default' because I need to deal with arbitrary floats.
+ % 2. I need the correct log basis -- which, however, is only
+ % available as argument for coordmath \pgfplots@stacked@dir!
\pgfplotscoordmath{default}{parsenumber}{\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname}%
\pgfplotscoordmath{default}{exp}{\pgfmathresult}%
\expandafter\let\csname pgfplots@current@point@\pgfplots@stacked@dir\endcsname=\pgfmathresult
diff --git a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex
index c2a06a6b44c..98cb20753e4 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex
@@ -403,7 +403,7 @@
\pgfplotsscalarproductofvectors
{\pgfplots@loc@vector@to@outside}%
{\pgfpointdiff
- {#2}%
+ {#2\pgf@pos@transform\pgf@x\pgf@y}%
{\pgfplots@loc@ticklabel@bb@corner}}%
\ifdim\pgf@x>\csname pgfplots@maxtickdimen@#1\endcsname\relax
\expandafter\xdef\csname pgfplots@maxtickdimen@#1\endcsname{\the\pgf@x}%
@@ -1051,6 +1051,17 @@
\pgfplots@if{pgfplots@#1majorgrids}{\pgfplots@loop@CONTINUEtrue}{}%
\pgfplots@if{pgfplots@#1minorgrids}{\pgfplots@loop@CONTINUEtrue}{}%
\ifpgfplots@loop@CONTINUE
+ % I support only ONE layer for both, minor and major
+ % grid lines -- no distinction! I am lazy... FIXME
+ \pgfplotsgetlayerforstyle{%
+ every axis grid,%
+ every minor grid,%
+ every axis #1 grid,%
+ every major grid,%
+ every minor #1 grid,%
+ every major #1 grid%
+ }%
+ \pgfplotsonlayer{\pgfplotsretval}{#1 grid style}%
\scope
\pgfplots@drawgridlines@INSTALLCLIP@onorientedsurf#1%
%
@@ -1083,6 +1094,7 @@
}{}%
%
\endscope
+ \endpgfplotsonlayer
\fi
}{}%
\endgroup
@@ -1167,7 +1179,7 @@
\pgfplots@if{pgfplots@shownothingof@\pgfplotspointonorientedsurfaceB}{%
\relax
}{%
- \scope
+ \begingroup
\pgfplots@ifaxisline@B@onorientedsurf@should@be@drawn{0}{%
\def\pgfplots@drawticklines@for@placecomputedtick@LOWEROK{1}%
}{%
@@ -1212,6 +1224,19 @@
\fi
\expandafter\let\expandafter\pgfplots@prepared@tick@positions@major@\csname pgfplots@prepared@tick@positions@major@#1\endcsname
\expandafter\let\expandafter\pgfplots@prepared@tick@positions@minor@\csname pgfplots@prepared@tick@positions@minor@#1\endcsname
+ %
+ % There is only ONE layer for both, minor and major
+ % tick lines -- no distinction!
+ \pgfplotsgetlayerforstyle{%
+ every tick,%
+ every minor tick,%
+ every #1 tick,%
+ every major tick,%
+ every minor #1 tick,%
+ every major #1 tick%
+ }%
+ \pgfplotsonlayer{\pgfplotsretval}{#1tick style}%
+ \scope
\pgfplots@drawticklines@INSTALLCLIP@onorientedsurf#1
%
\pgfplots@if{pgfplots@#1minorticks}{%
@@ -1257,6 +1282,8 @@
}{}%
%
\endscope
+ \endpgfplotsonlayer
+ \endgroup
}%
}
@@ -1319,6 +1346,8 @@
\pgfplots@init@scaled@tick@for{#1}%
}{\relax}%
\begingroup
+ \pgfplotsgetlayerforstyle{every tick label,every #1 tick label}%
+ \pgfplotsonlayer\pgfplotsretval{#1tick label style}%
\pgfkeysalso{/tikz/every node/.append style={/pgfplots/every tick label,/pgfplots/every #1 tick label}}%
\pgfplots@drawticklabels@onorientedsurf@prepareanchor#1%
%
@@ -1342,7 +1371,7 @@
\expandafter\let\expandafter\pgfplots@tick@origin\csname pgfplots@logical@ZERO@\pgfplotspointonorientedsurfaceB\endcsname%
% FIXME : that stuff here does not respect
% '[xyz]tickpos num' keys!
- \pgfplots@tickposchoiceb
+ \pgfplots@tickposchoiceb%<-- backw. compat, is usually empty.
\if r\pgfkeysvalueof{/pgfplots/\pgfplotspointonorientedsurfaceB\space dir/value}%
% special handling for reversed axes.
\pgfmathmultiply{-1}{\pgfplots@tick@offset}%
@@ -1353,18 +1382,22 @@
\else
\if0\pgfplots@ticklabelside
\expandafter\let\expandafter\pgfplots@tick@origin\csname pgfplots@\pgfplotspointonorientedsurfaceB min\endcsname%
- \pgfplots@tickposchoiceb
+ \pgfplots@tickposchoiceb%<-- backw. compat, is usually empty.
%\pgfmathsubtract@{\pgfplots@tick@origin}{\pgfplots@tick@offset}%
\edef\pgfplots@tick@offset{-\pgfplots@tick@offset}%
\else
\if1\pgfplots@ticklabelside
\expandafter\let\expandafter\pgfplots@tick@origin\csname pgfplots@\pgfplotspointonorientedsurfaceB max\endcsname%
- \pgfplots@tickposchoicea
+ \pgfplots@tickposchoicea%<-- backw. compat, is usually empty.
%\pgfmathadd@{\pgfplots@tick@origin}{\pgfplots@tick@offset}%
\else
+ % FIXME : ticklabelside == 2 is, in principle,
+ % a valid choice. It is the case handled with
+ % "if 2 == pgfplots@#1axislinesnum" above,
+ % isn't it!?
\expandafter\let\expandafter\pgfplots@tick@origin\csname pgfplots@logical@ZERO@\pgfplotspointonorientedsurfaceB\endcsname%
% FIXME : is that correct!?
- \pgfplots@tickposchoiceb
+ \pgfplots@tickposchoiceb%<-- backw. compat, is usually empty.
%\pgfmathsubtract@{\pgfplots@tick@origin}{\pgfplots@tick@offset}%
%\edef\pgfplots@tick@offset{-\pgfplots@tick@offset}%
%
@@ -1395,6 +1428,7 @@
{\pgfplots@ticknum}%
}%
\pgfplots@ticklabel@maxtickdimen@finish{#1}%
+ \endpgfplotsonlayer
\endgroup
\pgfplots@draw@tick@scale@label@for #1%
}%
@@ -1761,11 +1795,11 @@
\H=\MAX
\advance\H by-\MIN
\ifdim\H<0pt \H=-1\H \fi
-%\message{Axis limit #1: [\the\MIN:\the\MAX], diff = \the\H.}%
+%\message{Axis limit #1: [\the\MIN:\the\MAX], diff = \the\H.^^J}%
\c@pgf@counta=\desirednumticks
\advance\c@pgf@counta by-1 %
\divide\H by\c@pgf@counta
-%\message{determining ticks for #1-axis: Wr := (width/max space between ticks) = \the\Wr, desirednumticks=max(\axisdefaulttryminticks, trunc(Wr)) = \the\desirednumticks, H#1=(axis range/(desirednumticks-1)) = \the\H}%
+%\message{determining ticks for #1-axis: Wr := (width/max space between ticks) = \the\Wr, desirednumticks=max(\axisdefaulttryminticks, trunc(Wr)) = \the\desirednumticks, H#1=(axis range/(desirednumticks-1)) = \the\H^^J}%
%
% SEARCH for the NEXT FEASABLE H.
\edef\Hmacro{\pgf@sys@tonumber\H}%
@@ -1779,11 +1813,12 @@
\pgfmathfloatparsenumber{\Hmacro}%
\let\Hmacro=\pgfmathresult
\fi
-%\message{Got T^{-1}(H#1) = \Hmacro}%
+%\message{Got T^{-1}(H#1) = \Hmacro^^J}%
%
\pgfplots@assign@default@tick@foraxis@normalizetickdist#1\Hmacro
\let\Hmacro=\pgfmathresult
%
+%\message{snapped-to-nicest = \Hmacro^^J}%
\aftergroup\pgfplots@isuniformticktrue
% The following code is carried out in floating point
% arithmetics because it requires large data ranges.
@@ -1914,21 +1949,33 @@
% MIN < ORIGMIN by construction (ok, MIN <= ORIGMIN by
% construction, but I don't care about this case).
% So: check only the second condition.
+%\message{Got MIN=\pgf@sys@tonumber\MIN; H=\pgf@sys@tonumber\H; MAX=\pgf@sys@tonumber\MAX.^^J}%
\def\pgfplots@tick@returnval@ready{0}%
\pgfplots@tmpa=\MINH
\advance\pgfplots@tmpa by\H
\ifdim\MAX<\pgfplots@tmpa
\pgfplots@if{pgfplots@#1islinear}{%
- \def\pgfplots@tick@returnval@ready{1}%
\begingroup
- \c@pgf@counta=\axisdefaulttryminticks\relax
- \advance\c@pgf@counta by1
- \edef\axisdefaulttryminticks{\the\c@pgf@counta}%
-%\message{**TOO FEW TICK LABELS. RECURSION with try min ticks=\axisdefaulttryminticks.**}%
- % recurse.
- \pgfplots@assign@default@tick@foraxis{#1}%
- \expandafter\global\expandafter\let\expandafter\pgfplots@glob@TMPa\csname pgfplots@#1tick\endcsname
- \expandafter\global\expandafter\let\expandafter\pgfplots@glob@TMPb\csname pgfplots@tick@distance@#1\endcsname
+ \def\pgfplots@tick@returnval@ready{1}%
+ \pgfutil@ifundefined{pgfplots@assign@default@tick@foraxis@recurselevel}{%
+ \def\pgfplots@assign@default@tick@foraxis@recurselevel{1}%
+ }{%
+ \pgfplotsutil@advancestringcounter\pgfplots@assign@default@tick@foraxis@recurselevel
+ }%
+ \ifnum\pgfplots@assign@default@tick@foraxis@recurselevel<15
+ \c@pgf@counta=\axisdefaulttryminticks\relax
+ \advance\c@pgf@counta by1
+ \edef\axisdefaulttryminticks{\the\c@pgf@counta}%
+%\message{**TOO FEW TICK LABELS FOR #1. RECURSION with try min ticks=\axisdefaulttryminticks.**^^J}%
+ % recurse.
+ \pgfplots@assign@default@tick@foraxis{#1}%
+ \expandafter\global\expandafter\let\expandafter\pgfplots@glob@TMPa\csname pgfplots@#1tick\endcsname
+ \expandafter\global\expandafter\let\expandafter\pgfplots@glob@TMPb\csname pgfplots@tick@distance@#1\endcsname
+ \else
+ \pgfplots@warning{Tick computation for direction #1 failed; there are always too few tick labels (try min ticks has already been advanced to \axisdefaulttryminticks)}%
+ \def\pgfplots@tick@returnval@ready{0}%
+ \fi
+ \pgfmath@smuggleone\pgfplots@tick@returnval@ready
\endgroup
}{%
% Case logarithmic axes and too few ticks.
@@ -2025,7 +2072,7 @@
%
% Example:
% \pgfmathfloatparsenumber{x}{1234}
-% \pgfplots@assign@default@tick@foraxis@normalizetickdist\pgfmathresult
+% \pgfplots@assign@default@tick@foraxis@normalizetickdist{x}{\pgfmathresult}
% \pgfmathfloatotfixed\pgfmathresult
% -->
%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def b/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def
index c94f05e585e..e8e9a4568a4 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def
+++ b/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def
@@ -25,7 +25,6 @@
%
%--------------------------------------------
-
% The lowlevel call for surface shadings. It uses a pattern type 2
% dictionary as fill color and has thus several things to do. This is
% a little bit more complicated than using the '/sh' operator (as
@@ -54,7 +53,7 @@
\pgfusepath{fill}%
\endpgfpicture
}%
- \pdfxform resources{
+ \immediate\pdfxform resources{
/Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
}\pgfutil@tempboxa
\leavevmode
@@ -71,7 +70,15 @@
%
%
\def\pgfplotssys@do@surfshading@fillpaths#1{%
- \immediate\pdfobj stream attr {%
+ \ifx\pgfplotslibrarysurf@filter@decode\pgfutil@empty
+ \else
+ % Unfortunately, there is a bug in pdftex/luatex: if we
+ % provide a /Filter as attr, and pdftex compresses the stream,
+ % it overwrites the /Filter argument -- and the viewer cannot
+ % decode the stream. We have to deactivate compression here:
+ \pdfcompresslevel=0
+ \fi
+ \def\pgfplots@loc@TMPa{%
% stream length will be computed automatically
/ShadingType \pgfplotslibrarysurf@type\space
/BitsPerCoordinate \pgfplotslibrarysurf@bitspercoordinate\space
@@ -88,10 +95,38 @@
\else
/Filter /\pgfplotslibrarysurf@filter@decode\space
\fi
- } {%
- \pgfplotslibrarysurf@binarystream
}%
- \edef\pgfplots@loc@TMPa{\the\pdflastobj}%
+ %
+ % \pgfplots@loc@TMPb := final boolean luaBinaryEncoding;
+ \pgfutil@ifundefined{directlua}{%
+ \def\pgfplots@loc@TMPb{0}%
+ }{%
+ \ifx\pgfplotslibrarysurf@filter@decode\pgfutil@empty
+ % ah - we have binary encoding (the standard).
+ \def\pgfplots@loc@TMPb{1}%
+ \else
+ % ah - base 16 ASCII encoding:
+ \def\pgfplots@loc@TMPb{0}%
+ \fi
+ }%
+ \if0\pgfplots@loc@TMPb
+ % no lua binary encoding. Use standard pdftex operations:
+ \immediate\pdfobj stream attr {%
+ \pgfplots@loc@TMPa
+ } {%
+ \pgfplotslibrarysurf@binarystream
+ }%
+ \edef\pgfplots@loc@TMPa{\the\pdflastobj}%
+ \else
+ % special handling for luatex binary encoding (see docs for \pgfplotsbinarytoluabinary):
+ \pgfplotsbinarytoluabinary{\pgfplotslibrarysurf@binarystream}%
+ \edef\pgfplots@loc@TMPa{%
+ \directlua{%
+ tex.print(pdf.immediateobj(\pgfplotsDQ stream\pgfplotsDQ , pgfplotsretval, \pgfplotsDQ \pgfplots@loc@TMPa\pgfplotsDQ ));
+ pgfplotsretval=nil;
+ }%
+ }%
+ \fi
\pgf@process{\pgfpointdiff{\pgfplotslibrarysurf@corner@sw}{\pgfkeysvalueof{/pgfplots/surf shading/anchor}}}%
\pgf@sys@bp@correct\pgf@x%
\pgf@sys@bp@correct\pgf@y%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/sys/pgfplotssysgeneric.code.tex b/Master/texmf-dist/tex/generic/pgfplots/sys/pgfplotssysgeneric.code.tex
index cc79af2d013..f4bd3054304 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/sys/pgfplotssysgeneric.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/sys/pgfplotssysgeneric.code.tex
@@ -23,8 +23,62 @@
%
%--------------------------------------------
+% NOTE: tex4ht support is lousy. For example, \tikz \node {$10^{-6}$};
+% will already break -- because SVG does not support the html tag
+% &minus; produced by tex4ht (and TikZ apparently does not know how to
+% escape it somehow).
\def\pgfplots@sys@beforenode{%
\pgfkeysifdefined{/tikz/tex4ht node/escape/.@cmd}{%
- \tikzset{tex4ht node/escape=true}%
+ \ifpgfplots@has@cell@picture
+ \tikzset{tex4ht node/escape=true}%
+ \pgfplots@warning{ATTENTION: you may want to use '\string\pgfplotsset{cell picture=false}' in your preamble. Otherwise, tex4ht will produce TWO SVG files per plot.^^J}%
+ \fi
}{}%
}%
+
+% see compat/show suggested version
+\newif\ifpgfplots@show@suggested@version
+\pgfplots@show@suggested@versiontrue
+
+\def\pgfplots@show@suggested@compat@value{%
+ \ifpgfplots@show@suggested@version
+ \begingroup
+ \pgfkeysgetvalue{/pgfplots/compat/current}\current
+ \pgfkeysgetvalue{/pgfplots/compat/mostrecent}\mostrecent
+ %
+ \def\b@isnewest{0}%
+ \def\b@shouldupgrade{0}%
+ \ifx\current\mostrecent
+ \def\b@isnewest{1}%
+ \else
+ \def\pgfplots@loc@TMPa{newest}%
+ \ifx\current\pgfplots@loc@TMPa
+ \def\b@isnewest{1}%
+ \else
+ \expandafter\pgfplotsutilifstringequal\expandafter{\current}{pre 1.3}{%
+ \def\b@shouldupgrade{1}%
+ }{}%
+ \expandafter\pgfplotsutilifstringequal\expandafter{\current}{default}{%
+ \def\b@shouldupgrade{1}%
+ }{}%
+ \fi
+ \fi
+ \if1\b@isnewest
+ \pgfplots@message{Package pgfplots notification 'compat/show suggested version=true': document has been generated with the most recent feature set (\string\pgfplotsset{compat=\mostrecent}).^^J}%
+ \else
+ \if1\b@shouldupgrade
+ \pgfplots@warning{running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing \string\pgfplotsset{compat=\mostrecent} into your preamble.^^J}%
+ \else
+ \pgfplots@message{Package pgfplots notification 'compat/show suggested version=true': you might benefit from \string\pgfplotsset{compat=\mostrecent} (current compat level: \current).^^J}%
+ \fi
+ \fi
+ \endgroup
+ \fi
+}
+
+\pgfutil@ifundefined{AtBeginDocument}{%
+}{%
+ \AtBeginDocument{%
+ \pgfplots@show@suggested@compat@value
+ }%
+}%
diff --git a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.code.tex b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.code.tex
index df3f66d0dd7..c9baffcb6dd 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.code.tex
@@ -35,295 +35,6 @@
\edef\pgfplotsbinaryatcode{\the\catcode`\@ }
\catcode`\@=11
-\begingroup
-% prepare ONE-BYTE conversion [0-255] -> binary character:
-\count0=0
-\countdef\counter=0
-\catcode`\^^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^00}\advance\counter by1
-\catcode`\^^01=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^01}\advance\counter by1
-\catcode`\^^02=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^02}\advance\counter by1
-\catcode`\^^03=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^03}\advance\counter by1
-\catcode`\^^04=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^04}\advance\counter by1
-\catcode`\^^05=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^05}\advance\counter by1
-\catcode`\^^06=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^06}\advance\counter by1
-\catcode`\^^07=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^07}\advance\counter by1
-\catcode`\^^08=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^08}\advance\counter by1
-\begingroup
-\catcode`\^^09=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^09}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^0a=11\expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0a}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^0b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0b}\endgroup\advance\counter by1
-\catcode`\^^0c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0c}\advance\counter by1
-\begingroup
-\catcode`\^^0d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0d}\endgroup\advance\counter by1
-\catcode`\^^0e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0e}\advance\counter by1
-\catcode`\^^0f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0f}\advance\counter by1
-\catcode`\^^10=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^10}\advance\counter by1
-\catcode`\^^11=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^11}\advance\counter by1
-\catcode`\^^12=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^12}\advance\counter by1
-\catcode`\^^13=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^13}\advance\counter by1
-\catcode`\^^14=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^14}\advance\counter by1
-\catcode`\^^15=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^15}\advance\counter by1
-\catcode`\^^16=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^16}\advance\counter by1
-\catcode`\^^17=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^17}\advance\counter by1
-\catcode`\^^18=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^18}\advance\counter by1
-\catcode`\^^19=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^19}\advance\counter by1
-\catcode`\^^1a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1a}\advance\counter by1
-\catcode`\^^1b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1b}\advance\counter by1
-\catcode`\^^1c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1c}\advance\counter by1
-\catcode`\^^1d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1d}\advance\counter by1
-\catcode`\^^1e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1e}\advance\counter by1
-\catcode`\^^1f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1f}\advance\counter by1
-\begingroup
-\catcode`\^^20=11^^I\expandafter\xdef\csname^^Ipgfp@bin@\the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1
-\catcode`\^^21=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^21}\advance\counter by1
-\catcode`\^^22=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^22}\advance\counter by1
-\catcode`\^^23=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^23}\advance\counter by1
-\catcode`\^^24=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^24}\advance\counter by1
-\catcode`\^^25=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^25}\advance\counter by1
-\catcode`\^^26=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^26}\advance\counter by1
-\catcode`\^^27=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^27}\advance\counter by1
-\catcode`\^^28=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^28}\advance\counter by1
-\catcode`\^^29=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^29}\advance\counter by1
-\catcode`\^^2a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2a}\advance\counter by1
-\catcode`\^^2b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2b}\advance\counter by1
-\catcode`\^^2c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2c}\advance\counter by1
-\catcode`\^^2d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2d}\advance\counter by1
-\catcode`\^^2e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2e}\advance\counter by1
-\catcode`\^^2f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2f}\advance\counter by1
-\begingroup
-\catcode`\^^30=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^30}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^31=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^31}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^32=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^32}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^33=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^33}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^34=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^34}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^35=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^35}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^36=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^36}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^37=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^37}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^38=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^38}\endgroup\advance\counter by1
-\begingroup
-\catcode`\^^39=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^39}\endgroup\advance\counter by1
-\catcode`\^^3a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3a}\advance\counter by1
-\catcode`\^^3b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3b}\advance\counter by1
-\catcode`\^^3c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3c}\advance\counter by1
-\begingroup
-\catcode`\^^3d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3d}\endgroup\advance\counter by1
-\catcode`\^^3e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3e}\advance\counter by1
-\catcode`\^^3f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3f}\advance\counter by1
-\catcode`\^^40=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^40}\advance\counter by1
-\catcode`\^^41=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^41}\advance\counter by1
-\catcode`\^^42=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^42}\advance\counter by1
-\catcode`\^^43=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^43}\advance\counter by1
-\catcode`\^^44=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^44}\advance\counter by1
-\catcode`\^^45=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^45}\advance\counter by1
-\catcode`\^^46=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^46}\advance\counter by1
-\catcode`\^^47=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^47}\advance\counter by1
-\catcode`\^^48=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^48}\advance\counter by1
-\catcode`\^^49=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^49}\advance\counter by1
-\catcode`\^^4a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4a}\advance\counter by1
-\catcode`\^^4b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4b}\advance\counter by1
-\catcode`\^^4c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4c}\advance\counter by1
-\catcode`\^^4d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4d}\advance\counter by1
-\catcode`\^^4e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4e}\advance\counter by1
-\catcode`\^^4f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4f}\advance\counter by1
-\catcode`\^^50=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^50}\advance\counter by1
-\catcode`\^^51=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^51}\advance\counter by1
-\catcode`\^^52=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^52}\advance\counter by1
-\catcode`\^^53=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^53}\advance\counter by1
-\catcode`\^^54=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^54}\advance\counter by1
-\catcode`\^^55=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^55}\advance\counter by1
-\catcode`\^^56=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^56}\advance\counter by1
-\catcode`\^^57=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^57}\advance\counter by1
-\catcode`\^^58=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^58}\advance\counter by1
-\catcode`\^^59=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^59}\advance\counter by1
-\catcode`\^^5a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5a}\advance\counter by1
-\catcode`\^^5b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5b}\advance\counter by1
-\begingroup
-\catcode`\|=0
-\catcode`\\=11 |expandafter|xdef|csname pgfp@bin@|the|counter|endcsname{^^5c}|endgroup \advance\counter by1
-\catcode`\^^5d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5d}\advance\counter by1
-\begingroup
-\catcode`\^^5e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^}\endgroup\advance\counter by1
-\catcode`\^^5f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5f}\advance\counter by1
-\begingroup
-\catcode`\^^60=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^60}\endgroup\advance\counter by1
-\catcode`\^^61=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^61}\advance\counter by1
-\catcode`\^^62=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^62}\advance\counter by1
-\catcode`\^^63=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^63}\advance\counter by1
-\catcode`\^^64=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^64}\advance\counter by1
-\catcode`\^^65=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^65}\advance\counter by1
-\catcode`\^^66=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^66}\advance\counter by1
-\catcode`\^^67=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^67}\advance\counter by1
-\catcode`\^^68=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^68}\advance\counter by1
-\catcode`\^^69=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^69}\advance\counter by1
-\catcode`\^^6a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6a}\advance\counter by1
-\catcode`\^^6b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6b}\advance\counter by1
-\catcode`\^^6c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6c}\advance\counter by1
-\catcode`\^^6d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6d}\advance\counter by1
-\catcode`\^^6e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6e}\advance\counter by1
-\catcode`\^^6f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6f}\advance\counter by1
-\catcode`\^^70=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^70}\advance\counter by1
-\catcode`\^^71=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^71}\advance\counter by1
-\catcode`\^^72=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^72}\advance\counter by1
-\catcode`\^^73=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^73}\advance\counter by1
-\catcode`\^^74=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^74}\advance\counter by1
-\catcode`\^^75=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^75}\advance\counter by1
-\catcode`\^^76=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^76}\advance\counter by1
-\catcode`\^^77=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^77}\advance\counter by1
-\catcode`\^^78=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^78}\advance\counter by1
-\catcode`\^^79=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^79}\advance\counter by1
-\catcode`\^^7a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7a}\advance\counter by1
-\begingroup
-\catcode`\q=1
-\catcode`\^^7b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname q^^7b}\endgroup\advance\counter by1
-\catcode`\^^7c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7c}\advance\counter by1
-\begingroup
-\catcode`\q=2
-\catcode`\^^7d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7dq\endgroup\advance\counter by1
-\catcode`\^^7e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7e}\advance\counter by1
-\catcode`\^^7f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7f}\advance\counter by1
-\catcode`\^^80=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^80}\advance\counter by1
-\catcode`\^^81=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^81}\advance\counter by1
-\catcode`\^^82=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^82}\advance\counter by1
-\catcode`\^^83=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^83}\advance\counter by1
-\catcode`\^^84=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^84}\advance\counter by1
-\catcode`\^^85=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^85}\advance\counter by1
-\catcode`\^^86=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^86}\advance\counter by1
-\catcode`\^^87=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^87}\advance\counter by1
-\catcode`\^^88=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^88}\advance\counter by1
-\catcode`\^^89=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^89}\advance\counter by1
-\catcode`\^^8a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8a}\advance\counter by1
-\catcode`\^^8b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8b}\advance\counter by1
-\catcode`\^^8c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8c}\advance\counter by1
-\catcode`\^^8d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8d}\advance\counter by1
-\catcode`\^^8e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8e}\advance\counter by1
-\catcode`\^^8f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8f}\advance\counter by1
-\catcode`\^^90=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^90}\advance\counter by1
-\catcode`\^^91=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^91}\advance\counter by1
-\catcode`\^^92=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^92}\advance\counter by1
-\catcode`\^^93=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^93}\advance\counter by1
-\catcode`\^^94=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^94}\advance\counter by1
-\catcode`\^^95=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^95}\advance\counter by1
-\catcode`\^^96=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^96}\advance\counter by1
-\catcode`\^^97=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^97}\advance\counter by1
-\catcode`\^^98=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^98}\advance\counter by1
-\catcode`\^^99=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^99}\advance\counter by1
-\catcode`\^^9a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9a}\advance\counter by1
-\catcode`\^^9b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9b}\advance\counter by1
-\catcode`\^^9c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9c}\advance\counter by1
-\catcode`\^^9d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9d}\advance\counter by1
-\catcode`\^^9e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9e}\advance\counter by1
-\catcode`\^^9f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9f}\advance\counter by1
-\catcode`\^^a0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a0}\advance\counter by1
-\catcode`\^^a1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a1}\advance\counter by1
-\catcode`\^^a2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a2}\advance\counter by1
-\catcode`\^^a3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a3}\advance\counter by1
-\catcode`\^^a4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a4}\advance\counter by1
-\catcode`\^^a5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a5}\advance\counter by1
-\catcode`\^^a6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a6}\advance\counter by1
-\catcode`\^^a7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a7}\advance\counter by1
-\catcode`\^^a8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a8}\advance\counter by1
-\catcode`\^^a9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a9}\advance\counter by1
-\catcode`\^^aa=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^aa}\advance\counter by1
-\catcode`\^^ab=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ab}\advance\counter by1
-\catcode`\^^ac=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ac}\advance\counter by1
-\catcode`\^^ad=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ad}\advance\counter by1
-\catcode`\^^ae=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ae}\advance\counter by1
-\catcode`\^^af=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^af}\advance\counter by1
-\catcode`\^^b0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b0}\advance\counter by1
-\catcode`\^^b1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b1}\advance\counter by1
-\catcode`\^^b2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b2}\advance\counter by1
-\catcode`\^^b3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b3}\advance\counter by1
-\catcode`\^^b4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b4}\advance\counter by1
-\catcode`\^^b5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b5}\advance\counter by1
-\catcode`\^^b6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b6}\advance\counter by1
-\catcode`\^^b7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b7}\advance\counter by1
-\catcode`\^^b8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b8}\advance\counter by1
-\catcode`\^^b9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b9}\advance\counter by1
-\catcode`\^^ba=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ba}\advance\counter by1
-\catcode`\^^bb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bb}\advance\counter by1
-\catcode`\^^bc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bc}\advance\counter by1
-\catcode`\^^bd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bd}\advance\counter by1
-\catcode`\^^be=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^be}\advance\counter by1
-\catcode`\^^bf=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bf}\advance\counter by1
-\catcode`\^^c0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c0}\advance\counter by1
-\catcode`\^^c1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c1}\advance\counter by1
-\catcode`\^^c2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c2}\advance\counter by1
-\catcode`\^^c3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c3}\advance\counter by1
-\catcode`\^^c4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c4}\advance\counter by1
-\catcode`\^^c5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c5}\advance\counter by1
-\catcode`\^^c6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c6}\advance\counter by1
-\catcode`\^^c7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c7}\advance\counter by1
-\catcode`\^^c8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c8}\advance\counter by1
-\catcode`\^^c9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c9}\advance\counter by1
-\catcode`\^^ca=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ca}\advance\counter by1
-\catcode`\^^cb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cb}\advance\counter by1
-\catcode`\^^cc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cc}\advance\counter by1
-\catcode`\^^cd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cd}\advance\counter by1
-\catcode`\^^ce=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ce}\advance\counter by1
-\catcode`\^^cf=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cf}\advance\counter by1
-\catcode`\^^d0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d0}\advance\counter by1
-\catcode`\^^d1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d1}\advance\counter by1
-\catcode`\^^d2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d2}\advance\counter by1
-\catcode`\^^d3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d3}\advance\counter by1
-\catcode`\^^d4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d4}\advance\counter by1
-\catcode`\^^d5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d5}\advance\counter by1
-\catcode`\^^d6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d6}\advance\counter by1
-\catcode`\^^d7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d7}\advance\counter by1
-\catcode`\^^d8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d8}\advance\counter by1
-\catcode`\^^d9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d9}\advance\counter by1
-\catcode`\^^da=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^da}\advance\counter by1
-\catcode`\^^db=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^db}\advance\counter by1
-\catcode`\^^dc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^dc}\advance\counter by1
-\catcode`\^^dd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^dd}\advance\counter by1
-\catcode`\^^de=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^de}\advance\counter by1
-\catcode`\^^df=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^df}\advance\counter by1
-\catcode`\^^e0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e0}\advance\counter by1
-\catcode`\^^e1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e1}\advance\counter by1
-\catcode`\^^e2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e2}\advance\counter by1
-\catcode`\^^e3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e3}\advance\counter by1
-\catcode`\^^e4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e4}\advance\counter by1
-\catcode`\^^e5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e5}\advance\counter by1
-\catcode`\^^e6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e6}\advance\counter by1
-\catcode`\^^e7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e7}\advance\counter by1
-\catcode`\^^e8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e8}\advance\counter by1
-\catcode`\^^e9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e9}\advance\counter by1
-\catcode`\^^ea=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ea}\advance\counter by1
-\catcode`\^^eb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^eb}\advance\counter by1
-\catcode`\^^ec=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ec}\advance\counter by1
-\catcode`\^^ed=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ed}\advance\counter by1
-\catcode`\^^ee=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ee}\advance\counter by1
-\catcode`\^^ef=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ef}\advance\counter by1
-\catcode`\^^f0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f0}\advance\counter by1
-\catcode`\^^f1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f1}\advance\counter by1
-\catcode`\^^f2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f2}\advance\counter by1
-\catcode`\^^f3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f3}\advance\counter by1
-\catcode`\^^f4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f4}\advance\counter by1
-\catcode`\^^f5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f5}\advance\counter by1
-\catcode`\^^f6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f6}\advance\counter by1
-\catcode`\^^f7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f7}\advance\counter by1
-\catcode`\^^f8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f8}\advance\counter by1
-\catcode`\^^f9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f9}\advance\counter by1
-\catcode`\^^fa=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fa}\advance\counter by1
-\catcode`\^^fb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fb}\advance\counter by1
-\catcode`\^^fc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fc}\advance\counter by1
-\catcode`\^^fd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fd}\advance\counter by1
-\catcode`\^^fe=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fe}\advance\counter by1
-\catcode`\^^ff=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ff}\advance\counter by1
-\ifnum\counter=256
-\else
- \pgfplots@error{Internal logic Error: initialisation failed. I have only \the\counter\space bytes initialised.}
-\fi
-\endgroup
% Returns a single character, which has the
% binary ASCII code '#1', with catcode 11.
@@ -334,6 +45,35 @@
% but can't be used inside of \edef (it is not expandable) whereas
% \pgfplotscharno is.
\def\pgfplotscharno#1{\csname pgfp@bin@#1\endcsname}%
+\let\pgfplotscharno@bincatcode=\pgfplotscharno
+
+\def\pgfplotscharno@lualatex#1{#1,}
+
+\input pgfplotsbinary.data.code.tex
+
+% Defines the LUA (!) value pgfplotsretval to be a binary string
+% containing the pgfplots binary value #1.
+%
+% #1 a pgfplots binary value collected with \pgfplotscharno.
+% More precisely, it should be a comma-separated sequence of numbers
+% of the form '0,255,2,128,' (can be terminated by comma). It will be
+% converted to the respective binary numbers 0x0, 0xff, 0x02,..
+%
+% example:
+% \pgfplotsbinarytoluabinary{0, 255,2,128}
+% \directlua{
+% pdf.immediateobj{"stream", pgfplotsretval,"/DataWithBinaryStream"}
+% }
+\def\pgfplotsbinarytoluabinary#1{%
+ % lualatex does not support binary chars as pdftex does - so we have to resort to LUA
+ % methods. The idea is to use
+ % string.char(1,2,3) which results in a binary string with chars 0x01, 0x02, 0x03 etc.
+ % I only need to get the integer numbers. To this end, I patch \pgfplotscharno
+ % and create the binary string here:
+ \directlua{%
+ pgfplotsretval = pgfplotsGetLuaBinaryStringFromCharIndices({#1});
+ }%
+}%
% Defines \pgfplotsretval to be the ASCII character for #1, with
% catcode 11.
@@ -351,7 +91,7 @@
\def\pgfplotsgetchar#1{%
\begingroup
\count0=#1\relax
- \edef\pgfplotsretval{\csname pgfp@bin@\the\count0 \endcsname}%
+ \edef\pgfplotsretval{\pgfplotscharno{\the\count0 }}%
\pgfmath@smuggleone\pgfplotsretval
\endgroup
}%
@@ -480,8 +220,27 @@
%
% The standard method - it results in binary encoded numbers.
binary encoding/.code={%
- \expandafter\let\expandafter\pgfplotsbinary@ZERO\csname pgfp@bin@0\endcsname
- \expandafter\let\expandafter\pgfplotsbinary@ZERO@LINEARMAP\csname pgfp@bin@128\endcsname
+ \pgfutil@ifundefined{directlua}{%
+ \let\pgfplotscharno=\pgfplotscharno@bincatcode
+ }{%
+ % Ah - we use LuaTeX!
+ % At the time of this writing, LUA does not allow binary output which has been
+ % created by means of catcode modifications & TeX string concatenation.
+ % binary output in LUA needs to be (re)implemented in LUA (see inline code
+ % comments below).
+ %
+ % There are two possible work-arounds:
+ % (a) Base64 encoding
+ % (b) binary encoding using special LUA handling.
+ % This is what I do. Set the 'encode filter' such that it reinitializes the encoder:
+ % we patch \pgfplotscharno with a special routine which collects
+ % only the integer indices:
+ \let\pgfplotscharno=\pgfplotscharno@lualatex
+ % later, the user has to convert this list into a binary lua
+ % string before he can use it. See \pgfplotsbinarytoluabinary
+ }%
+ \edef\pgfplotsbinary@ZERO{\pgfplotscharno0}%
+ \edef\pgfplotsbinary@ZERO@LINEARMAP{\pgfplotscharno{128}}%
\let\pgfplotsbinary@ZERO@HIGHEST=\pgfplotsbinary@ZERO
\def\pgfplotsbinary@basis{256}%
\let\pgfplotsbinary@hook=\relax
@@ -489,7 +248,7 @@
\ifnum\c@pgfplotsbin@byteno=0
\advance\c@pgfplotsbin@input by128
\ifnum\c@pgfplotsbin@input>255
- \pgfplots@error{Sorry, there are not enough bytes to store the current number. I tried to write \the\c@pgfplotsbin@input...}%
+ \pgfplotsbinary@hook@signed@linearmap@error
\fi
\fi
}%
@@ -509,8 +268,9 @@
% Please note that 'bytes' sets the number of binary bytes - the
% actual encoding length is exactly twice as large.
ASCIIHexEncode/.code={%
- \expandafter\let\expandafter\pgfplotsbinary@ZERO\csname pgfp@bin@48\endcsname
- \expandafter\let\expandafter\pgfplotsbinary@ZERO@LINEARMAP\csname pgfp@bin@56\endcsname
+ \let\pgfplotscharno=\pgfplotscharno@bincatcode
+ \edef\pgfplotsbinary@ZERO{\pgfplotscharno{48}}%
+ \edef\pgfplotsbinary@ZERO@LINEARMAP{\pgfplotscharno{56}}%
\let\pgfplotsbinary@ZERO@HIGHEST=\pgfplotsbinary@ZERO
\pgfkeysalso{/pgfplots/bin/ordering/big endian}%
\def\pgfplotsbinary@basis{16}%
@@ -526,7 +286,7 @@
\ifnum\c@pgfplotsbin@byteno=0
\advance\c@pgfplotsbin@input by8
\ifnum\c@pgfplotsbin@input>16
- \pgfplots@error{Sorry, there are not enough bytes to store the current number. I tried to write \the\c@pgfplotsbin@input...}%
+ \pgfplotsbinary@hook@signed@linearmap@error
\fi
\fi
\pgfplotsbinary@hook@hex
@@ -558,8 +318,9 @@
% @ATTENTION bytes is ALWAYS 4, regardless of the setting of
% 'bytes'!
ASCII85Encode/.code={%
- \expandafter\let\expandafter\pgfplotsbinary@ZERO\csname pgfp@bin@33\endcsname
- \expandafter\let\expandafter\pgfplotsbinary@ZERO@LINEARMAP\csname pgfp@bin@42\endcsname
+ \let\pgfplotscharno=\pgfplotscharno@bincatcode
+ \edef\pgfplotsbinary@ZERO{\pgfplotscharno{33}}%
+ \edef\pgfplotsbinary@ZERO@LINEARMAP{\pgfplotscharno{42}}%
\let\pgfplotsbinary@ZERO@HIGHEST=\pgfplotsbinary@ZERO
\pgfkeysalso{/pgfplots/bin/ordering/big endian}%
\edef\pgfplotsbinary@ASCII@specialzero{\pgfplotsbinary@ZERO\pgfplotsbinary@ZERO\pgfplotsbinary@ZERO\pgfplotsbinary@ZERO\pgfplotsbinary@ZERO}%
@@ -579,7 +340,7 @@
\ifnum\c@pgfplotsbin@byteno=0
\advance\c@pgfplotsbin@input by42
\ifnum\c@pgfplotsbin@input>85
- \pgfplots@error{Sorry, there are not enough bytes to store the current number. I tried to write \the\c@pgfplotsbin@input...}%
+ \pgfplotsbinary@hook@signed@linearmap@error
\fi
\fi
}%
@@ -603,7 +364,7 @@
\let\pgfplotsbinary@ZERO@HIGHEST=\pgfplotsbinary@ZERO
\def\pgfplotsbinary@ZERO@LINEARMAP{[Pad-128]}%
\def\pgfplotsbinary@apphighorderbytes##1{%
- \pgfutil@ifnextchar\csname{%
+ \pgfutil@ifnextchar\pgfplotscharno{%
\pgfplotsbinary@apphighorderbytes@DEBUG@csname
}{%
\pgfplotsbinary@apphighorderbytes@DEBUG@normal
@@ -633,8 +394,11 @@
}
+\def\pgfplotsbinary@hook@signed@linearmap@error{%
+ \pgfplots@error{Sorry, there are not enough bytes to store the current number. I tried to write \the\c@pgfplotsbin@input...}%
+}%
-\def\pgfplotsbinary@apphighorderbytes@DEBUG@csname \csname pgfp@bin@#1\endcsname\relax{%
+\def\pgfplotsbinary@apphighorderbytes@DEBUG@csname\pgfplotscharno#1\relax{%
\pgfplotsbinary@apphighorderbytes@ORIG{[#1]}%
}%
\def\pgfplotsbinary@apphighorderbytes@DEBUG@normal#1\relax{%
@@ -678,7 +442,7 @@
\advance\c@pgfplotsbin@input by -\c@pgfplotsbin@tmpa\relax
\advance\c@pgfplotsbin@byteno by-1
\pgfplotsbinary@hook% hooks for modifications.
- \pgfplotsbinary@apphighorderbytes{\csname pgfp@bin@\the\c@pgfplotsbin@input\endcsname}%
+ \pgfplotsbinary@apphighorderbytes{\pgfplotscharno{\the\c@pgfplotsbin@input}}%
\c@pgfplotsbin@input=\c@pgfplotsbin@tmpb
%\message{RESULT SO FAR byte no \the\c@pgfplotsbin@byteno: \pgfplotsbinaryresult}%
\expandafter\pgfplotsbinaryencode@badic@unsigned@
diff --git a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.data.code.tex b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.data.code.tex
new file mode 100644
index 00000000000..6483daf68f3
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsbinary.data.code.tex
@@ -0,0 +1,291 @@
+\begingroup
+% prepare ONE-BYTE conversion [0-255] -> binary character:
+\count0=0
+\countdef\counter=0
+\catcode`\^^00=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^00}\advance\counter by1
+\catcode`\^^01=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^01}\advance\counter by1
+\catcode`\^^02=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^02}\advance\counter by1
+\catcode`\^^03=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^03}\advance\counter by1
+\catcode`\^^04=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^04}\advance\counter by1
+\catcode`\^^05=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^05}\advance\counter by1
+\catcode`\^^06=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^06}\advance\counter by1
+\catcode`\^^07=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^07}\advance\counter by1
+\catcode`\^^08=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^08}\advance\counter by1
+\begingroup
+\catcode`\^^09=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^09}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^0a=11\expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0a}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^0b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0b}\endgroup\advance\counter by1
+\catcode`\^^0c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0c}\advance\counter by1
+\begingroup
+\catcode`\^^0d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0d}\endgroup\advance\counter by1
+\catcode`\^^0e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0e}\advance\counter by1
+\catcode`\^^0f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^0f}\advance\counter by1
+\catcode`\^^10=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^10}\advance\counter by1
+\catcode`\^^11=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^11}\advance\counter by1
+\catcode`\^^12=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^12}\advance\counter by1
+\catcode`\^^13=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^13}\advance\counter by1
+\catcode`\^^14=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^14}\advance\counter by1
+\catcode`\^^15=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^15}\advance\counter by1
+\catcode`\^^16=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^16}\advance\counter by1
+\catcode`\^^17=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^17}\advance\counter by1
+\catcode`\^^18=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^18}\advance\counter by1
+\catcode`\^^19=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^19}\advance\counter by1
+\catcode`\^^1a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1a}\advance\counter by1
+\catcode`\^^1b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1b}\advance\counter by1
+\catcode`\^^1c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1c}\advance\counter by1
+\catcode`\^^1d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1d}\advance\counter by1
+\catcode`\^^1e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1e}\advance\counter by1
+\catcode`\^^1f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^1f}\advance\counter by1
+\begingroup
+\catcode`\^^20=11^^I\expandafter\xdef\csname^^Ipgfp@bin@\the\counter^^I\endcsname{^^20}\endgroup\advance\counter by1
+\catcode`\^^21=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^21}\advance\counter by1
+\catcode`\^^22=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^22}\advance\counter by1
+\catcode`\^^23=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^23}\advance\counter by1
+\catcode`\^^24=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^24}\advance\counter by1
+\catcode`\^^25=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^25}\advance\counter by1
+\catcode`\^^26=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^26}\advance\counter by1
+\catcode`\^^27=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^27}\advance\counter by1
+\catcode`\^^28=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^28}\advance\counter by1
+\catcode`\^^29=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^29}\advance\counter by1
+\catcode`\^^2a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2a}\advance\counter by1
+\catcode`\^^2b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2b}\advance\counter by1
+\catcode`\^^2c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2c}\advance\counter by1
+\catcode`\^^2d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2d}\advance\counter by1
+\catcode`\^^2e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2e}\advance\counter by1
+\catcode`\^^2f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^2f}\advance\counter by1
+\begingroup
+\catcode`\^^30=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^30}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^31=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^31}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^32=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^32}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^33=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^33}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^34=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^34}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^35=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^35}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^36=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^36}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^37=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^37}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^38=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^38}\endgroup\advance\counter by1
+\begingroup
+\catcode`\^^39=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^39}\endgroup\advance\counter by1
+\catcode`\^^3a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3a}\advance\counter by1
+\catcode`\^^3b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3b}\advance\counter by1
+\catcode`\^^3c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3c}\advance\counter by1
+\begingroup
+\catcode`\^^3d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3d}\endgroup\advance\counter by1
+\catcode`\^^3e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3e}\advance\counter by1
+\catcode`\^^3f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^3f}\advance\counter by1
+\catcode`\^^40=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^40}\advance\counter by1
+\catcode`\^^41=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^41}\advance\counter by1
+\catcode`\^^42=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^42}\advance\counter by1
+\catcode`\^^43=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^43}\advance\counter by1
+\catcode`\^^44=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^44}\advance\counter by1
+\catcode`\^^45=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^45}\advance\counter by1
+\catcode`\^^46=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^46}\advance\counter by1
+\catcode`\^^47=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^47}\advance\counter by1
+\catcode`\^^48=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^48}\advance\counter by1
+\catcode`\^^49=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^49}\advance\counter by1
+\catcode`\^^4a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4a}\advance\counter by1
+\catcode`\^^4b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4b}\advance\counter by1
+\catcode`\^^4c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4c}\advance\counter by1
+\catcode`\^^4d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4d}\advance\counter by1
+\catcode`\^^4e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4e}\advance\counter by1
+\catcode`\^^4f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^4f}\advance\counter by1
+\catcode`\^^50=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^50}\advance\counter by1
+\catcode`\^^51=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^51}\advance\counter by1
+\catcode`\^^52=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^52}\advance\counter by1
+\catcode`\^^53=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^53}\advance\counter by1
+\catcode`\^^54=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^54}\advance\counter by1
+\catcode`\^^55=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^55}\advance\counter by1
+\catcode`\^^56=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^56}\advance\counter by1
+\catcode`\^^57=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^57}\advance\counter by1
+\catcode`\^^58=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^58}\advance\counter by1
+\catcode`\^^59=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^59}\advance\counter by1
+\catcode`\^^5a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5a}\advance\counter by1
+\catcode`\^^5b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5b}\advance\counter by1
+\begingroup
+\catcode`\|=0
+\catcode`\\=11 |expandafter|xdef|csname pgfp@bin@|the|counter|endcsname{^^5c}|endgroup \advance\counter by1
+\catcode`\^^5d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5d}\advance\counter by1
+\begingroup
+\catcode`\^^5e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^}\endgroup\advance\counter by1
+\catcode`\^^5f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^5f}\advance\counter by1
+\begingroup
+\catcode`\^^60=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^60}\endgroup\advance\counter by1
+\catcode`\^^61=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^61}\advance\counter by1
+\catcode`\^^62=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^62}\advance\counter by1
+\catcode`\^^63=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^63}\advance\counter by1
+\catcode`\^^64=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^64}\advance\counter by1
+\catcode`\^^65=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^65}\advance\counter by1
+\catcode`\^^66=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^66}\advance\counter by1
+\catcode`\^^67=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^67}\advance\counter by1
+\catcode`\^^68=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^68}\advance\counter by1
+\catcode`\^^69=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^69}\advance\counter by1
+\catcode`\^^6a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6a}\advance\counter by1
+\catcode`\^^6b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6b}\advance\counter by1
+\catcode`\^^6c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6c}\advance\counter by1
+\catcode`\^^6d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6d}\advance\counter by1
+\catcode`\^^6e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6e}\advance\counter by1
+\catcode`\^^6f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^6f}\advance\counter by1
+\catcode`\^^70=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^70}\advance\counter by1
+\catcode`\^^71=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^71}\advance\counter by1
+\catcode`\^^72=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^72}\advance\counter by1
+\catcode`\^^73=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^73}\advance\counter by1
+\catcode`\^^74=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^74}\advance\counter by1
+\catcode`\^^75=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^75}\advance\counter by1
+\catcode`\^^76=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^76}\advance\counter by1
+\catcode`\^^77=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^77}\advance\counter by1
+\catcode`\^^78=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^78}\advance\counter by1
+\catcode`\^^79=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^79}\advance\counter by1
+\catcode`\^^7a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7a}\advance\counter by1
+\begingroup
+\catcode`\q=1
+\catcode`\^^7b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname q^^7b}\endgroup\advance\counter by1
+\catcode`\^^7c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7c}\advance\counter by1
+\begingroup
+\catcode`\q=2
+\catcode`\^^7d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7dq\endgroup\advance\counter by1
+\catcode`\^^7e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7e}\advance\counter by1
+\catcode`\^^7f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^7f}\advance\counter by1
+\catcode`\^^80=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^80}\advance\counter by1
+\catcode`\^^81=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^81}\advance\counter by1
+\catcode`\^^82=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^82}\advance\counter by1
+\catcode`\^^83=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^83}\advance\counter by1
+\catcode`\^^84=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^84}\advance\counter by1
+\catcode`\^^85=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^85}\advance\counter by1
+\catcode`\^^86=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^86}\advance\counter by1
+\catcode`\^^87=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^87}\advance\counter by1
+\catcode`\^^88=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^88}\advance\counter by1
+\catcode`\^^89=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^89}\advance\counter by1
+\catcode`\^^8a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8a}\advance\counter by1
+\catcode`\^^8b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8b}\advance\counter by1
+\catcode`\^^8c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8c}\advance\counter by1
+\catcode`\^^8d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8d}\advance\counter by1
+\catcode`\^^8e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8e}\advance\counter by1
+\catcode`\^^8f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^8f}\advance\counter by1
+\catcode`\^^90=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^90}\advance\counter by1
+\catcode`\^^91=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^91}\advance\counter by1
+\catcode`\^^92=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^92}\advance\counter by1
+\catcode`\^^93=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^93}\advance\counter by1
+\catcode`\^^94=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^94}\advance\counter by1
+\catcode`\^^95=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^95}\advance\counter by1
+\catcode`\^^96=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^96}\advance\counter by1
+\catcode`\^^97=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^97}\advance\counter by1
+\catcode`\^^98=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^98}\advance\counter by1
+\catcode`\^^99=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^99}\advance\counter by1
+\catcode`\^^9a=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9a}\advance\counter by1
+\catcode`\^^9b=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9b}\advance\counter by1
+\catcode`\^^9c=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9c}\advance\counter by1
+\catcode`\^^9d=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9d}\advance\counter by1
+\catcode`\^^9e=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9e}\advance\counter by1
+\catcode`\^^9f=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^9f}\advance\counter by1
+\catcode`\^^a0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a0}\advance\counter by1
+\catcode`\^^a1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a1}\advance\counter by1
+\catcode`\^^a2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a2}\advance\counter by1
+\catcode`\^^a3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a3}\advance\counter by1
+\catcode`\^^a4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a4}\advance\counter by1
+\catcode`\^^a5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a5}\advance\counter by1
+\catcode`\^^a6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a6}\advance\counter by1
+\catcode`\^^a7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a7}\advance\counter by1
+\catcode`\^^a8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a8}\advance\counter by1
+\catcode`\^^a9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^a9}\advance\counter by1
+\catcode`\^^aa=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^aa}\advance\counter by1
+\catcode`\^^ab=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ab}\advance\counter by1
+\catcode`\^^ac=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ac}\advance\counter by1
+\catcode`\^^ad=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ad}\advance\counter by1
+\catcode`\^^ae=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ae}\advance\counter by1
+\catcode`\^^af=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^af}\advance\counter by1
+\catcode`\^^b0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b0}\advance\counter by1
+\catcode`\^^b1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b1}\advance\counter by1
+\catcode`\^^b2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b2}\advance\counter by1
+\catcode`\^^b3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b3}\advance\counter by1
+\catcode`\^^b4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b4}\advance\counter by1
+\catcode`\^^b5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b5}\advance\counter by1
+\catcode`\^^b6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b6}\advance\counter by1
+\catcode`\^^b7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b7}\advance\counter by1
+\catcode`\^^b8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b8}\advance\counter by1
+\catcode`\^^b9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^b9}\advance\counter by1
+\catcode`\^^ba=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ba}\advance\counter by1
+\catcode`\^^bb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bb}\advance\counter by1
+\catcode`\^^bc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bc}\advance\counter by1
+\catcode`\^^bd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bd}\advance\counter by1
+\catcode`\^^be=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^be}\advance\counter by1
+\catcode`\^^bf=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^bf}\advance\counter by1
+\catcode`\^^c0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c0}\advance\counter by1
+\catcode`\^^c1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c1}\advance\counter by1
+\catcode`\^^c2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c2}\advance\counter by1
+\catcode`\^^c3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c3}\advance\counter by1
+\catcode`\^^c4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c4}\advance\counter by1
+\catcode`\^^c5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c5}\advance\counter by1
+\catcode`\^^c6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c6}\advance\counter by1
+\catcode`\^^c7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c7}\advance\counter by1
+\catcode`\^^c8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c8}\advance\counter by1
+\catcode`\^^c9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^c9}\advance\counter by1
+\catcode`\^^ca=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ca}\advance\counter by1
+\catcode`\^^cb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cb}\advance\counter by1
+\catcode`\^^cc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cc}\advance\counter by1
+\catcode`\^^cd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cd}\advance\counter by1
+\catcode`\^^ce=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ce}\advance\counter by1
+\catcode`\^^cf=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^cf}\advance\counter by1
+\catcode`\^^d0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d0}\advance\counter by1
+\catcode`\^^d1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d1}\advance\counter by1
+\catcode`\^^d2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d2}\advance\counter by1
+\catcode`\^^d3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d3}\advance\counter by1
+\catcode`\^^d4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d4}\advance\counter by1
+\catcode`\^^d5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d5}\advance\counter by1
+\catcode`\^^d6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d6}\advance\counter by1
+\catcode`\^^d7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d7}\advance\counter by1
+\catcode`\^^d8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d8}\advance\counter by1
+\catcode`\^^d9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^d9}\advance\counter by1
+\catcode`\^^da=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^da}\advance\counter by1
+\catcode`\^^db=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^db}\advance\counter by1
+\catcode`\^^dc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^dc}\advance\counter by1
+\catcode`\^^dd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^dd}\advance\counter by1
+\catcode`\^^de=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^de}\advance\counter by1
+\catcode`\^^df=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^df}\advance\counter by1
+\catcode`\^^e0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e0}\advance\counter by1
+\catcode`\^^e1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e1}\advance\counter by1
+\catcode`\^^e2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e2}\advance\counter by1
+\catcode`\^^e3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e3}\advance\counter by1
+\catcode`\^^e4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e4}\advance\counter by1
+\catcode`\^^e5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e5}\advance\counter by1
+\catcode`\^^e6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e6}\advance\counter by1
+\catcode`\^^e7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e7}\advance\counter by1
+\catcode`\^^e8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e8}\advance\counter by1
+\catcode`\^^e9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^e9}\advance\counter by1
+\catcode`\^^ea=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ea}\advance\counter by1
+\catcode`\^^eb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^eb}\advance\counter by1
+\catcode`\^^ec=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ec}\advance\counter by1
+\catcode`\^^ed=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ed}\advance\counter by1
+\catcode`\^^ee=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ee}\advance\counter by1
+\catcode`\^^ef=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ef}\advance\counter by1
+\catcode`\^^f0=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f0}\advance\counter by1
+\catcode`\^^f1=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f1}\advance\counter by1
+\catcode`\^^f2=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f2}\advance\counter by1
+\catcode`\^^f3=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f3}\advance\counter by1
+\catcode`\^^f4=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f4}\advance\counter by1
+\catcode`\^^f5=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f5}\advance\counter by1
+\catcode`\^^f6=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f6}\advance\counter by1
+\catcode`\^^f7=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f7}\advance\counter by1
+\catcode`\^^f8=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f8}\advance\counter by1
+\catcode`\^^f9=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^f9}\advance\counter by1
+\catcode`\^^fa=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fa}\advance\counter by1
+\catcode`\^^fb=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fb}\advance\counter by1
+\catcode`\^^fc=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fc}\advance\counter by1
+\catcode`\^^fd=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fd}\advance\counter by1
+\catcode`\^^fe=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^fe}\advance\counter by1
+\catcode`\^^ff=11 \expandafter\xdef\csname pgfp@bin@\the\counter \endcsname{^^ff}\advance\counter by1
+\ifnum\counter=256
+\else
+ \pgfplots@error{Internal logic Error: initialisation failed. I have only \the\counter\space bytes initialised.}
+\fi
+\endgroup
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
index 2dacf8f7458..0c1f8dc41fe 100644
--- a/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
+++ b/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
@@ -144,7 +144,8 @@
}{%
\let#1=\tikz@plot@handler
}%
-}%
+}
+
% Converts an arbitrary command (without arguments) to a string in which all characters
@@ -426,16 +427,20 @@
\expandafter\let\csname #1\endcsname=\pgfplots@loc@TMPc
}%
-% I have introduced this macro to allow optimizations of (x,y)
-% coordinate processing. Use it for everything which is directly plot
-% related.
-%
-% @see \pgfplotsqpointxy@orthogonal
+% Inside of a pgfplots axis, this method (together with
+% \pgfplotsqpointxyz for 3d axes) is THE
+% point method. If you override the mapping to PGF coordinates here,
+% all other \pgfplotspoint* commands should inherit the changes as well.
\def\pgfplotsqpointxy#1#2{%
\global\pgf@x=#1\pgf@xx%
\global\advance\pgf@x by #2\pgf@yx%
\global\pgf@y=#1\pgf@xy%
\global\advance\pgf@y by #2\pgf@yy}
+
+% Inside of a pgfplots axis, this method (together with
+% \pgfplotsqpointxy for 2d axes) is THE
+% point method. If you override the mapping to PGF coordinates here,
+% all other \pgfplotspoint* commands should inherit the changes as well.
\def\pgfplotsqpointxyz#1#2#3{%
\global\pgf@x=#1\pgf@xx%
\global\advance\pgf@x by #2\pgf@yx%
@@ -860,6 +865,69 @@
\ifx\pgfplots@loc@TMPa\pgfutil@empty #2\else #3\fi
}%
+{
+ \catcode`\#=12
+ \catcode`\1=12
+ \gdef\pgfplotsutil@add@to@macro@@one{#1}%
+ \gdef\pgfplotsutil@add@to@macro@@two{#1#2}%
+}
+
+\def\pgfplotsutil@ifmacrodependsononearg#1#2#3{%
+ \edef\pgfplots@loc@TMPa{\noexpand\pgfutil@in@{\pgfplotsutil@add@to@macro@@one}{\meaning#1}}%
+ \pgfplots@loc@TMPa
+ \ifpgfutil@in@
+ #2%
+ \else
+ #3%
+ \fi
+}%
+
+\def\pgfplotsutil@ifmacrodependsontwoargs#1#2#3{%
+ \edef\pgfplots@util@add@to@macro@@{\noexpand\pgfutil@in@{\pgfplotsutil@add@to@macro@@two}{\meaning#1}}%
+ \pgfplots@util@add@to@macro@@
+ \ifpgfutil@in@
+ #2%
+ \else
+ #3%
+ \fi
+}%
+
+% Appends '#2' to macro '#1'.
+%
+% #1: a macro which takes either no arguments or exactly one.
+% #2: some token text. May depend on '#1' if #1 is a macro which
+% depends on one arg.
+\def\pgfplotsutil@add@to@macro#1#2{%
+ \pgfplotsutil@ifmacrodependsononearg#1{%
+ \pgfplotsutil@ifmacrodependsontwoargs#1{%
+ \pgfplotsutil@add@to@macro@twoargs{#1}{#2}%
+ }{%
+ \pgfplotsutil@add@to@macro@onearg{#1}{#2}%
+ }%
+ }{%
+ \pgfplotsutil@add@to@macro@noargs{#1}{#2}%
+ }%
+}%
+
+\def\pgfplotsutil@add@to@macro@twoargs#1#2{%
+ \t@pgfplots@tokc=\expandafter{#1{##1}{##2}}%
+ \t@pgfplots@tokb={#2}%
+ \edef\pgfplots@util@add@to@macro@@{\the\t@pgfplots@tokc\the\t@pgfplots@tokb}%
+ \expandafter\def\expandafter#1\expandafter##\expandafter1\expandafter##\expandafter2\expandafter{\pgfplots@util@add@to@macro@@}%
+}
+
+\def\pgfplotsutil@add@to@macro@onearg#1#2{%
+ \t@pgfplots@tokc=\expandafter{#1{##1}}%
+ \t@pgfplots@tokb={#2}%
+ \edef\pgfplots@util@add@to@macro@@{\the\t@pgfplots@tokc\the\t@pgfplots@tokb}%
+ \expandafter\def\expandafter#1\expandafter##\expandafter1\expandafter{\pgfplots@util@add@to@macro@@}%
+}
+
+\def\pgfplotsutil@add@to@macro@noargs#1#2{%
+ \t@pgfplots@tokc=\expandafter{#1}%
+ \t@pgfplots@tokb=\expandafter{#2}%
+ \edef#1{\the\t@pgfplots@tokc\the\t@pgfplots@tokb}%
+}
\def\pgfplots@logfileopen#1{%
\immediate\write-1{PGFPlots: reading {#1}}%
\pgfutil@ifundefined{tikzifexternalizingcurrent}{%
@@ -1551,6 +1619,349 @@
\def\:{\pgfplotsutil@xifnch} \expandafter\gdef\: {\futurelet\pgfplotsutil@let@token\pgfplotsutil@ifnch}
}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% basic 3d linear algebra utils.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Converts a 3d vectors to string.
+% #1: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the result vector.
+% #3: the argument for \pgfplotscoordmath (such as 'default')
+%
+\def\pgfplotsmathvectortostring#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectorcompwiseop@unary\pgfplots@loc@TMPa\pgfplots@EOI{#2}{{tostring}}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Reads a 3d vector's coordinates.
+% #1: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the result vector.
+% #2: the argument for \pgfplotscoordmath (such as 'default')
+%
+% Example:
+% \pgfplotsmathvectorfromstring{1,4,5}{default}
+% will parse each component
+\def\pgfplotsmathvectorfromstring#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectorcompwiseop@unary\pgfplots@loc@TMPa\pgfplots@EOI{#2}{{parsenumber}}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Takes two 3d vectors and subtracts them.
+% #1: a vector which expands to the form 'x,y,z'
+% #2: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the difference vector.
+% #3: the argument for \pgfplotscoordmath (such as 'default')
+%
+\def\pgfplotsmathvectorsubtract#1#2#3{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorcompwiseop@binary\pgfplots@loc@TMPa\pgfplots@EOI{#3}{subtract}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsmathvectorcompwiseop@binary#1,#2,#3:#4,#5,#6\pgfplots@EOI#7#8{%
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \def\Bx{#4}%
+ \def\By{#5}%
+ \def\Bz{#6}%
+ \pgfplotscoordmath{#7}{op}{#8}{{\Ax}{\Bx}}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{#8}{{\Ay}{\By}}%
+ \let\pgfplots@loc@TMPb=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{#8}{{\Az}{\Bz}}%
+ \let\pgfplots@loc@TMPc=\pgfmathresult
+ \edef\pgfplotsretval{\pgfplots@loc@TMPa,\pgfplots@loc@TMPb,\pgfplots@loc@TMPc}%
+}%
+
+% #5: an operation ENCLOSED IN BRACES!
+% like '{tostring}' or '{op}{<someunaryop>}'
+\def\pgfplotsmathvectorcompwiseop@unary#1,#2,#3\pgfplots@EOI#4#5{%
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \pgfplotscoordmath{#4}#5{\Ax}%
+ \let\pgfplots@loc@TMPa=\pgfmathresult
+ \pgfplotscoordmath{#4}#5{\Ay}%
+ \let\pgfplots@loc@TMPb=\pgfmathresult
+ \pgfplotscoordmath{#4}#5{\Az}%
+ \let\pgfplots@loc@TMPc=\pgfmathresult
+ \edef\pgfplotsretval{\pgfplots@loc@TMPa,\pgfplots@loc@TMPb,\pgfplots@loc@TMPc}%
+}%
+
+% Takes two 3d vectors and adds them.
+% #1: a vector which expands to the form 'x,y,z'
+% #2: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the added vector.
+% #3: the argument for \pgfplotscoordmath (such as 'default')
+%
+\def\pgfplotsmathvectoradd#1#2#3{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorcompwiseop@binary\pgfplots@loc@TMPa\pgfplots@EOI{#3}{add}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Takes two 3d vectors and applies a component-wise operation.
+% #1: a vector which expands to the form 'x,y,z'
+% #2: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain a boolean vector with three
+% entries.
+% #3: a scalar operation which takes two arguments (such as "add", "subtract", "equal")
+% #4 the argument for \pgfplotscoordmath (such as 'default')
+%
+% Example: \pgfplotsmathvectorcompwise{1,1,1}{0,1,0}{add}{pgfbasic}
+% -> \pgfplotsretval={1.0,2.0,1.0}
+\def\pgfplotsmathvectorcompwise#1#2#3#4{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorcompwiseop@binary\pgfplots@loc@TMPa\pgfplots@EOI{#4}{#3}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Defines \pgfplotsretval to x+y+z
+% #1: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the result scalar.
+% #2: the argument for \pgfplotscoordmath (such as 'default')
+%
+% Example:
+% \pgfplotsmathvectorsum{1,4,5}{default}
+% \pgfplotsretval = 10 (in that format)
+\def\pgfplotsmathvectorsum#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectorsum@\pgfplots@loc@TMPa\pgfplots@EOI{#2}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+\def\pgfplotsmathvectorsum@#1,#2,#3\pgfplots@EOI#4{%
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \pgfplotscoordmath{#4}{op}{add}{{\Ax}{\Ay}}%
+ \let\pgfplotsretval=\pgfmathresult
+ \pgfplotscoordmath{#4}{op}{add}{{\pgfplotsretval}{\Az}}%
+ \let\pgfplotsretval=\pgfmathresult
+}%
+
+% Computes the euclidean scalar product of two 3d vectors #1 and #2 in math
+% format #3.
+\def\pgfplotsmathvectorscalarproduct#1#2#3{%
+ \pgfplotsmathvectorscaleindividually{#1}{#2}{#3}%
+ \pgfplotsmathvectorsum{\pgfplotsretval}{#3}%
+}%
+
+% takes a vector #1 and defines three new macros
+% \csname #2x\endcsname,
+% \csname #2y\endcsname,
+% \csname #2z\endcsname,
+% with the components.
+% #3: the math format
+\def\pgfplotsmathvectortocomponents#1#2#3{%
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectortocomponents@\pgfplots@loc@TMPa\pgfplots@EOI{#3}{#2}%
+}%
+\def\pgfplotsmathvectortocomponents@#1,#2,#3\pgfplots@EOI#4#5{%
+ \expandafter\def\csname #5x\endcsname{#1}%
+ \expandafter\def\csname #5y\endcsname{#2}%
+ \expandafter\def\csname #5z\endcsname{#3}%
+}%
+
+
+% Takes two 3d vectors and computes their cross product.
+% #1: a vector which expands to the form 'x,y,z'
+% #2: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the result vector.
+% #3: the argument for \pgfplotscoordmath (such as 'default')
+%
+\def\pgfplotsmathvectorcrossprod#1#2#3{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorcrossprod@\pgfplots@loc@TMPa\pgfplots@EOI{#3}%
+%\message{\string\pgfplotsmathvectorcrossprod{#1}{#2} = \pgfplotsretval^^J}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsmathvectorcrossprod@#1,#2,#3:#4,#5,#6\pgfplots@EOI#7{%
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \def\Bx{#4}%
+ \def\By{#5}%
+ \def\Bz{#6}%
+ %
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ay}{\Bz}}\let\AyBz=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Az}{\By}}\let\AzBy=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Az}{\Bx}}\let\AzBx=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ax}{\Bz}}\let\AxBz=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ax}{\By}}\let\AxBy=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ay}{\Bx}}\let\AyBx=\pgfmathresult
+ %
+ \pgfplotscoordmath{#7}{op}{subtract}{{\AyBz}{\AzBy}}\let\pgfplots@loc@TMPa=\pgfmathresult%
+ \pgfplotscoordmath{#7}{op}{subtract}{{\AzBx}{\AxBz}}\let\pgfplots@loc@TMPb=\pgfmathresult%
+ \pgfplotscoordmath{#7}{op}{subtract}{{\AxBy}{\AyBx}}\let\pgfplots@loc@TMPc=\pgfmathresult%
+ \edef\pgfplotsretval{\pgfplots@loc@TMPa,\pgfplots@loc@TMPb,\pgfplots@loc@TMPc}%
+}%
+
+% Takes two 3d vectors and defines a new vector (Ax*Bx,Ay*By,Az*Bz)
+% #1: a vector which expands to the form 'x,y,z'
+% #2: a vector which expands to the form 'x,y,z'
+% on output, \pgfplotsretval will contain the result vector.
+% #3: the argument for \pgfplotscoordmath (such as 'default')
+%
+\def\pgfplotsmathvectorscaleindividually#1#2#3{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorscaleindividually@\pgfplots@loc@TMPa\pgfplots@EOI{#3}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsmathvectorscaleindividually@#1,#2,#3:#4,#5,#6\pgfplots@EOI#7{%
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \def\Bx{#4}%
+ \def\By{#5}%
+ \def\Bz{#6}%
+ %
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ax}{\Bx}}\let\Cx=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Ay}{\By}}\let\Cy=\pgfmathresult
+ \pgfplotscoordmath{#7}{op}{multiply}{{\Az}{\Bz}}\let\Cz=\pgfmathresult
+ %
+ \edef\pgfplotsretval{\Cx,\Cy,\Cz}%
+}%
+
+% #1 a vector as x,y,z
+% #2 the math format of its components
+\def\pgfplotspointfromcsvvector#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotspointfromcsvvector@\pgfplots@loc@TMPa\pgfplots@EOI{#2}
+ \endgroup
+}%
+\def\pgfplotspointfromcsvvector@#1,#2,#3\pgfplots@EOI#4{%
+ \pgfplotscoordmath{#4}{tofixed}{#1}\let\Ax=\pgfmathresult
+ \pgfplotscoordmath{#4}{tofixed}{#2}\let\Ay=\pgfmathresult
+ \pgfplotscoordmath{#4}{tofixed}{#3}\let\Az=\pgfmathresult
+ \pgfplotsqpointxyz\Ax\Ay\Az
+ \pgf@process{}%
+}%
+
+% #1 a vector as (x,y,z)
+% #2 a coordmath value
+% defines \pgfplotsretval to contain the vector length
+\def\pgfplotsmathvectorlength#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectorlength@\pgfplots@loc@TMPa\pgfplots@EOI{#2}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsmathvectorlength@#1,#2,#3\pgfplots@EOI#4{%
+ \begingroup
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ %
+ \pgfplotscoordmath{#4}{op}{multiply}{{\Ax}{\Ax}}\let\Axx=\pgfmathresult
+ \pgfplotscoordmath{#4}{op}{multiply}{{\Ay}{\Ay}}\let\Ayy=\pgfmathresult
+ \pgfplotscoordmath{#4}{op}{multiply}{{\Az}{\Az}}\let\Azz=\pgfmathresult
+ %
+ \pgfplotscoordmath{#4}{op}{add}{{\Axx}{\Ayy}}%
+ \pgfplotscoordmath{#4}{op}{add}{{\Azz}{\pgfmathresult}}%
+ \pgfplotscoordmath{#4}{op}{sqrt}{{\pgfmathresult}}%
+ \let\pgfplotsretval=\pgfmathresult
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% #1 a vector as (x,y,z)
+% #2 a scale
+% #3 a coordmath value
+% defines \pgfplotsretval to contain the scaled vector
+\def\pgfplotsmathvectorscale#1#2#3{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1:#2}%
+ \expandafter\pgfplotsmathvectorscale@\pgfplots@loc@TMPa\pgfplots@EOI{#3}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+\def\pgfplotsmathvectorscale@#1,#2,#3:#4\pgfplots@EOI#5{%
+ \begingroup
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \pgfplotscoordmath{#5}{parsenumber}{#4}\let\S\pgfmathresult
+ %
+ \pgfplotscoordmath{#5}{op}{multiply}{{\Ax}{\S}}\let\Ax=\pgfmathresult
+ \pgfplotscoordmath{#5}{op}{multiply}{{\Ay}{\S}}\let\Ay=\pgfmathresult
+ \pgfplotscoordmath{#5}{op}{multiply}{{\Az}{\S}}\let\Az=\pgfmathresult
+ %
+ \edef\pgfplotsretval{\Ax,\Ay,\Az}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+% Takes an input vector #1 = x,y,z and applies the inverse data scale
+% trafo.
+%
+% The result is \pgfplotsretval; it will be in '#2' coordmath for
+% every component.
+\def\pgfplotsmathvectordatascaletrafoinverse#1#2{%
+ \begingroup
+ \edef\pgfplots@loc@TMPa{#1}%
+ \expandafter\pgfplotsmathvectordatascaletrafoinverse@\pgfplots@loc@TMPa\pgfplots@EOI{#2}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}
+\def\pgfplotsmathvectordatascaletrafoinverse@#1,#2,#3\pgfplots@EOI#4{%
+ \begingroup
+ \def\Ax{#1}%
+ \def\Ay{#2}%
+ \def\Az{#3}%
+ \ifpgfplots@apply@datatrafo@x
+ \pgfplotscoordmath{x}{datascaletrafo inverse}{\Ax}\let\Ax=\pgfmathresult
+ \fi
+ \ifpgfplots@apply@datatrafo@y
+ \pgfplotscoordmath{y}{datascaletrafo inverse}{\Ay}\let\Ay=\pgfmathresult
+ \fi
+ \ifpgfplots@curplot@threedim
+ \ifpgfplots@apply@datatrafo@z
+ \pgfplotscoordmath{z}{datascaletrafo inverse}{\Az}\let\Az=\pgfmathresult
+ \fi
+ \fi
+ \pgfplotsmathvectorfromstring{\Ax,\Ay,\Az}{#4}%
+ \pgfmath@smuggleone\pgfplotsretval
+ \endgroup
+}%
+
+
+{
+\catcode`\"=12
+\gdef\pgfplotsDQ{"}%
+\catcode`\|=12
+\gdef\pgfplotsVERTBAR{|}%
+\catcode`\#=12
+\gdef\pgfplotsHASH{#}%
+\catcode`\%=12 \gdef\pgfplotsPERCENT{%}}
+
+\pgfutil@ifundefined{directlua}{}{%
+ \directlua{require(\pgfplotsDQ pgfplots.lua\pgfplotsDQ)}%
+}%
+
\input pgfplotsliststructure.code.tex
\input pgfplotsliststructureext.code.tex
\input pgfplotsarray.code.tex
diff --git a/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex b/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex
index 755a4089b0a..416f0f22836 100644
--- a/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex
+++ b/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex
@@ -206,14 +206,6 @@
% This catcode-hackery is too much for me, I don't get '|' to work in
% conjunction with ltxdoc document style.
% So, I simply use \pgfplotsVERTBAR instead... *sigh*.
-{
-\catcode`\"=12
-\gdef\pgfplotsDQ{"}%
-\catcode`\|=12
-\gdef\pgfplotsVERTBAR{|}%
-\catcode`\#=12
-\gdef\pgfplotsHASH{#}%
-\catcode`\%=12 \gdef\pgfplotsPERCENT{%}}
% this here is a bugfix to resolve an incompatibility between insdljs
% an \usepackage[spanish]{babel}:
diff --git a/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty b/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty
index bc9bfdf50f0..b394ca10f7e 100644
--- a/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty
+++ b/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty
@@ -23,13 +23,13 @@
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
%--------------------------------------------
-\def\pgfplotsversion{1.5.1}
+\def\pgfplotsversion{1.6.1}
\IfFileExists{pgfplots.revision.tex}{\input pgfplots.revision.tex } {\def\pgfplotsrevision{}}
\ifx\pgfplotsrevision\pgfutil@empty
\else
\edef\pgfplotsrevision{\space(git show \pgfplotsrevision)}%
\fi
-\ProvidesPackage{pgfplots}[2011/12/29 v\pgfplotsversion\pgfplotsrevision]
+\ProvidesPackage{pgfplots}[2012/08/23 v\pgfplotsversion\pgfplotsrevision]
% ATTENTION:
% you MAY need one of
diff --git a/Master/texmf-dist/tex/latex/pgfplots/pgfplotstable.sty b/Master/texmf-dist/tex/latex/pgfplots/pgfplotstable.sty
index 99640f2ea9c..e5cbf82e730 100644
--- a/Master/texmf-dist/tex/latex/pgfplots/pgfplotstable.sty
+++ b/Master/texmf-dist/tex/latex/pgfplots/pgfplotstable.sty
@@ -18,7 +18,7 @@
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
%--------------------------------------------
-\ProvidesPackage{pgfplotstable}[2011/12/19 Part of pgfplots]
+\ProvidesPackage{pgfplotstable}[2012/08/23 Part of pgfplots]
\RequirePackage{pgfplots}