texlive[44469] Master/texmf-dist: pgfplots (5jun17)

commits+karl at tug.org commits+karl at tug.org
Tue Jun 6 01:09:51 CEST 2017


Revision: 44469
          http://tug.org/svn/texlive?view=revision&revision=44469
Author:   karl
Date:     2017-06-06 01:09:50 +0200 (Tue, 06 Jun 2017)
Log Message:
-----------
pgfplots (5jun17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.pdf
    trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.tuc
    trunk/Master/texmf-dist/doc/generic/pgfplots/README
    trunk/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplots.doc.src.tar.bz2
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
    trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf
    trunk/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample-plain.pdf
    trunk/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.context.tar.bz2
    trunk/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.fillbetween.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.statistics.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/binary.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/meshplothandler.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotstexio.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotsutil.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/statistics.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/streamer.lua
    trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstableshared.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreimage.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfutil-common-lists.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfsys-luatexpatch.def
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/pgflibraryfillbetween.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/tikzlibraryfillbetween.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.markers.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def
    trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
    trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotscolormap.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
    trunk/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex
    trunk/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.colortol.code.tex
    trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarycolortol.code.tex

Modified: trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.tuc
===================================================================
--- trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.tuc	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/doc/context/third/pgfplots/pgfplotsexample-context.tuc	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,8 +4,8 @@
  ["escape"]="[===[ ... ]===]",
  ["file"]="tex.jobname",
  ["format"]="cont-en",
- ["stamp"]="2015.04.18 14:41",
- ["version"]=1.29,
+ ["stamp"]="2016.05.17 19:20",
+ ["version"]=1.3,
 }
 
 if not utilitydata.job then utilitydata.job = { } end
@@ -18,40 +18,42 @@
 if not utilitydata.job.variables then utilitydata.job.variables = { } end
 
 utilitydata.job.variables.collected={
- ["randomseed"]=0.52511715866864,
+ ["macros"]={},
+ ["randomseed"]=0.39339454117855,
+ ["sectionblockorder"]={},
 }
 
 if not utilitydata.job then utilitydata.job = { } end
-if not utilitydata.job.passes then utilitydata.job.passes = { } end
+if not utilitydata.job.structure then utilitydata.job.structure = { } end
 
-utilitydata.job.passes.collected={
+utilitydata.job.structure.collected={
+ ["branches"]={},
+ ["name"]="pgfplotsexample-context",
+ ["type"]="text",
 }
 
 if not utilitydata.job then utilitydata.job = { } end
-if not utilitydata.job.datasets then utilitydata.job.datasets = { } end
+if not utilitydata.job.positions then utilitydata.job.positions = { } end
 
-utilitydata.job.datasets.collected={
+utilitydata.job.positions.collected={
 }
 
 if not utilitydata.job then utilitydata.job = { } end
-if not utilitydata.job.pagestates then utilitydata.job.pagestates = { } end
+if not utilitydata.job.passes then utilitydata.job.passes = { } end
 
-utilitydata.job.pagestates.collected={
+utilitydata.job.passes.collected={
 }
 
 if not utilitydata.job then utilitydata.job = { } end
-if not utilitydata.job.structure then utilitydata.job.structure = { } end
+if not utilitydata.job.datasets then utilitydata.job.datasets = { } end
 
-utilitydata.job.structure.collected={
- ["branches"]={},
- ["name"]="pgfplotsexample-context",
- ["type"]="text",
+utilitydata.job.datasets.collected={
 }
 
 if not utilitydata.job then utilitydata.job = { } end
-if not utilitydata.job.positions then utilitydata.job.positions = { } end
+if not utilitydata.job.pagestates then utilitydata.job.pagestates = { } end
 
-utilitydata.job.positions.collected={
+utilitydata.job.pagestates.collected={
 }
 
 if not utilitydata.structures then utilitydata.structures = { } end
@@ -177,6 +179,12 @@
 utilitydata.publications.collected={
 }
 
+if not utilitydata.job then utilitydata.job = { } end
+if not utilitydata.job.fileobjreferences then utilitydata.job.fileobjreferences = { } end
+
+utilitydata.job.fileobjreferences.collected={
+}
+
 utilitydata.job.packed={
  ["index"]={
   {
@@ -199,6 +207,10 @@
   ["sectiondata"]=true,
   ["specification"]=true,
  },
+ ["skip"]={
+  ["datasets"]=true,
+  ["userdata"]=true,
+ },
  ["version"]=1.02,
 }
 

Modified: trunk/Master/texmf-dist/doc/generic/pgfplots/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pgfplots/README	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/doc/generic/pgfplots/README	2017-06-05 23:09:50 UTC (rev 44469)
@@ -7,7 +7,7 @@
 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, area plots, mesh and surface plots, patch plots, contour plots, quiver
 plots, histogram plots, polar axes, ternary diagrams, smith charts and some
 more.
 
@@ -18,7 +18,7 @@
 using TeX's math facilities for pretty printing. Furthermore, it provides
 methods for table postprocessing.
 
-Please take a look at 
+Please take a look at
   doc/latex/pgfplots/pgfplots.pdf
 and
   doc/latex/pgfplots/pgfplotstable.pdf.
@@ -40,6 +40,24 @@
 
 
 HISTORY:
+1.15: bugfix release
+- fixed regression: fpu caused forest library to fail as soon as one loads pgfplots
+- fixed bug #149 : \edef{...\to...} was wrong and caused \pgfplotstablevertcat to fail 
+- usability: added support for \plotnum during \addplot
+- fixed bug 134 [statistics] Histogram with custom `symbolic coords`
+- fixed bug 140 (pgfplotstable read does not process empty rows anymore)
+- fixed bug 150 Usage of \pgfkeysvalueof in xtick leads to 'Dimension too large' 
+- fixed bug 105 [manual] `xticklabel pos=upper` is not documented
+	in fact, some of the documented positions for 'xtick pos' where
+	unavailable.
+- fixed bug 155 [groupplots] `scaled ticks` does not recognize `ticklabels at` 
+- fixed bug 160 `xticklabels` also used for `extra x tick labels` if they are not given explicitely 
+- implemented partial solution for bug 154 [log mode] sampling in 2D and 3D different 
+- fixed bug 163 [bar-chart] bars dissapear when values are >xmax/ymax 
+- fixed bug 81 cannot use dollar sign as 'comment char'
+- fixed bug 91 Hashes in data 
+- fixed bug 165 [minor ticks] minor tick drawn after the last xtick
+- fixed bug 176: 2d plot expression in 3d axis fails for lualatex 
 
 1.14
 - new feature: 'contour filled' (compat=1.14)
@@ -48,7 +66,7 @@
 - new feature: colormaps defined on position of arbitrary magnitude
 - new feature: colorbar as legend
 - new feature: 'colorbar style={xtick=data}' positions tick labels at colormap positions
-- fixed bug: pgfplots now handles incompatible changes of luatex 
+- fixed bug: pgfplots now handles incompatible changes of luatex
 	 loading \usepackage{pgfplots} _before_ pgf also allows makes older
 	 PGF versions compatible with luatex
 - fixed bug: incompatibility between units + groupplots (bug 119)
@@ -64,18 +82,18 @@
 - fixed bug: javascript incompatibility between Acrobat reader DC and clickable lib
 - fixed bug in polar axes: repaired default axis label positions
 - fixed bug in polar axes: repaired support for sloped descriptions
-- fixed bug: 'axis line style={draw=none}' had no effect unless one had 2d boxed axes 
+- fixed bug: 'axis line style={draw=none}' had no effect unless one had 2d boxed axes
 - fixed bug: point meta expressions with '=' inside of them which caused compilation errors
 - fixed bug: compat=1.12 combined with interrupted plots (by empty line) failed to work
 - fixed bug: compat=1.12 combined with lualatex evaluated relational operations (<, ==) with the wrong operator precedence
 - fixed bug: fixed floor and ceil functions
-- fixed bug: 'set layers' broke alignment features with different manifestations 
+- fixed bug: 'set layers' broke alignment features with different manifestations
        ('set layers' together with fill between in group plots, together with at={} key, together with anchor)
 - fixed bug: fill between and group plots: fill-between graphics was missing (list of layers was lost)
 - fixed bug: \addplot graphics {\newFile{P.pdf}}; failed to properly expand the file name
 - fixed bug: fill between + error bars resulted in compilation error
 - fixed bug: stacked plots occasionally used a wrong coordinate mapping
-- fixed bug: provided suitable default legends for xbar and xbar stacked 
+- fixed bug: provided suitable default legends for xbar and xbar stacked
 - fixed bug: 'dateplot' now computes missing 'date ZERO' automatically. 'date ZERO' is managed automatically.
 - new feature: Added support for search paths to find data files (table/search path)
 - new feature: 'xtick distance' allows to define tick positions by distance
@@ -93,13 +111,13 @@
 - new feature: cycle list={[colors of colormap={0,100,500,100} of viridis]}
 - new feature: cycle list={[indices of colormap={0,1,2,3} of hot]}
 - new feature: added support for 'stack negative=on previous|separate' which allows separate plots for '+' and '-' (useful for bar plots)
-- new feature: added support for 'colormap access=direct' combined with 'shader=flat mean' and 'shader=interp': 
+- new feature: added support for 'colormap access=direct' combined with 'shader=flat mean' and 'shader=interp':
 	it previously used to interpolate indices instead of colors
 - new feature: \closedcycle now produces useful results for 3d line plots
 - new feature: added \usetikzlibrary{colorbrewer} and \usepgfplotslibrary{colorbrewer}
 - new feature: added 'colormap access=piecewise constant'
 - new feature: added rudimentary support for "Filled Contours" (based on 'colormap access=piecewise constant')
-- new feature: added methods to build colormaps based on other colormaps using 
+- new feature: added methods to build colormaps based on other colormaps using
    "color of colormap", "index of colormap", "colors of colormap", "samples of colormap", and "indices of colormap"
 
 1.12.1: minor bugfix release
@@ -110,11 +128,11 @@
 1.12: scalability + performance
 - scalability: reduced TeX memory consumption for huge inline tables
 - scalability: lualatex allows bigger 3d graphics
-- scalability: lualatex now reduces compilation time for huge 3d graphics 
+- scalability: lualatex now reduces compilation time for huge 3d graphics
    (requires \pgfplotsset{compat=newest} at the time of this writing)
    	surf shader=faceted: time reduced to 61% of pdflatex
 		(\addplot3[surf,samples=70] {exp(-x^2-y^2 +x*y)})
-	
+
 	surf shader=interp: time reduced to 25% of pdflatex
 	 	(\addplot3[surf,shader=interp,samples=70] {exp(-x^2-y^2 +x*y)})
 
@@ -130,7 +148,7 @@
 - fixed bug: axis equal did not respect "disabledatascaling"
 - fixed bug: mesh legend was confused by color input=explicit
 - fixed bug: colorbar style did not reset zmin/zmax
-- fixed bug: memory allocation in FPU consumed too much memory 
+- fixed bug: memory allocation in FPU consumed too much memory
 - fixed bug: boxplots: removed compilation error due to spurious spaces in options list
 - fixed bug: boxplots: now uses standard quantile estimators: has all 9 estimators of R and uses the same as in Excel as default (as of compat=1.12)
 - fixed bug: boxplots: sometimes failed to compute boxplot statistics for special inputs
@@ -146,7 +164,7 @@
 - new feature: "hide obscured x ticks=false" to disable the feature which hides ticks
 - simplified UI for symbolic coords: now, it accepts unexpandable
   dictionary entries including umlauts, undefined macros, math mode, ...
-- simplified UI for symbolic coords: added magic prefix 
+- simplified UI for symbolic coords: added magic prefix
 	[normalized]<number> to allow something like xmin={[normalized]0.7}
 - simplified UI for custom annotations: one does not need to say "axis cs" any longer;
   coordinates like (1,2) are now automatically interpreted as (axis cs:1,2)
@@ -202,7 +220,7 @@
 - wrote beginner tutorials
 - fixed bug: error bars and point meta did not work together
 - fixed bug: stacked plots did not respect 'visualization depends on'
-- fixed bug: luatex 0.76 is not backwards compatible; added version switch 
+- fixed bug: luatex 0.76 is not backwards compatible; added version switch
 - fixed bug: ternary library precision has been improved
 - fixed bug: problem with axis limits very close to 0
 - fixed bug: colormap specification limit case produced out of bounds exception
@@ -210,10 +228,10 @@
 
 1.8:
 - new feature: tight bounding box even if the axis is no box and bb excludes clip path
-- new feature: mesh/color input=explicit 
+- new feature: mesh/color input=explicit
 - new feature: shader=interp now has drivers for both dvipdfmx and xetex
 - new feature: support for more color spaces in colormap definitions
-- new feature: shader=interp and device-level gray colorspaces 
+- new feature: shader=interp and device-level gray colorspaces
 - new feature: 'contour/contour dir=[xyz]' to draw contours in different directions
 - new feature: statistics library with boxplot handler (both boxplot prepared and automatic computation)
 - fixed bug: 3d centered axis lines and label placement (requires compat=1.8 or higher)
@@ -233,10 +251,10 @@
 - fixed bug: code did not compile against pgf 2.00
 - fixed bug: patch plot lib and shader=interp,patch type=biquadratic
 - fixed bug: context path searching issue (pgfplots.lua)
-- fixed bug: shader=interp and dvips driver 
+- fixed bug: shader=interp and dvips driver
 - fixed bug: error bars with explicit relative input failed
 
-1.7 
+1.7
 - added feature: 'bar shift' and 'bar width' can now be expressed in terms of axis units (compat=1.7 or higher)
 - fixed incompatibility regression pgfplots 1.6.1 pgf 2.10: layers
 - fixed incompatibility pgfplots and imakeidx
@@ -310,7 +328,7 @@
  - improvements of the groupplot styles
  - preliminary support for (2d) bar plots in 3d axes
  - new shader 'faceted interp'
- - table package: 
+ - table package:
  	- 'every nth row' style
 	- 'comment chars' key to define comment characters in input files
 	- 'skip first n' style
@@ -323,9 +341,9 @@
 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 legends
 - detached colorbars
-- ybar (and similar plots) can now be mixed with other plot types 
+- 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)
@@ -348,21 +366,21 @@
 	- color bars,
 	- nodes near coords,
 	- jumps in plots,
-	- improved description positioning, 
+	- 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, 
+- 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, 
+- 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, 
+- 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.

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/TeX-programming-notes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplots.doc.src.tar.bz2
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplots.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotsexample.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -1,3 +1,4 @@
+
 \documentclass[a4paper]{article}
 
 % for dvipdfm:

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgfplots/pgfplotstodo.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/plain/pgfplots/pgfplotsexample-plain.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/context/third/pgfplots/pgfplotstests.context.tar.bz2
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/pgfplots/pgfplotstests.tar.bz2
===================================================================
(Binary files differ)

Added: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.colortol.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.colortol.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.colortol.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -0,0 +1,766 @@
+
+% load all colors for the `colormap's and `cycle list's
+\usetikzlibrary{colortol}
+
+% define `colormap's
+\pgfplotsset{
+  /pgfplots/@@colortol set cycle list/.code={%
+    \pgfkeysalso{
+      /pgfplots/ensure colormap={/pgfplots/colormap/#1},
+      /pgfplots/cycle list name=#1,
+    },
+  },
+  % -----------------------------------
+  % define "the" palette I colormap, which is just an alias for
+  % the colormap `colortol-P1-9'
+  /pgfplots/colormap/colortol-P1/.style={
+    colormap={colortol-P1}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-I);
+      color=(colortol-P1-L);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1}{[of colormap=colortol-P1]},
+  },
+  /pgfplots/cycle list/colortol-P1/.style={/pgfplots/@@colortol set cycle list={colortol-P1}},
+  %
+  % -----------------------------------
+  % define (other) palette I colormaps
+  /pgfplots/colormap/colortol-P1-3/.style={
+    colormap={colortol-P1-3}{
+      color=(colortol-P1-B);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+    },
+    cycle list/.define={colortol-P1-3}{[of colormap=colortol-P1-3]},
+  },
+  /pgfplots/cycle list/colortol-P1-3/.style={/pgfplots/@@colortol set cycle list={colortol-P1-3}},
+  %
+  /pgfplots/colormap/colortol-P1-4/.style={
+    colormap={colortol-P1-4}{
+      color=(colortol-P1-B);
+      color=(colortol-P1-F);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+    },
+    cycle list/.define={colortol-P1-4}{[of colormap=colortol-P1-4]},
+  },
+  /pgfplots/cycle list/colortol-P1-4/.style={/pgfplots/@@colortol set cycle list={colortol-P1-4}},
+  %
+  /pgfplots/colormap/colortol-P1-5/.style={
+    colormap={colortol-P1-5}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-F);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+    },
+    cycle list/.define={colortol-P1-5}{[of colormap=colortol-P1-5]},
+  },
+  /pgfplots/cycle list/colortol-P1-5/.style={/pgfplots/@@colortol set cycle list={colortol-P1-5}},
+  %
+  /pgfplots/colormap/colortol-P1-6/.style={
+    colormap={colortol-P1-6}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-F);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-6}{[of colormap=colortol-P1-6]},
+  },
+  /pgfplots/cycle list/colortol-P1-6/.style={/pgfplots/@@colortol set cycle list={colortol-P1-6}},
+  %
+  /pgfplots/colormap/colortol-P1-7/.style={
+    colormap={colortol-P1-7}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-7}{[of colormap=colortol-P1-7]},
+  },
+  /pgfplots/cycle list/colortol-P1-7/.style={/pgfplots/@@colortol set cycle list={colortol-P1-7}},
+  %
+  /pgfplots/colormap/colortol-P1-8/.style={
+    colormap={colortol-P1-8}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-8}{[of colormap=colortol-P1-8]},
+  },
+  /pgfplots/cycle list/colortol-P1-8/.style={/pgfplots/@@colortol set cycle list={colortol-P1-8}},
+  %
+  /pgfplots/colormap/colortol-P1-9/.style={
+    colormap={colortol-P1-9}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-J);
+      color=(colortol-P1-L);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-9}{[of colormap=colortol-P1-9]},
+  },
+  /pgfplots/cycle list/colortol-P1-9/.style={/pgfplots/@@colortol set cycle list={colortol-P1-9}},
+  %
+  /pgfplots/colormap/colortol-P1-10/.style={
+    colormap={colortol-P1-10}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-I);
+      color=(colortol-P1-J);
+      color=(colortol-P1-L);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-10}{[of colormap=colortol-P1-10]},
+  },
+  /pgfplots/cycle list/colortol-P1-10/.style={/pgfplots/@@colortol set cycle list={colortol-P1-10}},
+  %
+  /pgfplots/colormap/colortol-P1-11/.style={
+    colormap={colortol-P1-11}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-C);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-I);
+      color=(colortol-P1-J);
+      color=(colortol-P1-L);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-11}{[of colormap=colortol-P1-11]},
+  },
+  /pgfplots/cycle list/colortol-P1-11/.style={/pgfplots/@@colortol set cycle list={colortol-P1-11}},
+  %
+  /pgfplots/colormap/colortol-P1-12/.style={
+    colormap={colortol-P1-12}{
+      color=(colortol-P1-A);
+      color=(colortol-P1-C);
+      color=(colortol-P1-D);
+      color=(colortol-P1-E);
+      color=(colortol-P1-F);
+      color=(colortol-P1-G);
+      color=(colortol-P1-H);
+      color=(colortol-P1-I);
+      color=(colortol-P1-J);
+      color=(colortol-P1-K);
+      color=(colortol-P1-L);
+      color=(colortol-P1-M);
+    },
+    cycle list/.define={colortol-P1-12}{[of colormap=colortol-P1-12]},
+  },
+  /pgfplots/cycle list/colortol-P1-12/.style={/pgfplots/@@colortol set cycle list={colortol-P1-12}},
+  %
+  % -----------------------------------
+  % define palette II colormaps
+  /pgfplots/colormap/colortol-P2light/.style={
+    colormap={colortol-P2light}{
+      color=(colortol-P2light-A);
+      color=(colortol-P2light-B);
+      color=(colortol-P2light-C);
+      color=(colortol-P2light-D);
+      color=(colortol-P2light-E);
+      color=(colortol-P2light-F);
+      color=(colortol-P2light-G);
+    },
+    cycle list/.define={colortol-P2light}{[of colormap=colortol-P2light]},
+  },
+  /pgfplots/cycle list/colortol-P2light/.style={/pgfplots/@@colortol set cycle list={colortol-P2light}},
+  %
+  /pgfplots/colormap/colortol-P2/.style={
+    colormap={colortol-P2}{
+      color=(colortol-P2-A);
+      color=(colortol-P2-B);
+      color=(colortol-P2-C);
+      color=(colortol-P2-D);
+      color=(colortol-P2-E);
+      color=(colortol-P2-F);
+      color=(colortol-P2-G);
+    },
+    cycle list/.define={colortol-P2}{[of colormap=colortol-P2]},
+  },
+  /pgfplots/cycle list/colortol-P2/.style={/pgfplots/@@colortol set cycle list={colortol-P2}},
+  %
+  /pgfplots/colormap/colortol-P2dark/.style={
+    colormap={colortol-P2dark}{
+      color=(colortol-P2dark-A);
+      color=(colortol-P2dark-B);
+      color=(colortol-P2dark-C);
+      color=(colortol-P2dark-D);
+      color=(colortol-P2dark-E);
+      color=(colortol-P2dark-F);
+      color=(colortol-P2dark-G);
+    },
+    cycle list/.define={colortol-P2dark}{[of colormap=colortol-P2dark]},
+  },
+  /pgfplots/cycle list/colortol-P2dark/.style={/pgfplots/@@colortol set cycle list={colortol-P2dark}},
+  %
+  % -----------------------------------
+  % define palette III colormap, which is just an alias for
+  % the colormap `colortol-P3-5+'
+  /pgfplots/colormap/colortol-P3/.style={
+    colormap={colortol-P3}{
+      color=(colortol-P3-blue),
+      color=(colortol-P3-cyan),
+      color=(colortol-P3-green),
+      color=(colortol-P3-yellow),
+      color=(colortol-P3-red),
+      color=(colortol-P3-pink),
+    },
+    cycle list/.define={colortol-P3}{[of colormap=colortol-P3]},
+  },
+  /pgfplots/cycle list/colortol-P3/.style={/pgfplots/@@colortol set cycle list={colortol-P3}},
+  %
+  % -----------------------------------
+  % define (other) palette III colormaps
+  /pgfplots/colormap/colortol-P3-4-/.style={
+    colormap={colortol-P3-4-}{
+      color=(colortol-P3-blue),
+      color=(colortol-P3-red),
+      color=(colortol-P3-green),
+      color=(colortol-P3-yellow),
+    },
+    cycle list/.define={colortol-P3-4-}{[of colormap=colortol-P3-4-]},
+  },
+  /pgfplots/cycle list/colortol-P3-4-/.style={/pgfplots/@@colortol set cycle list={colortol-P3-4-}},
+  %
+  /pgfplots/colormap/colortol-P3-5+/.style={
+    colormap={colortol-P3-5+}{
+      color=(colortol-P3-blue),
+      color=(colortol-P3-cyan),
+      color=(colortol-P3-green),
+      color=(colortol-P3-yellow),
+      color=(colortol-P3-red),
+      color=(colortol-P3-pink),
+    },
+    cycle list/.define={colortol-P3-5+}{[of colormap=colortol-P3-5+]},
+  },
+  /pgfplots/cycle list/colortol-P3-5+/.style={/pgfplots/@@colortol set cycle list={colortol-P3-5+}},
+  %
+  % ===================================
+  % define colormaps for sequential data
+  /pgfplots/colormap/colortol-seq-3/.style={
+    colormap={colortol-seq-3}{
+      color=(colortol-seq-C);
+      color=(colortol-seq-F);
+      color=(colortol-seq-I);
+    },
+    cycle list/.define={colortol-seq-3}{[of colormap=colortol-seq-3]},
+  },
+  /pgfplots/cycle list/colortol-seq-3/.style={/pgfplots/@@colortol set cycle list={colortol-seq-3}},
+  %
+  /pgfplots/colormap/colortol-seq-4/.style={
+    colormap={colortol-seq-4}{
+      color=(colortol-seq-B);
+      color=(colortol-seq-E);
+      color=(colortol-seq-G);
+      color=(colortol-seq-J);
+    },
+    cycle list/.define={colortol-seq-4}{[of colormap=colortol-seq-4]},
+  },
+  /pgfplots/cycle list/colortol-seq-4/.style={/pgfplots/@@colortol set cycle list={colortol-seq-4}},
+  %
+  /pgfplots/colormap/colortol-seq-5/.style={
+    colormap={colortol-seq-5}{
+      color=(colortol-seq-B);
+      color=(colortol-seq-E);
+      color=(colortol-seq-G);
+      color=(colortol-seq-I);
+      color=(colortol-seq-K);
+    },
+    cycle list/.define={colortol-seq-5}{[of colormap=colortol-seq-5]},
+  },
+  /pgfplots/cycle list/colortol-seq-5/.style={/pgfplots/@@colortol set cycle list={colortol-seq-5}},
+  %
+  /pgfplots/colormap/colortol-seq-6/.style={
+    colormap={colortol-seq-6}{
+      color=(colortol-seq-B);
+      color=(colortol-seq-D);
+      color=(colortol-seq-F);
+      color=(colortol-seq-G);
+      color=(colortol-seq-I);
+      color=(colortol-seq-K);
+    },
+    cycle list/.define={colortol-seq-6}{[of colormap=colortol-seq-6]},
+  },
+  /pgfplots/cycle list/colortol-seq-6/.style={/pgfplots/@@colortol set cycle list={colortol-seq-6}},
+  %
+  /pgfplots/colormap/colortol-seq-7/.style={
+    colormap={colortol-seq-7}{
+      color=(colortol-seq-B);
+      color=(colortol-seq-D);
+      color=(colortol-seq-F);
+      color=(colortol-seq-G);
+      color=(colortol-seq-H);
+      color=(colortol-seq-J);
+      color=(colortol-seq-L);
+    },
+    cycle list/.define={colortol-seq-7}{[of colormap=colortol-seq-7]},
+  },
+  /pgfplots/cycle list/colortol-seq-7/.style={/pgfplots/@@colortol set cycle list={colortol-seq-7}},
+  %
+  /pgfplots/colormap/colortol-seq-8/.style={
+    colormap={colortol-seq-8}{
+      color=(colortol-seq-A);
+      color=(colortol-seq-C);
+      color=(colortol-seq-D);
+      color=(colortol-seq-F);
+      color=(colortol-seq-G);
+      color=(colortol-seq-H);
+      color=(colortol-seq-J);
+      color=(colortol-seq-L);
+    },
+    cycle list/.define={colortol-seq-8}{[of colormap=colortol-seq-8]},
+  },
+  /pgfplots/cycle list/colortol-seq-8/.style={/pgfplots/@@colortol set cycle list={colortol-seq-8}},
+  %
+  /pgfplots/colormap/colortol-seq-9/.style={
+    colormap={colortol-seq-9}{
+      color=(colortol-seq-A);
+      color=(colortol-seq-C);
+      color=(colortol-seq-D);
+      color=(colortol-seq-F);
+      color=(colortol-seq-G);
+      color=(colortol-seq-H);
+      color=(colortol-seq-J);
+      color=(colortol-seq-K);
+      color=(colortol-seq-M);
+    },
+    cycle list/.define={colortol-seq-9}{[of colormap=colortol-seq-9]},
+  },
+  /pgfplots/cycle list/colortol-seq-9/.style={/pgfplots/@@colortol set cycle list={colortol-seq-9}},
+  %
+  % -----------------------------------
+  % define colormaps for diverging data
+  /pgfplots/colormap/colortol-div-3/.style={
+    colormap={colortol-div-3}{
+      color=(colortol-div-E);
+      color=(colortol-div-H);
+      color=(colortol-div-K);
+    },
+    cycle list/.define={colortol-div-3}{[of colormap=colortol-div-3]},
+  },
+  /pgfplots/cycle list/colortol-div-3/.style={/pgfplots/@@colortol set cycle list={colortol-div-3}},
+  %
+  /pgfplots/colormap/colortol-div-4/.style={
+    colormap={colortol-div-4}{
+      color=(colortol-div-A);
+      color=(colortol-div-F);
+      color=(colortol-div-J);
+      color=(colortol-div-N);
+    },
+    cycle list/.define={colortol-div-4}{[of colormap=colortol-div-4]},
+  },
+  /pgfplots/cycle list/colortol-div-4/.style={/pgfplots/@@colortol set cycle list={colortol-div-4}},
+  %
+  /pgfplots/colormap/colortol-div-5/.style={
+    colormap={colortol-div-5}{
+      color=(colortol-div-A);
+      color=(colortol-div-F);
+      color=(colortol-div-H);
+      color=(colortol-div-J);
+      color=(colortol-div-N);
+    },
+    cycle list/.define={colortol-div-5}{[of colormap=colortol-div-5]},
+  },
+  /pgfplots/cycle list/colortol-div-5/.style={/pgfplots/@@colortol set cycle list={colortol-div-5}},
+  %
+  /pgfplots/colormap/colortol-div-6/.style={
+    colormap={colortol-div-6}{
+      color=(colortol-div-C);
+      color=(colortol-div-E);
+      color=(colortol-div-G);
+      color=(colortol-div-I);
+      color=(colortol-div-K);
+      color=(colortol-div-M);
+    },
+    cycle list/.define={colortol-div-6}{[of colormap=colortol-div-6]},
+  },
+  /pgfplots/cycle list/colortol-div-6/.style={/pgfplots/@@colortol set cycle list={colortol-div-6}},
+  %
+  /pgfplots/colormap/colortol-div-7/.style={
+    colormap={colortol-div-7}{
+      color=(colortol-div-C);
+      color=(colortol-div-E);
+      color=(colortol-div-G);
+      color=(colortol-div-H);
+      color=(colortol-div-I);
+      color=(colortol-div-K);
+      color=(colortol-div-M);
+    },
+    cycle list/.define={colortol-div-7}{[of colormap=colortol-div-7]},
+  },
+  /pgfplots/cycle list/colortol-div-7/.style={/pgfplots/@@colortol set cycle list={colortol-div-7}},
+  %
+  /pgfplots/colormap/colortol-div-8/.style={
+    colormap={colortol-div-8}{
+      color=(colortol-div-C);
+      color=(colortol-div-D);
+      color=(colortol-div-F);
+      color=(colortol-div-G);
+      color=(colortol-div-I);
+      color=(colortol-div-J);
+      color=(colortol-div-L);
+      color=(colortol-div-M);
+    },
+    cycle list/.define={colortol-div-8}{[of colormap=colortol-div-8]},
+  },
+  /pgfplots/cycle list/colortol-div-8/.style={/pgfplots/@@colortol set cycle list={colortol-div-8}},
+  %
+  /pgfplots/colormap/colortol-div-9/.style={
+    colormap={colortol-div-9}{
+      color=(colortol-div-C);
+      color=(colortol-div-D);
+      color=(colortol-div-F);
+      color=(colortol-div-G);
+      color=(colortol-div-H);
+      color=(colortol-div-I);
+      color=(colortol-div-J);
+      color=(colortol-div-L);
+      color=(colortol-div-M);
+    },
+    cycle list/.define={colortol-div-9}{[of colormap=colortol-div-9]},
+  },
+  /pgfplots/cycle list/colortol-div-9/.style={/pgfplots/@@colortol set cycle list={colortol-div-9}},
+  %
+  /pgfplots/colormap/colortol-div-10/.style={
+    colormap={colortol-div-10}{
+      color=(colortol-div-B);
+      color=(colortol-div-C);
+      color=(colortol-div-D);
+      color=(colortol-div-F);
+      color=(colortol-div-G);
+      color=(colortol-div-I);
+      color=(colortol-div-J);
+      color=(colortol-div-L);
+      color=(colortol-div-M);
+      color=(colortol-div-O);
+    },
+    cycle list/.define={colortol-div-10}{[of colormap=colortol-div-10]},
+  },
+  /pgfplots/cycle list/colortol-div-10/.style={/pgfplots/@@colortol set cycle list={colortol-div-10}},
+  %
+  /pgfplots/colormap/colortol-div-11/.style={
+    colormap={colortol-div-11}{
+      color=(colortol-div-B);
+      color=(colortol-div-C);
+      color=(colortol-div-D);
+      color=(colortol-div-F);
+      color=(colortol-div-G);
+      color=(colortol-div-H);
+      color=(colortol-div-I);
+      color=(colortol-div-J);
+      color=(colortol-div-L);
+      color=(colortol-div-M);
+      color=(colortol-div-O);
+    },
+    cycle list/.define={colortol-div-11}{[of colormap=colortol-div-11]},
+  },
+  /pgfplots/cycle list/colortol-div-11/.style={/pgfplots/@@colortol set cycle list={colortol-div-11}},
+  %
+  % -----------------
+  /pgfplots/colormap/colortol-div2/.style={
+    colormap={colortol-div2}{
+      color=(colortol-div2-A);
+      color=(colortol-div2-B);
+      color=(colortol-div2-C);
+      color=(colortol-div2-D);
+      color=(colortol-div2-E);
+      color=(colortol-div2-F);
+      color=(colortol-div2-G);
+      color=(colortol-div2-H);
+      color=(colortol-div2-I);
+    },
+    cycle list/.define={colortol-div2}{[of colormap=colortol-div2]},
+  },
+  /pgfplots/cycle list/colortol-div2/.style={/pgfplots/@@colortol set cycle list={colortol-div2}},
+  %
+  /pgfplots/colormap/colortol-div3/.style={
+    colormap={colortol-div3}{
+      color=(colortol-div3-A);
+      color=(colortol-div3-B);
+      color=(colortol-div3-C);
+      color=(colortol-div3-D);
+      color=(colortol-div3-E);
+      color=(colortol-div3-F);
+      color=(colortol-div3-G);
+      color=(colortol-div3-H);
+      color=(colortol-div3-I);
+    },
+    cycle list/.define={colortol-div3}{[of colormap=colortol-div3]},
+  },
+  /pgfplots/cycle list/colortol-div3/.style={/pgfplots/@@colortol set cycle list={colortol-div3}},
+  %
+  % ===================================
+  % define rainbow colormaps
+  /pgfplots/colormap/colortol-rainbow-4/.style={
+    colormap={colortol-rainbow-4}{
+      color=(colortol-rainbow-F);
+      color=(colortol-rainbow-W);
+      color=(colortol-rainbow-AQ);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-4}{[of colormap=colortol-rainbow-4]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-4/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-4}},
+  %
+  /pgfplots/colormap/colortol-rainbow-5/.style={
+    colormap={colortol-rainbow-5}{
+      color=(colortol-rainbow-F);
+      color=(colortol-rainbow-T);
+      color=(colortol-rainbow-AD);
+      color=(colortol-rainbow-AS);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-5}{[of colormap=colortol-rainbow-5]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-5/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-5}},
+  %
+  /pgfplots/colormap/colortol-rainbow-6/.style={
+    colormap={colortol-rainbow-6}{
+      color=(colortol-rainbow-F);
+      color=(colortol-rainbow-Q);
+      color=(colortol-rainbow-AA);
+      color=(colortol-rainbow-AK);
+      color=(colortol-rainbow-AV);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-6}{[of colormap=colortol-rainbow-6]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-6/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-6}},
+  %
+  /pgfplots/colormap/colortol-rainbow-7/.style={
+    colormap={colortol-rainbow-7}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-J);
+      color=(colortol-rainbow-U);
+      color=(colortol-rainbow-AB);
+      color=(colortol-rainbow-AM);
+      color=(colortol-rainbow-AW);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-7}{[of colormap=colortol-rainbow-7]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-7/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-7}},
+  %
+  /pgfplots/colormap/colortol-rainbow-8/.style={
+    colormap={colortol-rainbow-8}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-I);
+      color=(colortol-rainbow-R);
+      color=(colortol-rainbow-Y);
+      color=(colortol-rainbow-AG);
+      color=(colortol-rainbow-AO);
+      color=(colortol-rainbow-AX);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-8}{[of colormap=colortol-rainbow-8]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-8/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-8}},
+  %
+  /pgfplots/colormap/colortol-rainbow-9/.style={
+    colormap={colortol-rainbow-9}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-H);
+      color=(colortol-rainbow-N);
+      color=(colortol-rainbow-W);
+      color=(colortol-rainbow-AB);
+      color=(colortol-rainbow-AI);
+      color=(colortol-rainbow-AR);
+      color=(colortol-rainbow-AY);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-9}{[of colormap=colortol-rainbow-9]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-9/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-9}},
+  %
+  /pgfplots/colormap/colortol-rainbow-10/.style={
+    colormap={colortol-rainbow-10}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-G);
+      color=(colortol-rainbow-M);
+      color=(colortol-rainbow-T);
+      color=(colortol-rainbow-Z);
+      color=(colortol-rainbow-AF);
+      color=(colortol-rainbow-AL);
+      color=(colortol-rainbow-AS);
+      color=(colortol-rainbow-AZ);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-10}{[of colormap=colortol-rainbow-10]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-10/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-10}},
+  %
+  /pgfplots/colormap/colortol-rainbow-11/.style={
+    colormap={colortol-rainbow-11}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-F);
+      color=(colortol-rainbow-L);
+      color=(colortol-rainbow-S);
+      color=(colortol-rainbow-X);
+      color=(colortol-rainbow-AC);
+      color=(colortol-rainbow-AH);
+      color=(colortol-rainbow-AN);
+      color=(colortol-rainbow-AT);
+      color=(colortol-rainbow-BA);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-11}{[of colormap=colortol-rainbow-11]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-11/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-11}},
+  %
+  /pgfplots/colormap/colortol-rainbow-12/.style={
+    colormap={colortol-rainbow-12}{
+      color=(colortol-rainbow-A);
+      color=(colortol-rainbow-E);
+      color=(colortol-rainbow-K);
+      color=(colortol-rainbow-P);
+      color=(colortol-rainbow-V);
+      color=(colortol-rainbow-AA);
+      color=(colortol-rainbow-AE);
+      color=(colortol-rainbow-AJ);
+      color=(colortol-rainbow-AP);
+      color=(colortol-rainbow-AU);
+      color=(colortol-rainbow-AB);
+      color=(colortol-rainbow-AD);
+    },
+    cycle list/.define={colortol-rainbow-12}{[of colormap=colortol-rainbow-12]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-12/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-12}},
+  %
+  /pgfplots/colormap/colortol-rainbow-14/.style={
+    colormap={colortol-rainbow-14}{
+      color=(colortol-rainbow-B);
+      color=(colortol-rainbow-C);
+      color=(colortol-rainbow-D);
+      color=(colortol-rainbow-AF);
+      color=(colortol-rainbow-O);
+      color=(colortol-rainbow-AG);
+      color=(colortol-rainbow-AH);
+      color=(colortol-rainbow-AI);
+      color=(colortol-rainbow-AJ);
+      color=(colortol-rainbow-AK);
+      color=(colortol-rainbow-AL);
+      color=(colortol-rainbow-AM);
+      color=(colortol-rainbow-AC);
+      color=(colortol-rainbow-AE);
+    },
+    cycle list/.define={colortol-rainbow-14}{[of colormap=colortol-rainbow-14]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-14/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-14}},
+  %
+  % -----------------------------------
+  % define continuous rainbow colormap
+  /pgfplots/colormap/colortol-rainbow-cont/.style={
+    colormap={colortol-rainbow-cont}{
+      color=(colortol-rainbow-cont-A);
+      color=(colortol-rainbow-cont-B);
+      color=(colortol-rainbow-cont-C);
+      color=(colortol-rainbow-cont-D);
+      color=(colortol-rainbow-cont-E);
+      color=(colortol-rainbow-cont-F);
+      color=(colortol-rainbow-cont-G);
+      color=(colortol-rainbow-cont-H);
+      color=(colortol-rainbow-cont-I);
+      color=(colortol-rainbow-cont-J);
+      color=(colortol-rainbow-cont-K);
+      color=(colortol-rainbow-cont-L);
+      color=(colortol-rainbow-cont-M);
+      color=(colortol-rainbow-cont-N);
+      color=(colortol-rainbow-cont-O);
+      color=(colortol-rainbow-cont-P);
+      color=(colortol-rainbow-cont-Q);
+      color=(colortol-rainbow-cont-R);
+      color=(colortol-rainbow-cont-S);
+      color=(colortol-rainbow-cont-T);
+      color=(colortol-rainbow-cont-U);
+      color=(colortol-rainbow-cont-V);
+      color=(colortol-rainbow-cont-W);
+      color=(colortol-rainbow-cont-X);
+      color=(colortol-rainbow-cont-Y);
+    },
+    cycle list/.define={colortol-rainbow-cont}{[of colormap=colortol-rainbow-cont]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-cont/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-cont}},
+  %
+  % -----------------
+  /pgfplots/colormap/colortol-rainbow-ext-low/.style={
+    colormap={colortol-rainbow-ext-low}{
+      color=(colortol-rainbow-ext-low-A),
+      color=(colortol-rainbow-ext-low-B),
+      color=(colortol-rainbow-ext-low-C),
+      color=(colortol-rainbow-ext-low-D),
+      color=(colortol-rainbow-ext-low-E),
+      color=(colortol-rainbow-ext-low-F),
+      color=(colortol-rainbow-ext-low-G),
+      color=(colortol-rainbow-ext-low-H),
+    },
+    cycle list/.define={colortol-rainbow-ext-low}{[of colormap=colortol-rainbow-ext-low]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-ext-low/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-ext-low}},
+  %
+  /pgfplots/colormap/colortol-rainbow-cont/.style={
+    colormap={colortol-rainbow-cont}{
+      color=(colortol-rainbow-ext-A),
+      color=(colortol-rainbow-ext-B),
+      color=(colortol-rainbow-ext-C),
+      color=(colortol-rainbow-ext-D),
+      color=(colortol-rainbow-ext-E),
+      color=(colortol-rainbow-ext-F),
+      color=(colortol-rainbow-ext-G),
+      color=(colortol-rainbow-ext-H),
+      color=(colortol-rainbow-ext-I),
+      color=(colortol-rainbow-ext-J),
+      color=(colortol-rainbow-ext-K),
+      color=(colortol-rainbow-ext-L),
+      color=(colortol-rainbow-ext-M),
+      color=(colortol-rainbow-ext-N),
+      color=(colortol-rainbow-ext-O),
+      color=(colortol-rainbow-ext-P),
+      color=(colortol-rainbow-ext-Q),
+      color=(colortol-rainbow-ext-R),
+      color=(colortol-rainbow-ext-S),
+      color=(colortol-rainbow-ext-T),
+      color=(colortol-rainbow-ext-U),
+      color=(colortol-rainbow-ext-V),
+    },
+    cycle list/.define={colortol-rainbow-ext}{[of colormap=colortol-rainbow-ext]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-ext/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-ext}},
+  %
+  /pgfplots/colormap/colortol-rainbow-ext-high/.style={
+    colormap={colortol-rainbow-ext-high}{
+      color=(colortol-rainbow-ext-high-A),
+      color=(colortol-rainbow-ext-high-B),
+      color=(colortol-rainbow-ext-high-C),
+      color=(colortol-rainbow-ext-high-D),
+    },
+    cycle list/.define={colortol-rainbow-ext-high}{[of colormap=colortol-rainbow-ext-high]},
+  },
+  /pgfplots/cycle list/colortol-rainbow-ext-high/.style={/pgfplots/@@colortol set cycle list={colortol-rainbow-ext-high}},
+}


Property changes on: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/pgflibrarypgfplots.colortol.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarycolortol.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarycolortol.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarycolortol.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -0,0 +1,277 @@
+
+% Color schemes as obtained from <http://www.sron.nl/~pault/>
+% and <http://www.sron.nl/~pault/colourschemes.pdf> respectively
+
+% =============================================================================
+% colors from palette I
+\pgfutil at definecolor{colortol-P1-A}{RGB}{51,34,136}
+\pgfutil at definecolor{colortol-P1-B}{RGB}{68,119,170}
+\pgfutil at definecolor{colortol-P1-C}{RGB}{102,153,204}
+\pgfutil at definecolor{colortol-P1-D}{RGB}{136,204,238}
+\pgfutil at definecolor{colortol-P1-E}{RGB}{68,170,153}
+\pgfutil at definecolor{colortol-P1-F}{RGB}{17,119,51}
+\pgfutil at definecolor{colortol-P1-G}{RGB}{153,153,51}
+\pgfutil at definecolor{colortol-P1-H}{RGB}{221,204,119}
+\pgfutil at definecolor{colortol-P1-I}{RGB}{102,17,0}
+\pgfutil at definecolor{colortol-P1-J}{RGB}{204,102,119}
+\pgfutil at definecolor{colortol-P1-K}{RGB}{170,68,102}
+\pgfutil at definecolor{colortol-P1-L}{RGB}{136,34,85}
+\pgfutil at definecolor{colortol-P1-M}{RGB}{170,68,153}
+% color for data gaps
+\pgfutil at definecolor{colortol-P1-gap}{RGB}{221,221,221}
+
+
+% -----------------------------------------------------------------------------
+% colors from palette II
+% bright
+\pgfutil at definecolor{colortol-P2light-A}{RGB}{119,170,221}
+\pgfutil at definecolor{colortol-P2light-B}{RGB}{119,204,204}
+\pgfutil at definecolor{colortol-P2light-C}{RGB}{136,204,170}
+\pgfutil at definecolor{colortol-P2light-D}{RGB}{221,221,119}
+\pgfutil at definecolor{colortol-P2light-E}{RGB}{221,170,119}
+\pgfutil at definecolor{colortol-P2light-F}{RGB}{221,119,136}
+\pgfutil at definecolor{colortol-P2light-G}{RGB}{204,153,187}
+% medium
+\pgfutil at definecolor{colortol-P2-A}{RGB}{68,119,170}
+\pgfutil at definecolor{colortol-P2-B}{RGB}{68,170,170}
+\pgfutil at definecolor{colortol-P2-C}{RGB}{68,170,119}
+\pgfutil at definecolor{colortol-P2-D}{RGB}{170,170,68}
+\pgfutil at definecolor{colortol-P2-E}{RGB}{170,119,68}
+\pgfutil at definecolor{colortol-P2-F}{RGB}{170,68,85}
+\pgfutil at definecolor{colortol-P2-G}{RGB}{170,68,136}
+% dark
+\pgfutil at definecolor{colortol-P2dark-A}{RGB}{17,68,119}
+\pgfutil at definecolor{colortol-P2dark-B}{RGB}{17,119,119}
+\pgfutil at definecolor{colortol-P2dark-C}{RGB}{17,119,68}
+\pgfutil at definecolor{colortol-P2dark-D}{RGB}{119,119,17}
+\pgfutil at definecolor{colortol-P2dark-E}{RGB}{119,68,17}
+\pgfutil at definecolor{colortol-P2dark-F}{RGB}{119,17,34}
+\pgfutil at definecolor{colortol-P2dark-G}{RGB}{119,17,85}
+
+
+% -----------------------------------------------------------------------------
+% colors from palette III
+\pgfutil at definecolor{colortol-P3-blue}{RGB}{68,119,170}
+\pgfutil at definecolor{colortol-P3-cyan}{RGB}{102,204,238}
+\pgfutil at definecolor{colortol-P3-green}{RGB}{34,136,51}
+\pgfutil at definecolor{colortol-P3-yellow}{RGB}{204,187,68}
+\pgfutil at definecolor{colortol-P3-red}{RGB}{238,102,119}
+\pgfutil at definecolor{colortol-P3-pink}{RGB}{170,51,119}
+% color for data gaps
+\pgfutil at definecolor{colortol-P3-gray}{RGB}{187,187,187}
+
+
+% =============================================================================
+% colors from diverging and sequential palettes
+% sequential palette
+% (same as `YlOrBr' colormap from `ColorBrewer' library)
+\pgfutil at definecolor{colortol-seq-A}{RGB}{255,255,229}
+\pgfutil at definecolor{colortol-seq-B}{RGB}{255,251,213}
+\pgfutil at definecolor{colortol-seq-C}{RGB}{255,247,188}
+\pgfutil at definecolor{colortol-seq-D}{RGB}{254,227,145}
+\pgfutil at definecolor{colortol-seq-E}{RGB}{254,217,142}
+\pgfutil at definecolor{colortol-seq-F}{RGB}{254,196,79}
+\pgfutil at definecolor{colortol-seq-G}{RGB}{251,154,41}
+\pgfutil at definecolor{colortol-seq-H}{RGB}{236,112,20}
+\pgfutil at definecolor{colortol-seq-I}{RGB}{217,95,14}
+\pgfutil at definecolor{colortol-seq-J}{RGB}{204,76,2}
+\pgfutil at definecolor{colortol-seq-K}{RGB}{153,52,4}
+\pgfutil at definecolor{colortol-seq-L}{RGB}{140,45,4}
+\pgfutil at definecolor{colortol-seq-M}{RGB}{102,37,6}
+% color for data gaps
+\pgfutil at definecolor{colortol-seq-gap}{RGB}{136,136,136}
+
+
+% -----------------------------------------------------------------------------
+% diverging palettes
+% -----------------------------------------------------------------------------
+% (similar to `RdYlBu' colormap from `ColorBrewer' library)
+\pgfutil at definecolor{colortol-div-A}{RGB}{0,139,206}
+\pgfutil at definecolor{colortol-div-B}{RGB}{61,82,161}
+\pgfutil at definecolor{colortol-div-C}{RGB}{58,137,201}
+\pgfutil at definecolor{colortol-div-D}{RGB}{119,183,229}
+\pgfutil at definecolor{colortol-div-E}{RGB}{153,199,236}
+\pgfutil at definecolor{colortol-div-F}{RGB}{180,221,247}
+\pgfutil at definecolor{colortol-div-G}{RGB}{230,245,254}
+\pgfutil at definecolor{colortol-div-H}{RGB}{255,250,210}
+\pgfutil at definecolor{colortol-div-I}{RGB}{255,227,170}
+\pgfutil at definecolor{colortol-div-J}{RGB}{249,189,126}
+\pgfutil at definecolor{colortol-div-K}{RGB}{245,162,117}
+\pgfutil at definecolor{colortol-div-L}{RGB}{237,135,94}
+\pgfutil at definecolor{colortol-div-M}{RGB}{210,77,62}
+\pgfutil at definecolor{colortol-div-N}{RGB}{208,50,50}
+\pgfutil at definecolor{colortol-div-O}{RGB}{174,28,62}
+% color for data gaps
+\pgfutil at definecolor{colortol-div-gap}{RGB}{102,102,102}
+
+
+% (reversed `RdBu-9' colormap from `ColorBrewer' library)
+\pgfutil at definecolor{colortol-div2-A}{RGB}{33,102,172}
+\pgfutil at definecolor{colortol-div2-B}{RGB}{67,147,195}
+\pgfutil at definecolor{colortol-div2-C}{RGB}{146,197,222}
+\pgfutil at definecolor{colortol-div2-D}{RGB}{209,229,240}
+\pgfutil at definecolor{colortol-div2-E}{RGB}{247,247,247}
+\pgfutil at definecolor{colortol-div2-F}{RGB}{253,219,199}
+\pgfutil at definecolor{colortol-div2-G}{RGB}{244,165,130}
+\pgfutil at definecolor{colortol-div2-H}{RGB}{214,96,77}
+\pgfutil at definecolor{colortol-div2-I}{RGB}{178,24,43}
+% color for data gaps
+\pgfutil at definecolor{colortol-div2-gaps}{RGB}{255,238,153}
+
+
+% (similar to `PRGn-9' colormap from `ColorBrewer' library,
+%  where only color G has changed. (PRGn-J = 166,219,160))
+\pgfutil at definecolor{colortol-div3-A}{RGB}{118,42,131}
+\pgfutil at definecolor{colortol-div3-B}{RGB}{153,112,171}
+\pgfutil at definecolor{colortol-div3-C}{RGB}{194,165,207}
+\pgfutil at definecolor{colortol-div3-D}{RGB}{231,212,232}
+\pgfutil at definecolor{colortol-div3-E}{RGB}{247,247,247}
+\pgfutil at definecolor{colortol-div3-F}{RGB}{217,240,211}
+\pgfutil at definecolor{colortol-div3-G}{RGB}{172,211,158}
+\pgfutil at definecolor{colortol-div3-H}{RGB}{90,174,97}
+\pgfutil at definecolor{colortol-div3-I}{RGB}{27,120,55}
+% color for data gaps
+\pgfutil at definecolor{colortol-div3-gaps}{RGB}{255,238,153}
+
+
+% =============================================================================
+% colors for the rainbow palette (from the TechNote)
+\pgfutil at definecolor{colortol-rainbow-A}{RGB}{120,28,129}
+\pgfutil at definecolor{colortol-rainbow-B}{RGB}{136,46,114}
+\pgfutil at definecolor{colortol-rainbow-C}{RGB}{177,120,166}
+\pgfutil at definecolor{colortol-rainbow-D}{RGB}{214,193,222}
+\pgfutil at definecolor{colortol-rainbow-E}{RGB}{65,59,147}
+\pgfutil at definecolor{colortol-rainbow-F}{RGB}{64,64,150}
+\pgfutil at definecolor{colortol-rainbow-G}{RGB}{63,71,155}
+\pgfutil at definecolor{colortol-rainbow-H}{RGB}{63,78,161}
+\pgfutil at definecolor{colortol-rainbow-I}{RGB}{63,86,167}
+\pgfutil at definecolor{colortol-rainbow-J}{RGB}{63,96,174}
+\pgfutil at definecolor{colortol-rainbow-K}{RGB}{64,101,177}
+\pgfutil at definecolor{colortol-rainbow-L}{RGB}{65,108,183}
+\pgfutil at definecolor{colortol-rainbow-M}{RGB}{66,119,189}
+\pgfutil at definecolor{colortol-rainbow-N}{RGB}{70,131,193}
+\pgfutil at definecolor{colortol-rainbow-O}{RGB}{82,137,199}
+\pgfutil at definecolor{colortol-rainbow-P}{RGB}{72,139,194}
+\pgfutil at definecolor{colortol-rainbow-Q}{RGB}{73,140,194}
+\pgfutil at definecolor{colortol-rainbow-R}{RGB}{75,145,192}
+\pgfutil at definecolor{colortol-rainbow-S}{RGB}{77,149,190}
+\pgfutil at definecolor{colortol-rainbow-T}{RGB}{82,157,183}
+\pgfutil at definecolor{colortol-rainbow-U}{RGB}{83,158,182}
+\pgfutil at definecolor{colortol-rainbow-V}{RGB}{85,161,177}
+\pgfutil at definecolor{colortol-rainbow-W}{RGB}{87,163,173}
+\pgfutil at definecolor{colortol-rainbow-X}{RGB}{91,167,167}
+\pgfutil at definecolor{colortol-rainbow-Y}{RGB}{95,170,159}
+\pgfutil at definecolor{colortol-rainbow-Z}{RGB}{98,172,155}
+\pgfutil at definecolor{colortol-rainbow-AA}{RGB}{99,173,153}
+\pgfutil at definecolor{colortol-rainbow-AB}{RGB}{109,179,136}
+\pgfutil at definecolor{colortol-rainbow-AC}{RGB}{110,179,135}
+\pgfutil at definecolor{colortol-rainbow-AD}{RGB}{125,184,116}
+\pgfutil at definecolor{colortol-rainbow-AE}{RGB}{127,185,114}
+\pgfutil at definecolor{colortol-rainbow-AF}{RGB}{134,187,106}
+\pgfutil at definecolor{colortol-rainbow-AG}{RGB}{145,189,97}
+\pgfutil at definecolor{colortol-rainbow-AH}{RGB}{161,190,86}
+\pgfutil at definecolor{colortol-rainbow-AI}{RGB}{177,190,78}
+\pgfutil at definecolor{colortol-rainbow-AJ}{RGB}{181,189,76}
+\pgfutil at definecolor{colortol-rainbow-AK}{RGB}{190,188,72}
+\pgfutil at definecolor{colortol-rainbow-AL}{RGB}{199,185,68}
+\pgfutil at definecolor{colortol-rainbow-AM}{RGB}{202,184,67}
+\pgfutil at definecolor{colortol-rainbow-AN}{RGB}{211,179,63}
+\pgfutil at definecolor{colortol-rainbow-AO}{RGB}{216,175,61}
+\pgfutil at definecolor{colortol-rainbow-AP}{RGB}{217,173,60}
+\pgfutil at definecolor{colortol-rainbow-AQ}{RGB}{222,167,58}
+\pgfutil at definecolor{colortol-rainbow-AR}{RGB}{223,165,58}
+\pgfutil at definecolor{colortol-rainbow-AS}{RGB}{227,156,55}
+\pgfutil at definecolor{colortol-rainbow-AT}{RGB}{229,148,53}
+\pgfutil at definecolor{colortol-rainbow-AU}{RGB}{230,142,52}
+\pgfutil at definecolor{colortol-rainbow-AV}{RGB}{230,139,51}
+\pgfutil at definecolor{colortol-rainbow-AW}{RGB}{231,133,50}
+\pgfutil at definecolor{colortol-rainbow-AX}{RGB}{231,124,48}
+\pgfutil at definecolor{colortol-rainbow-AY}{RGB}{231,116,47}
+\pgfutil at definecolor{colortol-rainbow-AZ}{RGB}{231,109,46}
+\pgfutil at definecolor{colortol-rainbow-BA}{RGB}{230,104,45}
+\pgfutil at definecolor{colortol-rainbow-BB}{RGB}{230,100,44}
+\pgfutil at definecolor{colortol-rainbow-BC}{RGB}{232,96,28}
+\pgfutil at definecolor{colortol-rainbow-BD}{RGB}{217,33,32}
+\pgfutil at definecolor{colortol-rainbow-BE}{RGB}{220,5,12}
+% ---
+\pgfutil at definecolor{colortol-rainbow-BF}{RGB}{25,101,176}
+\pgfutil at definecolor{colortol-rainbow-BG}{RGB}{123,175,222}
+\pgfutil at definecolor{colortol-rainbow-BH}{RGB}{78,178,101}
+\pgfutil at definecolor{colortol-rainbow-BI}{RGB}{144,201,135}
+\pgfutil at definecolor{colortol-rainbow-BJ}{RGB}{202,224,171}
+\pgfutil at definecolor{colortol-rainbow-BK}{RGB}{247,238,85}
+\pgfutil at definecolor{colortol-rainbow-BL}{RGB}{246,193,65}
+\pgfutil at definecolor{colortol-rainbow-BM}{RGB}{241,147,45}
+% color for data gaps
+\pgfutil at definecolor{colortol-rainbow-gap}{RGB}{119,119,119}
+
+
+% -----------------------------------------------------------------------------
+% rainbow continuous palette
+\pgfutil at definecolor{colortol-rainbow-cont-A}{rgb}{0.47200,0.10893,0.50761}
+\pgfutil at definecolor{colortol-rainbow-cont-B}{rgb}{0.34213,0.09855,0.49621}
+\pgfutil at definecolor{colortol-rainbow-cont-C}{rgb}{0.28275,0.14652,0.52189}
+\pgfutil at definecolor{colortol-rainbow-cont-D}{rgb}{0.25545,0.22543,0.57205}
+\pgfutil at definecolor{colortol-rainbow-cont-E}{rgb}{0.24671,0.31603,0.63730}
+\pgfutil at definecolor{colortol-rainbow-cont-F}{rgb}{0.25077,0.40567,0.70361}
+\pgfutil at definecolor{colortol-rainbow-cont-G}{rgb}{0.26491,0.48682,0.75045}
+\pgfutil at definecolor{colortol-rainbow-cont-H}{rgb}{0.28782,0.55584,0.75812}
+\pgfutil at definecolor{colortol-rainbow-cont-I}{rgb}{0.31885,0.61177,0.72118}
+\pgfutil at definecolor{colortol-rainbow-cont-J}{rgb}{0.35763,0.65539,0.65239}
+\pgfutil at definecolor{colortol-rainbow-cont-K}{rgb}{0.40379,0.68838,0.57183}
+\pgfutil at definecolor{colortol-rainbow-cont-L}{rgb}{0.45673,0.71262,0.49478}
+\pgfutil at definecolor{colortol-rainbow-cont-M}{rgb}{0.51545,0.72969,0.42849}
+\pgfutil at definecolor{colortol-rainbow-cont-N}{rgb}{0.57835,0.74051,0.37454}
+\pgfutil at definecolor{colortol-rainbow-cont-O}{rgb}{0.64317,0.74507,0.33179}
+\pgfutil at definecolor{colortol-rainbow-cont-P}{rgb}{0.70698,0.74240,0.29822}
+\pgfutil at definecolor{colortol-rainbow-cont-Q}{rgb}{0.76646,0.73065,0.27175}
+\pgfutil at definecolor{colortol-rainbow-cont-R}{rgb}{0.81822,0.70734,0.25045}
+\pgfutil at definecolor{colortol-rainbow-cont-S}{rgb}{0.85937,0.66972,0.23257}
+\pgfutil at definecolor{colortol-rainbow-cont-T}{rgb}{0.88791,0.61535,0.21650}
+\pgfutil at definecolor{colortol-rainbow-cont-U}{rgb}{0.90305,0.54279,0.20076}
+\pgfutil at definecolor{colortol-rainbow-cont-V}{rgb}{0.90520,0.45244,0.18413}
+\pgfutil at definecolor{colortol-rainbow-cont-W}{rgb}{0.89577,0.34756,0.16585}
+\pgfutil at definecolor{colortol-rainbow-cont-X}{rgb}{0.87679,0.23541,0.14585}
+\pgfutil at definecolor{colortol-rainbow-cont-Y}{rgb}{0.85054,0.12858,0.12484}
+
+
+% -----------------------------------------------------------------------------
+% colors for the extended rainbow palette (from the website)
+\pgfutil at definecolor{colortol-rainbow-ext-low-A}{RGB}{232,236,251}
+\pgfutil at definecolor{colortol-rainbow-ext-low-B}{RGB}{221,216,239}
+\pgfutil at definecolor{colortol-rainbow-ext-low-C}{RGB}{209,193,225}
+\pgfutil at definecolor{colortol-rainbow-ext-low-D}{RGB}{195,168,209}
+\pgfutil at definecolor{colortol-rainbow-ext-low-E}{RGB}{181,143,194}
+\pgfutil at definecolor{colortol-rainbow-ext-low-F}{RGB}{167,120,180}
+\pgfutil at definecolor{colortol-rainbow-ext-low-G}{RGB}{155,98,167}
+\pgfutil at definecolor{colortol-rainbow-ext-low-H}{RGB}{140,78,153}
+% ---
+\pgfutil at definecolor{colortol-rainbow-ext-A}{RGB}{111,76,155}
+\pgfutil at definecolor{colortol-rainbow-ext-B}{RGB}{96,89,169}
+\pgfutil at definecolor{colortol-rainbow-ext-C}{RGB}{85,104,184}
+\pgfutil at definecolor{colortol-rainbow-ext-D}{RGB}{78,121,197}
+\pgfutil at definecolor{colortol-rainbow-ext-E}{RGB}{77,138,198}
+\pgfutil at definecolor{colortol-rainbow-ext-F}{RGB}{78,150,188}
+\pgfutil at definecolor{colortol-rainbow-ext-G}{RGB}{84,158,179}
+\pgfutil at definecolor{colortol-rainbow-ext-H}{RGB}{89,165,169}
+\pgfutil at definecolor{colortol-rainbow-ext-I}{RGB}{96,171,158}
+\pgfutil at definecolor{colortol-rainbow-ext-J}{RGB}{105,177,144}
+\pgfutil at definecolor{colortol-rainbow-ext-K}{RGB}{119,183,125}
+\pgfutil at definecolor{colortol-rainbow-ext-L}{RGB}{140,188,104}
+\pgfutil at definecolor{colortol-rainbow-ext-M}{RGB}{166,190,84}
+\pgfutil at definecolor{colortol-rainbow-ext-N}{RGB}{190,188,72}
+\pgfutil at definecolor{colortol-rainbow-ext-O}{RGB}{209,181,65}
+\pgfutil at definecolor{colortol-rainbow-ext-P}{RGB}{221,170,60}
+\pgfutil at definecolor{colortol-rainbow-ext-Q}{RGB}{228,156,57}
+\pgfutil at definecolor{colortol-rainbow-ext-R}{RGB}{231,140,53}
+\pgfutil at definecolor{colortol-rainbow-ext-S}{RGB}{230,121,50}
+\pgfutil at definecolor{colortol-rainbow-ext-T}{RGB}{228,99,45}
+\pgfutil at definecolor{colortol-rainbow-ext-U}{RGB}{223,72,40}
+\pgfutil at definecolor{colortol-rainbow-ext-V}{RGB}{218,34,34}
+% ---
+\pgfutil at definecolor{colortol-rainbow-ext-high-A}{RGB}{184,34,30}
+\pgfutil at definecolor{colortol-rainbow-ext-high-B}{RGB}{149,33,27}
+\pgfutil at definecolor{colortol-rainbow-ext-high-C}{RGB}{114,30,23}
+\pgfutil at definecolor{colortol-rainbow-ext-high-D}{RGB}{82,26,19}
+% color for data gaps
+\pgfutil at definecolor{colortol-rainbow-ext-gaps}{RGB}{102,102,102}


Property changes on: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarycolortol.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.dateplot.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -8,12 +8,12 @@
 % 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/>.
 %
@@ -35,7 +35,7 @@
 % 	};
 % 	\end{axis}
 % \end{tikzpicture}
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 \def\pgfplotslibdateplot at number@to at julian@and at time#1.#2\julianto#3\hourto#4\minuteto#5{%
 	#3=#1
@@ -50,7 +50,7 @@
 	\c at pgf@countb=\the\pgf at xa\relax
 	% round minutes (we may loose precision here)
 	\advance\pgf at xa by-\the\c at pgf@countb pt
-	\ifdim\pgf at xa>0.5pt	
+	\ifdim\pgf at xa>0.5pt
 		\advance\c at pgf@countb by1
 		\ifnum\c at pgf@countb=60
 			\c at pgf@countb=#4 %
@@ -65,7 +65,7 @@
 % #1 the date
 % #2 the hours
 % #3 the minutes
-% #4 is either empty or is the seconds. 
+% #4 is either empty or is the seconds.
 % #5 a macro which will be filled with the date part.
 % #6 the macro which will contain a number in the range [0,1]
 % representing hours and minutes.
@@ -121,7 +121,7 @@
 % 	\edef#6{\pgf at sys@tonumber\pgf at xa}%
 % }%
 % \def\pgfplotslibdateplot at discard@trailing at colon#1:{#1}%
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 \let\pgfplots at calender@ZEROSHIFT=\pgfutil at empty
 \def\pgfplots at dateplot@ensure at ZEROSHIFT#1{%
@@ -256,7 +256,7 @@
 		}{}%
 	},
 	/pgfplots/date coordinates in/.value required,
-	% 
+	%
 	% #1: the argument for 'data coordinates in={#1}
 	% #2: the default for the inverse transformation. If there is
 	% none, a default will be chosen automatically (with full
@@ -268,4 +268,3 @@
 	/pgfplots/date coordinates default inverse={y}{\year-\month-\day},
 	/pgfplots/date coordinates default inverse={z}{\year-\month-\day},
 }
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.fillbetween.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.fillbetween.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.fillbetween.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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 2013 by Christian Feuersaenger
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -55,7 +55,7 @@
 	/tikz/soft clip assign/domain/.code args={#1:#2}{%
 		\pgfplotsifisvisualizationphase{%
 			\edef\pgfplots at loc@TMPa{%
-				(axis cs:#1,\pgfkeysvalueof{/pgfplots/ymin}) 
+				(axis cs:#1,\pgfkeysvalueof{/pgfplots/ymin})
 				rectangle (axis cs:#2,\pgfkeysvalueof{/pgfplots/ymax})}%
 			\pgfkeysalso{/tikz/soft clip assign/path/.expand once=\pgfplots at loc@TMPa}%
 		}{}%
@@ -64,7 +64,7 @@
 	/tikz/soft clip assign/domain y/.code args={#1:#2}{%
 		\pgfplotsifisvisualizationphase{%
 			\edef\pgfplots at loc@TMPa{%
-				(axis cs:\pgfkeysvalueof{/pgfplots/xmin},#1) 
+				(axis cs:\pgfkeysvalueof{/pgfplots/xmin},#1)
 				rectangle (axis cs:\pgfkeysvalueof{/pgfplots/xmax},#2)}%
 			\pgfkeysalso{/tikz/soft clip assign/path/.expand once=\pgfplots at loc@TMPa}%
 		}{}%
@@ -75,7 +75,7 @@
 	},
 }
 
-% The options are from 
+% The options are from
 % \addplot[#1] fill between[#2] #3;
 %
 % This method is invoked from the global \addplot dispatching.
@@ -147,7 +147,7 @@
 			\endscope
 			\endpgfplotsonlayer%
 		\fi
-	}{%	
+	}{%
 		% post command.
 	}%
 }
@@ -184,7 +184,7 @@
 	}{%
 		% the path instruction:
 		\tikzfillbetween[#1]{#2}%
-	}{%	
+	}{%
 		% post command.
 	}%
 }%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.groupplots.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -320,9 +320,9 @@
 % Determine the ticklabels of both x and y.
 %
 \def\pgfplots at group@determine at ticklabels{%
-    \def\pgfplots at loc@TMPa{all}
-    \def\pgfplots at loc@TMPb{top}
-    \def\pgfplots at loc@TMPc{lower}
+    \def\pgfplots at loc@TMPa{all}%
+    \def\pgfplots at loc@TMPb{top}%
+    \def\pgfplots at loc@TMPc{lower}%
     \ifx\pgfplots at loc@TMPa\pgfplots at group@xticklabels%
       % Do nothing as all should have xticklabels
     \fi
@@ -330,11 +330,13 @@
     \ifx\pgfplots at loc@TMPb\pgfplots at group@xticklabels%
       \foreach \pgfplots at column in {1,...,\pgfplots at group@columns} {%
           \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r1/.append style={xticklabel pos=upper}}%
+              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r1/.append style={%
+                  xticklabel pos=upper}}%
           \ifnum1<\pgfplots at group@rows\relax
             \foreach \pgfplots at row in {2,...,\pgfplots at group@rows} {%
                 \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={/pgfplots/xticklabels={}}}%
+                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={%
+                        /pgfplots/xticklabels={},/pgfplots/xtick scale label code/.code={}}}%
             }%
           \fi%
       }%
@@ -342,12 +344,14 @@
     \ifx\pgfplots at loc@TMPc\pgfplots at group@xticklabels%
       \foreach \pgfplots at column in {1,...,\pgfplots at group@columns} {%
           \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at group@rows/.append style={xticklabel pos=lower}}%
+              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at group@rows/.append style={%
+                  xticklabel pos=lower}}%
           \ifnum1<\pgfplots at group@rows\relax
             \pgfplotsgroupplotsmath at decrease\pgfplots at group@rows
             \foreach \pgfplots at row in {1,...,\pgfmathresult} {%
                 \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={/pgfplots/xticklabels={}}}%
+                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={%
+                        /pgfplots/xticklabels={},/pgfplots/xtick scale label code/.code={}}}%
             }%
           \fi%
       }%
@@ -355,8 +359,9 @@
     % 
     % Defining styles for the ytick's
     % 
-    \def\pgfplots at loc@TMPb{left}
-    \def\pgfplots at loc@TMPc{right}
+    \def\pgfplots at loc@TMPa{all}%
+    \def\pgfplots at loc@TMPb{left}%
+    \def\pgfplots at loc@TMPc{right}%
     \ifx\pgfplots at loc@TMPa\pgfplots at group@yticklabels%
       % Do nothing as all should have yticklabels
     \fi
@@ -367,7 +372,8 @@
           \ifnum1<\pgfplots at group@columns\relax
             \foreach \pgfplots at column in {2,...,\pgfplots at group@columns} {%
                 \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={/pgfplots/yticklabels={}}}%
+                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={%
+                        /pgfplots/yticklabels={}, /pgfplots/ytick scale label code/.code={}}}%
             }%
           \fi%
       }%
@@ -375,17 +381,19 @@
     \ifx\pgfplots at loc@TMPc\pgfplots at group@yticklabels%
       \foreach \pgfplots at row in {1,...,\pgfplots at group@rows} {%
           \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at group@columns r\pgfplots at row/.append style={yticklabel pos=right}}%
+              \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at group@columns r\pgfplots at row/.append style={%
+                  yticklabel pos=right}}%
           \ifnum1<\pgfplots at group@columns\relax
             \pgfplotsgroupplotsmath at decrease\pgfplots at group@columns
             \foreach \pgfplots at column in {1,...,\pgfmathresult} {%
                 \expandafter\xdef\expandafter\pgfplots at glob@TMPa\expandafter{%
-                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={/pgfplots/yticklabels={}}}%
+                    \pgfplots at glob@TMPa,/pgfplots/group/plot c\pgfplots at column r\pgfplots at row/.append style={%
+                        /pgfplots/yticklabels={}, /pgfplots/ytick scale label code/.code={}}}%
             }%
           \fi%
       }%
     \fi%
-    \expandafter\pgfkeys\expandafter{\pgfplots at glob@TMPa}
+    \expandafter\pgfkeys\expandafter{\pgfplots at glob@TMPa}%
 }
 
 %

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.patchplots.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -12,17 +12,17 @@
 % 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/>.
 %
 %--------------------------------------------
-	
+
 	% NOTES:
 	% In general, a Bezier spline C:[0,1] -> \R of order n fulfills
 	% C'(0) = n ( P_1 - P_0 ),
@@ -31,32 +31,32 @@
 	% the derivatives at t=0 and t=1.
 	%
 	%
-	% 
+	%
 %--------------------------------------------------
 % 4-point Lagrange interpolation on {0,1/3,2/3,1}:
-% C(x) = 
+% C(x) =
 % a * (1/3 - x)/(1/3) * (2/3-x)/(2/3) * (1-x) +
 % b * (0   - x)/(0 - 1/3) * (2/3-x)/(2/3-1/3)  * (1-x)/(1-1/3) +
 % c * (0   - x)/(0 - 2/3) * (1/3-x)/(1/3-2/3) *  (1-x)/(1-2/3) +
 % d * (0   - x)/(0 - 1)   * (1/3-x)/(1/3-1)   *  (2/3-x) /(2/3-1)
-% 
-% 
+%
+%
 % Derivative:
-% 
-% (-9*c + 2*d + 72*c*x - 18*d*x - 81*c*x^2 + 27*d*x^2 + 
+%
+% (-9*c + 2*d + 72*c*x - 18*d*x - 81*c*x^2 + 27*d*x^2 +
 %   a*(-11 + 36*x - 27*x^2) + 9*b*(2 - 10*x + 9*x^2))/2
-% 
+%
 % bezier control points are
 % P1 = (-5*a)/6 + 3*b - (3*c)/2 + d/3
 % 	=  -0.833333 a + 3. b - 1.5 c + 0.333333 d
-% 
+%
 % P2 =  0.333333 (0.5 (2. a - 9. b + 18. c - 11. d) + 3. d)
 %   =  0.333333 a - 1.5 b + 3. c - 0.833333 d
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 
 
-% A quadratic spline in the ordering 
+% A quadratic spline in the ordering
 %
 % <left> <right> <middle>
 %
@@ -267,7 +267,7 @@
 	},%
 	recursive refine@={%
 		% The 4-point lagrangian interpolation formular is shown on
-		% the top of this page. What I do here is simply to evaluate 
+		% the top of this page. What I do here is simply to evaluate
 		% C(i*1/9) for i =0,...,9:
 		% 0
 		% 0.493827 A +0.740741 C -0.296296 D +0.0617284 B
@@ -542,7 +542,7 @@
 	% 		\fi
 	% 	\fi
 	% },
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	stream to shader={%
 		% create a degenerate coons patch:
 		\begingroup
@@ -569,7 +569,7 @@
 				\pgfplotslibrarysurfstreamcoord{\pgfqpoint\pgfplotspatchvertexx\pgfplotspatchvertexy}{\pgfplotspointmetatransformed}%
 				% degenerate: the "edge" \PA -- \PA collabses into one
 				% point.
-				% Per construction, the "edge" is the FOREGROUND. 
+				% Per construction, the "edge" is the FOREGROUND.
 %\message{STREAMING COLLAPSED EDGE AT START POINT^^J}%
 				\pgfplotslibrarysurfstreamcoord{\pgfqpoint\pgfplotspatchvertexx\pgfplotspatchvertexy}{\pgfplotspointmetatransformed}%
 				\pgfplotslibrarysurfstreamcoord{\pgfqpoint\pgfplotspatchvertexx\pgfplotspatchvertexy}{\pgfplotspointmetatransformed}%
@@ -666,7 +666,7 @@
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}01%
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}11%
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}20%
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		% The ordering is not arbitrary
 		% (unless z buffer=sort is in effect). Let's assume that the
 		% AB edge is BACKGROUND and the CD edge is FOREGROUND. Then
@@ -734,7 +734,7 @@
 		%--------------------------------------------------
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}00%
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}10%
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		\expandafter\pgfplotsplothandlermesh at setnextvertex\expandafter{\pgfplotspatchclass at qtri@F@}%
 		\expandafter\pgfplotsplothandlermesh at setnextvertex\expandafter{\pgfplotspatchclass at qtri@D@}%
 		\expandafter\pgfplotsplothandlermesh at setnextvertex\expandafter{\pgfplotspatchclass at qtri@E@}%
@@ -745,7 +745,7 @@
 		% %--------------------------------------------------
 		% % \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}01%
 		% % \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}11%
-		% %-------------------------------------------------- 
+		% %--------------------------------------------------
 		#1\pgfplotspatchclass at qtri@recursiverefine at newnames
 		%
 		%
@@ -1063,7 +1063,7 @@
 	% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}01%
 	% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}11%
 	% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}20%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	% The ordering is not arbitrary
 	% (unless z buffer=sort is in effect). Let's assume that the
 	% AB edge is BACKGROUND and the CD edge is FOREGROUND. Then
@@ -1163,8 +1163,8 @@
 % D <-- C
 % |     ^
 % v     |
-% A --> B 
-%       
+% A --> B
+%
 \pgfkeyssetvalue{/pgfplots/vertex count}{0}%
 \pgfplotsdeclarepatchclass{polygon}{%
 	new=\def\pgfplotspatchclass at poly@no{0},
@@ -1242,13 +1242,13 @@
 }%
 
 
-% mathematica shape functions parameterized in 
+% mathematica shape functions parameterized in
 % (xi,eta) in [-1,1]x[-1,1]:
 %f[xi_, eta_] =
 %   a*1/4*(1 - xi) (1 - eta) xi*eta +
-%    b 1/4 (-1 - xi) (1 - eta) xi*eta + 
+%    b 1/4 (-1 - xi) (1 - eta) xi*eta +
 %   c*  1/4 (-1 - xi) (-1 - eta) xi*eta +
-%    d *1/4 (1 - xi) (-1 - eta) xi*eta + 
+%    d *1/4 (1 - xi) (-1 - eta) xi*eta +
 %   e * 1/2 (xi^2 - 1) (1 - eta) eta +
 %   f*1/2 (-1 - xi) (eta^2 - 1) xi +
 %   g* -1/2 (1 - xi^2) (-1 - eta) eta +
@@ -1321,9 +1321,9 @@
 		%
 		% This involves a change from Lagrange to bezier
 		% representation of the boundary curves.
-		% 
+		%
 		% Furthermore, pdf supports only **cubic** bezier curves. What
-		% I am doing here is 
+		% I am doing here is
 		% a) change of basis from 3-point lagrange ---> 3 point quadratic bezier
 		% b) expression 3 point quadratic bezier ----> 4 point cubic bezier
 		%
@@ -1333,7 +1333,7 @@
 		%
 		% OUTPUT:
 		% \PA,bezier control 1, bezier control 2, \PC.
-		% 
+		%
 		\def\pgfplots at edge{%
 			\ifx\pgfplotspatchclass at biquad@A\PA
 				\pgfpathmoveto{\expandafter\pgfplotspointpatchvertex\PA\endvertex}%
@@ -1394,7 +1394,7 @@
 	% 		\fi
 	% 	\fi
 	% },
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	stream to shader={%
 		\begingroup
 		%
@@ -1425,7 +1425,7 @@
 		%
 		% we use
 		% \pgfplotspatchclass at rect@to at coonspatch@findshadingsequence at for@depth
-		% which works for bilinear, biquadratic, and bicubic 
+		% which works for bilinear, biquadratic, and bicubic
 		\pgfplotspatchclass at rect@to at coonspatch@findshadingsequence at for@depth
 			{pgfplotspatchclass at biquad@}{\Pcur}{\Pnextseq}%
 		%
@@ -1454,7 +1454,7 @@
 			% Well, this is simple: take the matrix as-is!
 			% simply copy 1:1
 			%
-			% i.e. convert 
+			% i.e. convert
 			% D G C
 			% H I F
 			% A E B
@@ -1461,9 +1461,9 @@
 			%
 			% to
 			%
-			% AC BC CC 
-			% AB BB CB 
-			% AA BA CA 
+			% AC BC CC
+			% AB BB CB
+			% AA BA CA
 			\let\P at AA=\pgfplotspatchclass at biquad@A
 			\let\P at BA=\pgfplotspatchclass at biquad@E
 			\let\P at CA=\pgfplotspatchclass at biquad@B
@@ -1477,15 +1477,15 @@
 		\if B\Pcur
 			% the "B" point needs to be streamed as first.
 			%
-			% i.e. reorder 
+			% i.e. reorder
 			% D G C
 			% H I F
 			% A E B
 			%
-			% to 
-			% A H D     AC BC CC 
-			% E I G =:  AB BB CB 
-			% B F C     AA BA CA 
+			% to
+			% A H D     AC BC CC
+			% E I G =:  AB BB CB
+			% B F C     AA BA CA
 			%
 			\let\P at AA=\pgfplotspatchclass at biquad@B
 			\let\P at BA=\pgfplotspatchclass at biquad@F
@@ -1500,15 +1500,15 @@
 		\if C\Pcur
 			% the "C" point needs to be streamed as first.
 			%
-			% i.e. reorder 
+			% i.e. reorder
 			% D G C
 			% H I F
 			% A E B
 			%
-			% to 
-			% B E A     AC BC CC 
-			% F I H =:  AB BB CB 
-			% C G D     AA BA CA 
+			% to
+			% B E A     AC BC CC
+			% F I H =:  AB BB CB
+			% C G D     AA BA CA
 			%
 			\let\P at AA=\pgfplotspatchclass at biquad@C
 			\let\P at BA=\pgfplotspatchclass at biquad@G
@@ -1523,15 +1523,15 @@
 		\if D\Pcur
 			% the "D" point needs to be streamed as first.
 			%
-			% i.e. reorder 
+			% i.e. reorder
 			% D G C
 			% H I F
 			% A E B
 			%
-			% to 
-			% C F B     AC BC CC 
-			% G I E =:  AB BB CB 
-			% D H A     AA BA CA 
+			% to
+			% C F B     AC BC CC
+			% G I E =:  AB BB CB
+			% D H A     AA BA CA
 			%
 			\let\P at AA=\pgfplotspatchclass at biquad@D
 			\let\P at BA=\pgfplotspatchclass at biquad@H
@@ -1567,7 +1567,7 @@
 		% 'patch type=quadratic spline' . We only need to apply it to all
 		% lines in U direction and afterwards to all lines in V
 		% direction.
-		% 
+		%
 		\def\pgfplotspatchvertexaddXY at expanded##1\times{%
 			\edef\pgfplots at loc@TMPa{##1}%
 			\expandafter\pgfplotspatchvertexaddXY\pgfplots at loc@TMPa\times
@@ -1683,7 +1683,7 @@
 	% 		\edef\pgfplotspatchclass at biquade@CA{#2}%
 	% 	\fi
 	% },
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	serialize except vertices={%
 		\ifx\pgfplotspatchclass at biquade@AB\relax
 			\let\pgfplotsretval\pgfutil at empty%
@@ -1706,7 +1706,7 @@
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}01%
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}11%
 		% \pgfplotspatchclass{\pgfplotspatchclassname}{set edge visible}20%
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		% The ordering is not arbitrary
 		% (unless z buffer=sort is in effect). Let's assume that the
 		% AB edge is BACKGROUND and the CD edge is FOREGROUND. Then
@@ -1721,11 +1721,11 @@
 		% {0.375` a - 0.125` b + 0.75` e,
 		%  0.375` e - 0.125` g + 0.75` i,
 		%   -0.125` f + 0.375` h + 0.75` i,
-		%    0.375` a - 0.125` d + 0.75` h, 
-		%     0.140625` a - 0.046875` b + 0.015625` c - 0.046875` d + 
+		%    0.375` a - 0.125` d + 0.75` h,
+		%     0.140625` a - 0.046875` b + 0.015625` c - 0.046875` d +
 		%       0.28125` e -  0.09375` f - 0.09375` g + 0.28125` h +
 		%       0.5625` i}
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		\pgfplotspatchvertexaccumstart
 		\expandafter\pgfplotspatchvertexadd\pgfplotspatchclass at biquad@A\times{0.375}%
 		\expandafter\pgfplotspatchvertexadd\pgfplotspatchclass at biquad@B\times{-0.125}%
@@ -1832,7 +1832,7 @@
 		% N[ {f[1, 1/2],   f[1/2, 1],   f[0, 1/2],    f[1/2, 1/2]}]
 		% {-0.125` b + 0.375` c + 0.75` f,
 		% 0.375` c - 0.125` d + 0.75` g,
-		% -0.125` e + 0.375` g + 0.75` i, 
+		% -0.125` e + 0.375` g + 0.75` i,
 		% 0.015625` a - 0.046875` b + 0.140625` c - 0.046875` d - 0.09375` e + 0.28125` f + 0.28125` g - 0.09375` h + 0.5625` i}
 		\pgfplotspatchvertexaccumstart
 		\expandafter\pgfplotspatchvertexadd\pgfplotspatchclass at biquad@B\times{-0.125}%
@@ -2317,7 +2317,7 @@
 		%
 		% This involves a change from Lagrange to bezier
 		% representation of the boundary curves.
-		% 
+		%
 		\pgfpathmoveto{\expandafter\pgfplotspointpatchvertex\pgfplotspatchclass at bicubic@AA\endvertex}%
 		\pgfplotspathcubicfrominterpolation
 			{\pgfplotspatchclass at bicubic@AA}
@@ -2355,7 +2355,7 @@
 		%
 		% we use
 		% \pgfplotspatchclass at rect@to at coonspatch@findshadingsequence at for@depth
-		% which works for bilinear, biquadratic, and bicubic 
+		% which works for bilinear, biquadratic, and bicubic
 		%
 		% define helper macros which are input for
 		% \pgfplotspatchclass at rect@to at coonspatch@findshadingsequence at for@depth:
@@ -2400,12 +2400,12 @@
 		\if B\Pcur
 			% the "DA" point needs to be streamed as first.
 			%
-			% Reorder 
+			% Reorder
 			% AD BD CD DD
 			% AC BC CC DC
 			% AB BB CB DB
 			% AA BA CA DA
-			% to 
+			% to
 			% AA AB AC AD
 			% BA BB BC BD
 			% CA CB CC CD
@@ -2431,12 +2431,12 @@
 		\if C\Pcur
 			% the "DD" point needs to be streamed as first.
 			%
-			% Reorder 
+			% Reorder
 			% AD BD CD DD
 			% AC BC CC DC
 			% AB BB CB DB
 			% AA BA CA DA
-			% to 
+			% to
 			% DA CA BA AA
 			% DB CB BB AB
 			% DC CC BC AC
@@ -2462,12 +2462,12 @@
 		\if D\Pcur
 			% the "AD" point needs to be streamed as first.
 			%
-			% Reorder 
+			% Reorder
 			% AD BD CD DD
 			% AC BC CC DC
 			% AB BB CB DB
 			% AA BA CA DA
-			% to 
+			% to
 			% DD DC DB DA
 			% CD CC CB CA
 			% BD BC BB BA
@@ -2513,7 +2513,7 @@
 		% 'patch type=cubic spline' . We only need to apply it to all
 		% lines in U direction and afterwards to all lines in V
 		% direction.
-		% 
+		%
 		\def\pgfplotspatchvertexaddXY at expanded##1\times{%
 			\edef\pgfplots at loc@TMPa{##1}%
 			\expandafter\pgfplotspatchvertexaddXY\pgfplots at loc@TMPa\times
@@ -2573,7 +2573,7 @@
 		\let\pgfplotsplothandlermesh at patchclass@=\pgfplotsplothandlermesh at patchclass
 		\def\pgfplotsplothandlermesh at patchclass{triangle}%
 		\pgfplotspatchclass{\pgfplotsplothandlermesh at patchclass}{new}%
-		% Ok. Now create a lot of triangles. 
+		% Ok. Now create a lot of triangles.
 		%
 		% FIXME: The ordering is not arbitrary (unless z buffer=sort is in effect).
 		%
@@ -2627,12 +2627,12 @@
 
 % Transpose a bicubic matrix (4x4).
 %
-% Reorder 
+% Reorder
 % AD BD CD DD
 % AC BC CC DC
 % AB BB CB DB
 % AA BA CA DA
-% to 
+% to
 % DA DB DC DD
 % CA CB CC CD
 % BA BB BC BD
@@ -2648,14 +2648,14 @@
 
 % Transpose a bicubic matrix (4x4).
 %
-% Reorder 
-% AC BC CC 
-% AB BB CB 
-% AA BA CA 
-% to 
-% CA CB CC 
-% BA BB BC 
-% AA AB AC 
+% Reorder
+% AC BC CC
+% AB BB CB
+% AA BA CA
+% to
+% CA CB CC
+% BA BB BC
+% AA AB AC
 \def\pgfplotspatchclass at biquad@transpose{%
 	\pgfplotsutil at swap\P at AB\P at BA
 	\pgfplotsutil at swap\P at CA\P at AC
@@ -2662,7 +2662,7 @@
 	\pgfplotsutil at swap\P at CB\P at BC
 }
 
-% Expects that a 4x4 matrix in tensor bezier representation where 
+% Expects that a 4x4 matrix in tensor bezier representation where
 % A = left end point
 % B = first control point
 % C = second control point
@@ -2669,7 +2669,7 @@
 % D = right end point
 %
 % and the coordinates are stored in \csname P@[ABCD][ABCD]\endcsname
-% 
+%
 % Streaming starts with \P at AA and is applied rowwise.
 \def\pgfplotsplothandlermesh at shade@cubic at tensor{%
 	% Stream it to the shader. Note that the shader has a

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.polar.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -330,7 +330,7 @@
 		\ifx\pgfplots at data@ymin\pgfplots at invalidrange@ymax
 			\global\let\pgfplots at data@ymax=\pgfplots at ymax
 		\fi
-		\ifpgfplots at clip@limits
+		\ifpgfplots at clip@limits at x
 		\else
 			% there is a rare change that min > max.
 			% Handle that ...
@@ -338,6 +338,9 @@
 			\global\let\pgfplots at xmin=\pgfmathresult
 			\pgfplotscoordmath{x}{max}{\pgfplots at xmin}{\pgfplots at xmax}%
 			\global\let\pgfplots at xmax=\pgfmathresult
+		\fi
+		\ifpgfplots at clip@limits at y
+		\else
 			%
 			\pgfplotscoordmath{y}{min}{\pgfplots at ymin}{\pgfplots at ymax}%
 			\global\let\pgfplots at ymin=\pgfmathresult
@@ -344,6 +347,9 @@
 			\pgfplotscoordmath{y}{max}{\pgfplots at ymin}{\pgfplots at ymax}%
 			\global\let\pgfplots at ymax=\pgfmathresult
 			%
+		\fi
+		\ifpgfplots at clip@limits at z
+		\else
 			\ifpgfplots at threedim
 				\pgfplotscoordmath{z}{min}{\pgfplots at zmin}{\pgfplots at zmax}%
 				\global\let\pgfplots at zmin=\pgfmathresult

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.statistics.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.statistics.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.statistics.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -8,12 +8,12 @@
 % 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/>.
 %
@@ -134,7 +134,7 @@
 	% chosen to fit the initial 'draw position':
 	boxplot/box extend/.initial=0.8,
 	% draw direction=x|y
-	boxplot/draw direction/.initial=x,	
+	boxplot/draw direction/.initial=x,
 	%
 	% Activates "dynamic size" feature
 	boxplot/variable width/.is if=pgfplotsplothandlerboxplot at variable@width,
@@ -152,7 +152,7 @@
 	boxplot/sample size min/.initial=,
 	boxplot/sample size max/.initial=,
 	%
-	% this factor times 'box extend' is the size for 
+	% this factor times 'box extend' is the size for
 	% 'sample size min'. The max value gets 'box extend'.
 	boxplot/variable width min target/.initial=0.2,
 	%
@@ -162,7 +162,7 @@
 	% 1,2,3,4,... . This should probably simplify tick (label) generation.
 	boxplot/draw position/.initial=1+\plotnumofactualtype,
 	%
-	% draw relative anchor=0:  
+	% draw relative anchor=0:
 	%     |    |---|  |
 	%     |    |   |  |
 	%     |----|---|--|
@@ -172,7 +172,7 @@
 	%     |----|   |--|
 	%     |    |---|  |
 	%
-	% draw relative anchor=1:  
+	% draw relative anchor=1:
 	%     |----|---|--|
 	%     |    |   |  |
 	%     |    |---|  |
@@ -253,9 +253,9 @@
 	\let\pgfplotsplothandlersurveystart=\pgfplotsplothandlersurveystart at boxplot
 	\let\pgfplotsplothandlersurveyend=\pgfplotsplothandlersurveyend at boxplot
 	\def\pgfplotsplothandlerLUAfactory{%
-		function(axis, pointmetainputhandler) 
+		function(axis, pointmetainputhandler)
 			return pgfplots.BoxPlotPlothandler.new(
-				pgfplots.BoxPlotRequest.new( 
+				pgfplots.BoxPlotRequest.new(
 					"\pgfkeysvalueof{/pgfplots/boxplot/lower quartile off}",
 					"\pgfkeysvalueof{/pgfplots/boxplot/upper quartile off}",
 					"\pgfkeysvalueof{/pgfplots/boxplot/whisker range}",
@@ -366,7 +366,7 @@
 				}
 				% FIXME : implement 'ceil' in the FPU!
 				\pgfplots at error{The argument 'estimator=\pgfplots at boxplot@estimator' is only available in conjunction with 'lua backend' and lualatex.}%
-			\or	
+			\or
 				% R2:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{##1*##2 + 0.5}%
@@ -387,7 +387,7 @@
 				}
 				% FIXME : implement 'ceil' in the FPU!
 				\pgfplots at error{The argument 'estimator=\pgfplots at boxplot@estimator' is only available in conjunction with 'lua backend' and lualatex.}%
-			\or	
+			\or
 				% R3:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{##1*##2}%
@@ -397,7 +397,7 @@
 					\let\offset at low=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@getIndex{\offset at low}{##2}%
 				}
-			\or	
+			\or
 				% R4:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{##1*##2}%
@@ -404,7 +404,7 @@
 					\let\h=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@std at lookup{##2}%
 				}
-			\or	
+			\or
 				% R5:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{##1*##2 + 0.5}%
@@ -411,7 +411,7 @@
 					\let\h=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@std at lookup{##2}%
 				}
-			\or	
+			\or
 				% R6:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{##1*(##2+1)}%
@@ -418,7 +418,7 @@
 					\let\h=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@std at lookup{##2}%
 				}
-			\or	
+			\or
 				% R7:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{(##2-1) * ##1 + 1}%
@@ -425,7 +425,7 @@
 					\let\h=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@std at lookup{##2}%
 				}
-			\or	
+			\or
 				% R8:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{(##2 + 1/3) * ##1 + 1/3}%
@@ -432,7 +432,7 @@
 					\let\h=\pgfmathresult
 					\pgfplotsplothandler at boxplot@percentile at estimator@std at lookup{##2}%
 				}
-			\or	
+			\or
 				% R9:
 				\def\pgfplotsplothandler at boxplot@percentile at estimator@##1##2{%
 					\pgfmathparse{(##2 + 1/4) * ##1 + 3/8}%
@@ -556,7 +556,7 @@
 }
 
 
-\def\pgfplotsplothandlersurveyend at boxplot@computestats{ 
+\def\pgfplotsplothandlersurveyend at boxplot@computestats{
 	%
 	\pgfplotsplothandler at boxplot@init at percentile@estimator
 	%
@@ -887,7 +887,7 @@
 		\pgfmathfloattofixed\pgfmathresult
 	\fi
 	% remember it for later - it might have been retrieved from some
-	% table column! If you used something like 
+	% table column! If you used something like
 	% 'draw position=\thisrow{position}, the position of the LAST data point
 	% will be used (because we are in end survey here).
 	\edef\pgfplots at loc@TMPb{\noexpand\pgfplotsplothandlersurveyaddoptions{/pgfplots/boxplot/draw position=\pgfmathresult}}%
@@ -1077,9 +1077,9 @@
 			\begingroup
 			\pgfkeys{/pgf/fpu}%
 			\pgfmathparse{
-				(\pgfplots at widthkey@mintrg + 
-				max(0,min(1,(\pgfplots at widthkey@ - \pgfplotsplothandlerboxplot at widthkey@min) / 
-				(\pgfplotsplothandlerboxplot at widthkey@max - \pgfplotsplothandlerboxplot at widthkey@min))) 
+				(\pgfplots at widthkey@mintrg +
+				max(0,min(1,(\pgfplots at widthkey@ - \pgfplotsplothandlerboxplot at widthkey@min) /
+				(\pgfplotsplothandlerboxplot at widthkey@max - \pgfplotsplothandlerboxplot at widthkey@min)))
 				  * (1-\pgfplots at widthkey@mintrg)) * \pgfplots at loc@TMPa}%
 			\pgfmathfloattofixed\pgfmathresult
 			\pgfmath at smuggleone\pgfmathresult
@@ -1174,7 +1174,7 @@
 % A helper which implements 'draw relative anchor'. It expands to a
 % math expression which is suitable as second argument for 'boxplot cs';
 % i.e. it needs to be added to 'boxplot/draw position'.
-% 
+%
 % More precisely, this macro is to be used in a context where lines of
 % 'box extend' length have to be drawn.
 %
@@ -1183,7 +1183,7 @@
 %
 % #1: the coordinate. 0 is the means "lower part of the construct
 % which is to be drawn". 1 means the "upper part of that construct"
-% and 0.5 is in the middle. 
+% and 0.5 is in the middle.
 \def\pgfplots at boxplot@anchor at value#1{%
 	(#1-\pgfplotsboxplotvalue{draw relative anchor})*\pgfplotsboxplotvalue{box extend}%
 }
@@ -1195,10 +1195,10 @@
 }
 
 \def\pgfplotsboxplotpointabbox#1#2{%
-	\pgfplotsboxplotpointab{#1}{\pgfplots at boxplot@anchor at value{#2}}%	
+	\pgfplotsboxplotpointab{#1}{\pgfplots at boxplot@anchor at value{#2}}%
 }%
 \def\pgfplotsboxplotpointabwhisker#1#2{%
-	\pgfplotsboxplotpointab{#1}{\pgfplots at boxplot@anchor at value@whisker{#2}}%	
+	\pgfplotsboxplotpointab{#1}{\pgfplots at boxplot@anchor at value@whisker{#2}}%
 }%
 
 \tikzdeclarecoordinatesystem{boxplot}{%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsarray.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -31,12 +31,12 @@
 % 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/>.
 %
@@ -100,7 +100,7 @@
 }
 
 % #1 the array's name (a macro name
-% #2 a list created by \pgfplotslistnew 
+% #2 a list created by \pgfplotslistnew
 \def\pgfplotsarrayfrompgfplotslist#1#2{%
 	\pgfplotsarraynewempty#1%
 	\pgfplotslistforeachungrouped#2\as\pgfplotsarray at TMPa{%
@@ -398,7 +398,7 @@
 }%
 
 % Sorts array '#1' using N log N time.
-% 
+%
 % The sort key is provided as argument in
 % /pgfplots/iflessthan/.code args={#1#2#3#4}, see docs in
 % pgfplotsutil.code.tex.
@@ -405,14 +405,14 @@
 %
 % Remarks:
 % - the sorting algorithm is a sub-optimal mergesort currently -
-% but it has runtime N log N. 
+% but it has runtime N log N.
 % - As usual, it is very difficult to move the final result out of the
-%   current scope. The initial configuration allocates a *global* copy of #1 
+%   current scope. The initial configuration allocates a *global* copy of #1
 %   to carry results out of one TeX group. This means that memory will NEVER be freed.
 %   I don't see a general N log N alternative for doing so (short of discarding
 %   the scopes for local groups).
 %   BUT:
-%   you can redefine the code key pair 
+%   you can redefine the code key pair
 %     |/pgfplots/array/unscope pre|
 %   and
 %     |/pgfplots/array/unscope post|
@@ -440,19 +440,19 @@
 % \pgfplotsarraypushback677\to\testarray
 % \pgfplotsarraypushback765\to\testarray
 % \pgfplotsarraypushback703\to\testarray
-% 
-% Unsorted: 
-% 
+%
+% Unsorted:
+%
 % [\pgfplotsarrayforeach\testarray\as\elem{\elem\space}]
-% 
+%
 % \pgfplotsarraysort\testarray
-% 
-% sorted: 
-% 
+%
+% sorted:
+%
 % [\pgfplotsarrayforeach\testarray\as\elem{\elem\space}]
-% 
-%-------------------------------------------------- 
 %
+%--------------------------------------------------
+%
 % @see \pgfplotsutilsortthree
 % @see \pgfplotsutilsortfour
 \def\pgfplotsarraysort{%
@@ -609,7 +609,7 @@
 	\pgfplotsarray at mergesort{#1}{#4}{#5}%
 }
 
-	
+
 % A simple, ungrouped insert sort algorithm for small arrays.
 %
 %	for i := 1; i < N; ++i do

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/liststructure/pgfplotsliststructureext.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -6,7 +6,7 @@
 %
 % The 'pgfplotsapplist' is a list which has ONLY the features
 %
-%  \pgfplotsapplistnewempty 
+%  \pgfplotsapplistnewempty
 %  \pgfplotsapplistpushback O(1)
 %  \pgfplotsapplistedefcontenttomacro (N)
 %  \pgfplotsapplistxdefcontenttomacro (N)
@@ -15,9 +15,9 @@
 % contrast to TeX's macro append routines which lead to O(N^2)
 % runtime).
 %
-% Furthermore, there is the 
+% Furthermore, there is the
 %
-%  \pgfplotsapplistXnewempty 
+%  \pgfplotsapplistXnewempty
 %  \pgfplotsapplistXpushback
 %  \pgfplotsapplistXedefcontenttomacro (N)
 %  \pgfplotsapplistXxdefcontenttomacro (N)
@@ -39,12 +39,12 @@
 % 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/>.
 %
@@ -57,7 +57,7 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % the applist defines one macro for each element, like
-% 
+%
 % \def\element<i>{<content>\element<i+1>}
 % \def\element<i+1>{<content>\element<i+2>}
 % \def\element<i+2>{}
@@ -100,7 +100,7 @@
 	\expandafter\edef\csname\string#2@\pgfplots at loc@TMPa\endcsname{\the\t at pgfplots@toka\the\t at pgfplots@tokb}%
 	\expandafter\let\the\t at pgfplots@tokb=\pgfutil at empty
 }%
-	
+
 % time O(N)
 % Expands the complete content of list #1 as-is into the macro #2.
 \def\pgfplotsapplistedefcontenttomacro#1\to#2{\edef#2{#1}}
@@ -125,7 +125,7 @@
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-% Usage: 
+% Usage:
 % \pgfplotsapplistXnewempty\macro
 % \pgfplotsapplistXnewempty[to global]\macro
 %
@@ -223,7 +223,7 @@
 	\expandafter\def\csname\string#1 at bigbuf@c\endcsname{0}%
 }%
 
-	
+
 % Expands the complete content of list #1 as-is into the macro #2.
 \def\pgfplotsapplistXedefcontenttomacro#1\to#2{%
 	\pgfplotsapplistXflushbuffers#1%
@@ -243,7 +243,7 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
+%
 % A variant of applist which has the same runtime requirements, but
 % does PUSH FRONT only.
 %
@@ -250,7 +250,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
-% Usage: 
+% Usage:
 % \pgfplotsprependlistXnewempty{liste}
 \def\pgfplotsprependlistXnewempty#1{%
 	\expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil at empty
@@ -316,7 +316,7 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
-% 
+%
 % This list \pgfplotsapplistXX here is essentially the SAME as \pgfplotslistX.
 %
 % But there can only be one such list at a time, so it is faster than
@@ -408,7 +408,7 @@
 	\def\pgfplotsapplistXX at bigbuf@c{0}%
 }%
 
-	
+
 % Expands the complete content of list #1 as-is into the macro #2.
 \def\pgfplotsapplistXXedefcontenttomacro#1{%
 	\pgfplotsapplistXXflushbuffers
@@ -428,7 +428,7 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
-% 
+%
 % \pgfplotslistXXglobal  assigns to a global list.
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
@@ -509,7 +509,7 @@
 	\gdef\pgfplotsapplistXXglobal at bigbuf@c{0}%
 }%
 
-	
+
 % Expands the complete content of list #1 as-is into the macro #2.
 %
 % this assigns locally into #1.
@@ -542,7 +542,7 @@
 
 \def\pgfplotsgloballet{\global\let}%
 
-% Usage: 
+% Usage:
 % \pgfplotsapplistXglobalnewempty\macro
 % \pgfplotsapplistXglobalnewempty[to global]\macro
 %
@@ -609,7 +609,7 @@
 	\expandafter\gdef\csname\string#1 at bigbuf@c\endcsname{0}%
 }%
 
-	
+
 \def\pgfplotsapplistXgloballet#1=#2{%
 	\pgfplotsapplistXglobalflushbuffers#2%
 	\let#1=#2}

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/binary.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/binary.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/binary.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -12,7 +12,7 @@
 	pgfplotsUnpack = unpack;
 end
 
--- Takes a table containing an arbitrary number of integers in the range 0..255 and converts it 
+-- 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

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -13,6 +13,8 @@
 do
 -- all globals will be read from/defined in pgfplots:
 local _ENV = pgfplots
+
+local pgftonumber = pgfluamathfunctions.tonumber
 -----------------------------------
 
 ColorSpace = newClass()
@@ -33,7 +35,8 @@
 -- colorspace: an instance of ColorSpace
 -- values: an array (1-based table) with color components. Each color component is supposed to be a table with K entries where K is colorspace:numComponents
 -- positions: either an empty array (in which case the colormap is uniform) or one position per value. Positions are in [0,1000]
-function ColorMap:constructor( h, colorspace, values, positions)
+-- scaleOrderZ the specific scaling factor used for 'colormap access=const' (or negative or the empty string if this is disabled)
+function ColorMap:constructor( h, colorspace, values, positions, scaleOrderZ)
 	if not h or not colorspace or not positions or not values then error("arguments must not be nil")end
 
 	self.name = name
@@ -42,6 +45,7 @@
 	self.colorspace = colorspace
 	self.values = values
 	self.pos = positions
+	self:setScaleOrderZ(scaleOrderZ)
 
 	local numComponents = self.colorspace.numComponents
 	for i = 1,#self.values do
@@ -52,24 +56,48 @@
 	end
 end
 
-function ColorMap:findPrecomputed(inMin, inMax, x)
+function ColorMap:isUniform()
+	if #self.pos == 0 then
+		return true
+	else
+		return false
+	end
+end
+
+function ColorMap:setScaleOrderZ(scaleOrderZ)
+	if type(scaleOrderZ) == "number" then
+		self.scaleOrderZ = scaleOrderZ
+	elseif #scaleOrderZ == 0 or type(scaleOrderZ) == "string" and scaleOrderZ == "h" then
+		-- special case which means "h"
+		self.scaleOrderZ = "h"
+	else
+		self.scaleOrderZ = pgftonumber(scaleOrderZ)
+	end
+end
+
+function ColorMap:_transform(inMin, inMax, x)
 	local transformed
 	if inMin == 0 and inMax == ColorMap.range then
 		transformed = x
 	else
-		local scale = ColorMap.range / (inMax - inMin) 
+		local scale = ColorMap.range / (inMax - inMin)
 
 		transformed = (x - inMin) * scale
 	end
 	transformed = math.max(0, transformed)
 	transformed = math.min(ColorMap.range, transformed)
-	
+	return transformed
+end
+
+function ColorMap:findPrecomputed(inMin, inMax, x)
+	local transformed = self:_transform(inMin, inMax, x)
+
 	local divh = transformed * self.invh
 	local intervalno = math.floor(divh)
 	local factor = divh - intervalno
 	local factor_two = 1-factor
 
-	
+
 	-- Step 2: interpolate the desired RGB value using vector valued interpolation on the identified interval
 	if intervalno+1 == #self.values then
 		-- ah- we are at the right end!
@@ -90,6 +118,34 @@
 	return result
 end
 
+function ColorMap:findPiecewiseConst(inMin, inMax, x)
+	-- see docs in \pgfplotscolormapfindpiecewiseconst at precomputed@ for details
+
+	local transformed = self:_transform(inMin, inMax, x)
+	local intervalno =-1
+	if self:isUniform() then
+		if self.scaleOrderZ == "h" then
+			invh = self.invh + 0.001
+		else
+			-- disable the extra interval
+			invh = self.invh
+		end
+
+		local divh = transformed * invh
+		intervalno = math.floor(divh)
+	else
+	 	-- FIXME : IMPLEMENT
+	end
+
+	if intervalno+1 == #self.values then
+		-- we have artificially increased the "h" (see the comments
+		-- above) -- meaning that this 'if' can happen.
+		-- ->Map the rightmost point to the rightmost interval:
+		return self.values[#self.values]
+	end
+	return self.values[intervalno+1]
+end
+
 -----------------------------------
 
 -- global registry of all colormaps.

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/meshplothandler.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/meshplothandler.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/meshplothandler.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -90,7 +90,7 @@
             tmp = coords[1+scanlineOff+i]
             coords[1+scanlineOff+i] = coords[reverseindex]
             coords[reverseindex] = tmp
-            
+
             reverseindex = reverseindex-1
         end
     end
@@ -192,7 +192,7 @@
 	if self.isZBufferSort then
 		result = self:applyZBufferSort(result)
 	end
-	
+
 	return result
 end
 
@@ -200,7 +200,7 @@
 function MeshVisualizer:applyZBufferSort(coords)
 	-- in order to sort this thing, we need to compute the sort key (view depth) for each coord.
 	-- furthermore, each list entry must be single patch... that means we need a (huge?) temporary table.
-	
+
 	local patchType = self.patchType
 	local numVertices = patchType.numVertices
 
@@ -225,7 +225,7 @@
 	-- STEP 2: assign the sort key: the "element depth".
 	--
 	-- the "element depth" is defined to be the MEAN of all
-	-- vertex depths. 
+	-- 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
@@ -241,7 +241,7 @@
 			local vertex = patchcoords[j]
 
 			local vertexDepth = getVertexDepth(axis,vertex)
-			
+
 			sumOfVertexDepth = sumOfVertexDepth + vertexDepth
 		end
 		patch.elementDepth = sumOfVertexDepth
@@ -270,7 +270,7 @@
 
 function MeshVisualizer:decodeIntoPatches(coords)
 	local result = {}
-	
+
 	local scanLineLength = self.scanLineLength
 	local length = #coords
 

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotstexio.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotstexio.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotstexio.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,10 +9,10 @@
 -- * TeX can call LUA methods in order to "do something". The reverse direction is not true: LUA cannot call TeX methods.
 --
 -- * the only way that LUA can read TeX input values or write TeX output values is the top layer (at the time of this writing: only pgfplotstexio.lua ).
--- 
--- * The LUA backend has one main purpose: scalability and performance. 
+--
+-- * The LUA backend has one main purpose: scalability and performance.
 --   Its purpose is _not_ to run a standalone visualization.
---   
+--
 --   The precise meaning of "scalability" is: the LUA backend should do as much
 --   as possible which is done for single coordinates. Coordinates constitute
 --   "scalability": the number of coordinates can become arbitrarily large.
@@ -20,13 +20,13 @@
 --   "Performance" is related to scalability. But it is more: some dedicated
 --   utility function might have a TeX backend and will be invoked whenever it
 --   is needed. Candidates are colormap functions, z buffer arithmetics etc.
---   
+--
 --   Thus, the best way to ensure "scalability" is to move _everything_ which is to be done for a single coordinate to LUA.
 --
---   Sometimes, this will be impossible or too expensive. 
+--   Sometimes, this will be impossible or too expensive.
 --	 Here, "Performance" might still be optimized by some dedicated LUA function.
 --
--- 
+--
 -- Unfortunately, the LUA backend does not simplify the code base - it makes it more complicated.
 -- This is due to the way it is used: one needs to know when the TeX backend
 -- delegates all its work to LUA. It is also due to the fact that it
@@ -40,7 +40,7 @@
 --
 -- * \begin{axis}. It invokes \pgfplots at prepare@LUA at api .
 --     The purpose is to define the global pgfplots.gca "_g_et _c_urrent _a_xis" and to transfer some key presets.
---  
+--
 --     Log message: "lua backend=true: Activating LUA backend for axis."
 --
 -- * \end{axis}. It invokes \pgfplots at LUA@visualization at update@axis .
@@ -73,7 +73,7 @@
 --      entire processing to the LUA backend. If it succeeds, it will do
 --      nothing on the TeX side.
 --
---      Both PARTIAL MODE and COMPLETE MODE call 
+--      Both PARTIAL MODE and COMPLETE MODE call
 --        \pgfplots at LUA@survey at start : transfer plot type and current axis arguments to LUA
 --      and
 --        \pgfplots at LUA@survey at end : copy LUA axis arguments back to TeX.
@@ -114,7 +114,7 @@
 	pt.x[2] = y
 	pt.x[3] = z
 	pt.meta = meta
-	
+
 	gca.currentPlotHandler:surveypoint(pt)
 end
 
@@ -125,7 +125,7 @@
 	pt.x[2] = nil
 	pt.x[3] = nil
 	pt.meta = nil
-	
+
 	gca:addSurveyedJump(gca.currentPlotHandler, pt)
 end
 
@@ -134,7 +134,7 @@
 function texSurveyEnd()
 	local result = gca:surveyToPgfplots(gca.currentPlotHandler, true)
 	--log("returning " .. result .. "\n\n")
-    
+
 	tex.sprint(LOAD_TIME_CATCODETABLE, result);
 	gca.currentPlotHandler=nil
 end
@@ -156,14 +156,14 @@
 	if not plotNum or plotIs3d==nil then error("arguments must not be nil") end
 
     local currentPlotHandler = gca.plothandlers[plotNum+1]
-    gca.currentPlotHandler = currentPlotHandler; 
+    gca.currentPlotHandler = currentPlotHandler;
     if currentPlotHandler then
 		currentPlotHandler.plotIs3d = plotIs3d
         currentPlotHandler:visualizationPhaseInit();
-        tex.sprint("1") 
+        tex.sprint("1")
     else
         -- ok, this plot has no LUA support.
-        tex.sprint("0") 
+        tex.sprint("0")
     end
 end
 
@@ -200,9 +200,9 @@
 function texApplyZBufferReverseScanline(scanLineLength)
     local currentPlotHandler = gca.currentPlotHandler
     if not currentPlotHandler then error("This function cannot be used in the current context") end
-    
+
     currentPlotHandler:reverseScanline(scanLineLength)
-end 
+end
 
 -- Modifies the Surveyed coordinate list.
 -- Expands to nothing
@@ -209,9 +209,9 @@
 function texApplyZBufferReverseTransposed(scanLineLength)
     local currentPlotHandler = gca.currentPlotHandler
     if not currentPlotHandler then error("This function cannot be used in the current context") end
-    
+
     currentPlotHandler:reverseTransposed(scanLineLength)
-end 
+end
 
 -- Modifies the Surveyed coordinate list.
 -- Expands to nothing
@@ -218,12 +218,12 @@
 function texApplyZBufferReverseStream()
     local currentPlotHandler = gca.currentPlotHandler
     if not currentPlotHandler then error("This function cannot be used in the current context") end
-    
+
     currentPlotHandler:reverseStream(scanLineLength)
-end 
+end
 
 -- Modifies the Surveyed coordinate list.
--- 
+--
 -- Note that this is UNRELATED to mesh/surface plots! They have their own (patch-based) z buffer.
 --
 -- Expands to nothing
@@ -230,9 +230,9 @@
 function texApplyZBufferSort()
     local currentPlotHandler = gca.currentPlotHandler
     if not currentPlotHandler then error("This function cannot be used in the current context") end
-    
+
    currentPlotHandler:sortCoordinatesByViewDepth()
-end 
+end
 
 -- Modifies the Surveyed coordinate list.
 -- Expands to the resulting coordinates
@@ -239,10 +239,17 @@
 function texGetSurveyedCoordsToPgfplots()
     local currentPlotHandler = gca.currentPlotHandler
     if not currentPlotHandler then error("This function cannot be used in the current context") end
-    
+
     tex.sprint(LOAD_TIME_CATCODETABLE, currentPlotHandler:surveyedCoordsToPgfplots(gca))
 end
 
+function texColorMapSetScaleOrderZ(mapName, scaleOrderZ)
+	local colormap = ColorMaps[mapName];
+	if colormap then
+		colormap:setScaleOrderZ(scaleOrderZ)
+	end
+end
+
 -- Performance optimization: computes the colormap lookup.
 function texColorMapPrecomputed(mapName, inMin, inMax, x)
 	local colormap = ColorMaps[mapName];
@@ -261,6 +268,24 @@
 	end
 end
 
+-- Performance optimization: computes the colormap lookup.
+function texColorMapFindPiecewiseConst(mapName, inMin, inMax, x)
+	local colormap = ColorMaps[mapName];
+	if colormap then
+		local result = colormap:findPiecewiseConst(
+			pgftonumber(inMin),
+			pgftonumber(inMax),
+			pgftonumber(x))
+
+		local str = ""
+		for i = 1,#result do
+			if i>1 then str = str .. "," end
+			str = str .. tostringfixed(result[i])
+		end
+		tex.sprint(LOAD_TIME_CATCODETABLE, str)
+	end
+end
+
 local function isStripPrefixOrSuffixChar(char)
 	return char == ' ' or char == '{' or char == "}"
 end
@@ -343,7 +368,7 @@
 			local domainMin = arg1
 			local h = arg2-arg1
 			local domainMax = arg3
-			
+
 			-- round to the nearest integer (using +0.5, should be ok)
 			local samples = math.floor((domainMax - domainMin)/h + 0.5) + 1
 
@@ -359,19 +384,19 @@
 -- generates TeX output '1' on success and '0' on failure
 -- @param debugMode one of a couple of strings: "off", "verbose", or "compileerror"
 function texAddplotExpressionCoordinateGenerator(
-	is3d, 
-	xExpr, yExpr, zExpr, 
-	sampleLine, 
-	domainxmin, domainxmax, 
-	domainymin, domainymax, 
-	samplesx, samplesy, 
-	variablex, variabley, 
+	is3d,
+	xExpr, yExpr, zExpr,
+	sampleLine,
+	domainxmin, domainxmax,
+	domainymin, domainymax,
+	samplesx, samplesy,
+	variablex, variabley,
 	samplesAt,
 	debugMode
 )
 	local plothandler = gca.currentPlotHandler
 	local coordoutputstream = SurveyCoordOutputStream.new(plothandler)
-	
+
 	if samplesAt and string.len(samplesAt) >0 then
 		-- "samples at" has higher priority than domain.
 		-- Use it!
@@ -378,13 +403,13 @@
 
 		domainxmin, domainxmax, samplesx = samplesAtToDomain(samplesAt)
 		if not domainxmin then
-			-- FAILURE: could not convert "samples at". 
+			-- FAILURE: could not convert "samples at".
 			-- Fall back to a TeX based survey.
 			log("log", "LUA survey failed: The value of 'samples at= " .. tostring(samplesAt) .. "' is unsupported by the LUA backend (currently, only 'samples at={a,b,...,c}' is supported).\n")
 			tex.sprint("0")
 			return
 		end
-			
+
 	else
 		domainxmin= pgftonumber(domainxmin)
 		domainxmax= pgftonumber(domainxmax)
@@ -421,7 +446,7 @@
 	removeSurroundingBraces(expressions)
 
 	local generator = AddplotExpressionCoordinateGenerator.new(
-		coordoutputstream, 
+		coordoutputstream,
 		expressions,
 		domainMin, domainMax,
 		samples,
@@ -441,7 +466,7 @@
 	else
 		error("Got unknown debugMode = " .. debugMode )
 	end
-	
+
 	local success
 	if compileErrorOnFailure then
 		success = generator:generateCoords()

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotsutil.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotsutil.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/pgfplotsutil.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -65,7 +65,7 @@
 local nan = math.sqrt(-1)
 pgfplotsmath.nan = nan
 
---------------------------------------- 
+---------------------------------------
 --
 
 
@@ -97,7 +97,7 @@
 
 
 
--- Create a new class that inherits from a base class 
+-- Create a new class that inherits from a base class
 --
 -- base = pgfplots.newClass()
 -- function base:constructor()

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -6,7 +6,7 @@
 -- pgfplots.Axis
 -- pgfplots.Coord
 -- pgfplots.Plothandler
--- 
+--
 -- and some related classes.
 
 local math=math
@@ -43,11 +43,11 @@
 end
 
 function Coord:__tostring()
-    local result = '(' .. stringOrDefault(self.x[1], "--") .. 
-        ',' .. stringOrDefault(self.x[2], "--") .. 
-        ',' .. stringOrDefault(self.x[3], "--") .. 
+    local result = '(' .. stringOrDefault(self.x[1], "--") ..
+        ',' .. stringOrDefault(self.x[2], "--") ..
+        ',' .. stringOrDefault(self.x[3], "--") ..
         ') [' .. stringOrDefault(self.meta, "--") .. ']'
-    
+
     if not self.x[1] and self.unfiltered then
         result = result .. "(was " .. tostring(self.unfiltered) .. ")"
     end
@@ -109,7 +109,7 @@
         result = math.min(1000, result)
         return result
     else
-        if self.warnForfilterDiscards then  
+        if self.warnForfilterDiscards then
             log("The per point meta data '" .. tostring(meta) .. " (and probably others as well) is unbounded - using the minimum value instead.\n")
             self.warnForfilterDiscards=false
         end
@@ -116,9 +116,9 @@
         return 0
     end
 end
-    
-    
 
+
+
 -------------------------------------------------------
 
 -- Abstract base class of all plot handlers.
@@ -240,7 +240,7 @@
 		end
     end
     self.axis:datapointsurveyed(current, self)
-    
+
     self.coordindex = self.coordindex + 1;
 end
 
@@ -271,11 +271,11 @@
     return table.concat(result)
 end
 
--- PRIVATE 
+-- PRIVATE
 --
 -- does the same as \pgfplotsplothandlerserializepointto
 function Plothandler:serializeCoordToPgfplots(pt)
-    return 
+    return
         toTeXstring(pt.x[1]) .. "," ..
         toTeXstring(pt.x[2]) .. "," ..
         toTeXstring(pt.x[3])
@@ -321,7 +321,7 @@
 		local vertexDepth = getVertexDepth(axis,coords[i])
 		coords[i].vertexDepth = vertexDepth
 	end
-	
+
 	-- Step 2: sort (inplace)
 	local comparator = function(ptA, ptB)
 		return ptA.vertexDepth > ptB.vertexDepth
@@ -372,7 +372,7 @@
 -- * visualize just plot marks at each of the collected coordinates
 -- * visualize just error bars at each collected coordinate
 -- * ...
--- 
+--
 
 -- this class offers basic visualization support. "Basic" means that it will merely transform and finalize input coordinates.
 PlotVisualizer = newClass()
@@ -392,7 +392,7 @@
 --
 -- @return any results. The format of the results is currently a list of Coord, but I am unsure of whether it will stay this way.
 --
--- Note that a PlotVisualizer does _not_ modify self.sourcePlotHandler.coords 
+-- Note that a PlotVisualizer does _not_ modify self.sourcePlotHandler.coords
 function PlotVisualizer:getVisualizationOutput()
 	local result = {}
 	local coords = self.sourcePlotHandler.coords
@@ -407,7 +407,7 @@
 		local result_i
 		local result_i = Coord.new()
 		result_i:copy(coords[i])
-		
+
 		if result_i.x[1] ~= nil then
 			self:visphasegetpoint(result_i)
 		else
@@ -422,7 +422,7 @@
 
 -- PROTECTED
 -- resembles \pgfplotsplothandlervisualizejump -- or at least that part which can be done in LUA.
--- It does not visualize anything, but it can be used to modify the coordinate 
+-- It does not visualize anything, but it can be used to modify the coordinate
 function PlotVisualizer:notifyJump(pt)
 	-- do nothing.
 end
@@ -486,7 +486,7 @@
 --		- the other input coordinates are already read.
 --	POSTCONDITION for '@assign':
 --		- \pgfplots at current@point at meta is ready for use:
---		- EITHER a parsed floating point number 
+--		- EITHER a parsed floating point number
 --		- OR an empty string,
 --		- OR a symbolic string (if the issymbolic boolean is true)
 --	The default implementation is
@@ -521,7 +521,7 @@
 function CoordAssignmentPointMetaHandler:constructor(dir)
     PointMetaHandler.constructor(self, false,false)
     if not dir then error "nil argument for 'dir' is unsupported." end
-    self.dir=dir 
+    self.dir=dir
 end
 
 function CoordAssignmentPointMetaHandler:assign(pt)
@@ -561,8 +561,8 @@
 		error("point meta=" .. self.expression .. ": expression has been rejected.")
     end
 end
-	
 
+
 -------------------------------------------------------
 
 DatascaleTrafo = newClass()
@@ -580,12 +580,12 @@
 
 -------------------------------------------------------
 
--- An axis. 
+-- An axis.
 Axis = newClass()
 
 function Axis:constructor()
     self.is3d = false
-    self.clipLimits = true
+    self.clipLimits = { true, true, true} 
     self.autocomputeAllLimits = true -- FIXME : redundant!?
     self.autocomputeMin = { true, true, true }
     self.autocomputeMax = { true, true, true }
@@ -618,7 +618,7 @@
 	end
 
 	if #vertex ~=3 then
-		error("Cannot compute vertex depth of " .. tostring(pt) .. ": expected a 3d point but got " .. tostring(#vertex)) 
+		error("Cannot compute vertex depth of " .. tostring(pt) .. ": expected a 3d point but got " .. tostring(#vertex))
 	end
 	if not viewdir or #viewdir~=3 then error("got unexpected view dir " ..tostring(viewdir) ) end
 
@@ -704,7 +704,7 @@
 function Axis:validatecoord(dir, point)
     if not dir or not point then error("arguments must not be nil") end
     local result = pgftonumber(point.x[dir])
-    
+
     if result == nil then
         result = nil
     elseif result == pgfplotsmath.infty or result == -pgfplotsmath.infty or pgfplotsmath.isnan(result) then
@@ -728,9 +728,9 @@
     if pt.x[3] ~= nil then
         self.is3d = true
     end
-    
+
     local result = Coord.new()
-    
+
     local unfiltered = Coord.new()
     unfiltered.x = {}
     unfiltered.meta = pt.meta
@@ -754,7 +754,7 @@
     for i = 1,self:loopMax() do
         self:validatecoord(i, result)
     end
-    
+
     local resultIsBounded = true
     for i = 1,self:loopMax() do
         if result.x[i] == nil then
@@ -766,7 +766,7 @@
         result.x = { nil, nil, nil}
     end
 
-    return result    
+    return result
 end
 
 -- PROTECTED
@@ -794,8 +794,8 @@
 -- @param pt an instance of Coord
 function Axis:updatelimitsforcoordinate(pt)
     local isClipped = false
-    if self.clipLimits then
-        for i = 1,self:loopMax(),1 do
+    for i = 1,self:loopMax(),1 do
+        if self.clipLimits[i] then
             if not self.autocomputeMin[i] then
                 isClipped = isClipped or pt.x[i] < self.min[i]
             end
@@ -802,15 +802,15 @@
             if not self.autocomputeMax[i] then
                 isClipped = isClipped or pt.x[i] > self.max[i]
             end
-        end                
+        end
     end
-    
+
     if not isClipped then
         for i = 1,self:loopMax(),1 do
             if self.autocomputeMin[i] then
                 self.min[i] = math.min(pt.x[i], self.min[i])
             end
-            
+
             if self.autocomputeMax[i] then
                 self.max[i] = math.max(pt.x[i], self.max[i])
             end
@@ -833,7 +833,7 @@
 --
 -- unfinished, see its fixmes
 function Axis:addVisualizationDependencies(pt)
-    -- FIXME : 'visualization depends on' 
+    -- FIXME : 'visualization depends on'
     -- FIXME : 'execute for finished point'
     return pt
 end
@@ -840,7 +840,7 @@
 
 -- PROTECTED
 --
--- indicates that a data point has been surveyed by the axis and that it can be consumed 
+-- indicates that a data point has been surveyed by the axis and that it can be consumed
 function Axis:datapointsurveyed(pt, plothandler)
     if not pt or not plothandler then error("arguments must not be nil") end
     if pt.x[1] ~= nil then
@@ -882,7 +882,7 @@
             end
         end
     end
-    
+
     -- note that the TeX variant would increase the coord index here.
     -- We do it it surveypoint.
 end
@@ -905,7 +905,7 @@
 	local x = toTeXstring(pt.x[1])
 	local y = toTeXstring(pt.x[2])
 	local z = toTeXstring(pt.x[3])
-	return 
+	return
 		"\\gdef" .. namePrefix .. "@x{" .. x .. "}" ..
 		"\\gdef" .. namePrefix .. "@y{" .. y .. "}" ..
 		"\\gdef" .. namePrefix .. "@z{" .. z .. "}";
@@ -942,8 +942,8 @@
     local firstCoord = findFirstValidCoord(plothandler.coords) or Coord.new()
     local lastCoord = findLastValidCoord(plothandler.coords) or Coord.new()
 
-    local result = 
-		plothandlerResult .. 
+    local result =
+		plothandlerResult ..
 		toTeXxyzCoord("\\pgfplots at currentplot@firstcoord", firstCoord) ..
 		toTeXxyzCoord("\\pgfplots at currentplot@lastcoord", lastCoord) ..
         axisLimitToTeXString("\\pgfplots at metamin", plothandler.metamin) ..
@@ -959,7 +959,7 @@
         axisLimitToTeXString("\\pgfplots at zmax", self.max[3]) ..
 		"\\global\\pgfplots at threedimtrue ";
 	end
-    if plothandler.plotHasJumps then 
+    if plothandler.plotHasJumps then
 		result = result ..
 		"\\def\\pgfplotsaxisplothasjumps{1}"
 	else
@@ -966,7 +966,7 @@
 		result = result ..
 		"\\def\\pgfplotsaxisplothasjumps{0}"
 	end
-    if plothandler.hasUnboundedPointMeta then 
+    if plothandler.hasUnboundedPointMeta then
 		result = result ..
 		"\\def\\pgfplotsaxisplothasunboundedpointmeta{1}"
 	else
@@ -973,7 +973,7 @@
 		result = result ..
 		"\\def\\pgfplotsaxisplothasunboundedpointmeta{0}"
 	end
-    if plothandler.filteredCoordsAway then 
+    if plothandler.filteredCoordsAway then
 		result = result ..
 		"\\def\\pgfplotsaxisfilteredcoordsaway{1}"
 	else

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/statistics.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/statistics.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/statistics.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -42,8 +42,8 @@
 	end
 	return result
 end
-	
 
+
 -- @param percentile the requested percentile. Use 0.5 for the median, 0.25 for the first quartile, 0.95 for the 95% percentile etc.
 function PercentileEstimator:getValue(percentile, data)
 	error("Use implementation of PercentileEstimator, not interface")
@@ -65,8 +65,8 @@
 	local offset_low = mathfloor(h)
 	local isInt = ( h==offset_low )
 
-	local offset_high = offset_low+1 
-	
+	local offset_high = offset_low+1
+
 	local x_low = self:getIndex(data, offset_low)
 	local x_up = self:getIndex(data, offset_high)
 	local res = x_low
@@ -92,8 +92,8 @@
 	local offset_low = mathfloor(h)
 	local isInt = ( h==offset_low )
 
-	local offset_high = offset_low+1 
-	
+	local offset_high = offset_low+1
+
 	local x_low = self:getIndex(data, offset_low+1)
 	local x_up = self:getIndex(data, offset_high+1)
 	local res = x_low
@@ -122,39 +122,39 @@
 		local x_up = getIndex(self, data, h_low +1 )
 		return x_low + (h - h_low) * (x_up - x_low)
 	end
-	
+
 	if typeFlag == 1 then
-		-- R1 
+		-- R1
 		self.getValue = function(self, percentile, data)
 			local h= #data * percentile
 			return getIndex(self, data, mathceil(h) )
 		end
 	elseif typeFlag == 2 then
-		-- R2 
+		-- R2
 		self.getValue = function(self, percentile, data)
 			local h= #data * percentile + 0.5
 			return 0.5*(getIndex(self, data, mathceil(h-0.5)) + getIndex(self, data, mathfloor(h+0.5) ) )
 		end
 	elseif typeFlag == 3 then
-		-- R3 
+		-- R3
 		self.getValue = function(self, percentile, data)
 			local h= #data * percentile
 			return getIndex(self, data, pgfluamathfunctions.round(h) )
 		end
 	elseif typeFlag == 4 then
-		-- R4 
+		-- R4
 		self.getValue = function(self, percentile, data)
 			local h= #data * percentile
 			return stdLookup(data,h)
 		end
 	elseif typeFlag == 5 then
-		-- R5 
+		-- R5
 		self.getValue = function(self, percentile, data)
 			local h= #data * percentile + 0.5
 			return stdLookup(data,h)
 		end
 	elseif typeFlag == 6 then
-		-- R6 
+		-- R6
 		self.getValue = function(self, percentile, data)
 			local h= (#data +1) * percentile
 			return stdLookup(data,h)
@@ -166,13 +166,13 @@
 			return stdLookup(data,h)
 		end
 	elseif typeFlag == 8 then
-		-- R8 
+		-- R8
 		self.getValue = function(self, percentile, data)
 			local h= (#data + 1/3) * percentile + 1/3
 			return stdLookup(data,h)
 		end
 	elseif typeFlag == 9 then
-		-- R9 
+		-- R9
 		self.getValue = function(self, percentile, data)
 			local h= (#data + 1/4) * percentile + 3/8
 			return stdLookup(data,h)
@@ -183,7 +183,7 @@
 end
 
 
-getPercentileEstimator = function(estimatorName) 
+getPercentileEstimator = function(estimatorName)
 	if estimatorName == "legacy" then
 		return LegacyPgfplotsPercentileEstimator.new()
 	elseif estimatorName == "legacy*" then
@@ -251,7 +251,7 @@
 -- @return an instance of BoxPlotResponse
 function boxPlotCompute(boxPlotRequest, data)
 	if not boxPlotRequest or not data then error("Arguments must not be nil") end
-	
+
 	for i = 1,#data do
 		local data_i = data[i]
 		if data_i == nil or type(data_i) ~= "number" then
@@ -265,7 +265,7 @@
 	for i = 1,#data do
 		sum = sum + data[i]
 	end
-	
+
 	local numCoords = #data
 
 	local lowerWhisker
@@ -321,7 +321,7 @@
 end
 
 -------------------------------------------------------
--- Replicates the survey phase of \pgfplotsplothandlerboxplot 
+-- Replicates the survey phase of \pgfplotsplothandlerboxplot
 BoxPlotPlothandler = newClassExtends(Plothandler)
 
 -- drawDirection : either "x" or "y".
@@ -355,7 +355,7 @@
 
 	local computed = boxPlotCompute( self.boxPlotRequest, self.boxplotInput )
 
-	local texResult = 
+	local texResult =
 		"\\pgfplotsplothandlersurveyend at boxplot@set{lower whisker}{"  .. toTeXstring(computed.lowerWhisker) .. "}" ..
 		"\\pgfplotsplothandlersurveyend at boxplot@set{lower quartile}{" .. toTeXstring(computed.lowerQuartile) .. "}" ..
 		"\\pgfplotsplothandlersurveyend at boxplot@set{median}{"         .. toTeXstring(computed.median) .. "}" ..
@@ -362,10 +362,10 @@
 		"\\pgfplotsplothandlersurveyend at boxplot@set{upper quartile}{" .. toTeXstring(computed.upperQuartile) .. "}" ..
 		"\\pgfplotsplothandlersurveyend at boxplot@set{upper whisker}{"  .. toTeXstring(computed.upperWhisker) .. "}" ..
 		"\\pgfplotsplothandlersurveyend at boxplot@set{sample size}{"    .. toTeXstring(# self.boxplotInput) .. "}"
-		
+
 	self.boxplotInput = nil
 	Plothandler.surveystart(self)
-	
+
 	local outliers = computed.outliers
 	for i =1,#outliers do
 		local outlier = outliers[i]

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/streamer.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/streamer.lua	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/streamer.lua	2017-06-05 23:09:50 UTC (rev 44469)
@@ -49,7 +49,7 @@
 	self.domainMax = domainMax
 	self.samples = samples
 	self.variableNames = variableNames
-	
+
 	-- log("initialized " .. tostring(self) .. "\n")
 end
 
@@ -57,7 +57,7 @@
 -- this method is a replicate of \pgfplots at addplotimpl@expression@@
 function AddplotExpressionCoordinateGenerator:generateCoords()
 	local stringToFunctionMap = pgfluamathfunctions.stringToFunctionMap
-	-- create a backup of the 'x' and 'y' math expressions which 
+	-- create a backup of the 'x' and 'y' math expressions which
 	-- have been defined in \pgfplots at coord@stream at start:
 	local old_global_function_x = stringToFunctionMap["x"]
 	local old_global_function_y = stringToFunctionMap["y"]
@@ -78,10 +78,10 @@
 	end
 
 	local variableNames = self.variableNames
-	
+
 	local x,y
 	local sampleLine = #samples==1
-	
+
 	local function pseudoconstantx() return x end
 	local pseudoconstanty
 	if sampleLine then
@@ -125,8 +125,10 @@
 		local Z = nil
 		if is3d then
 			Z = pgfmathparse(zExpr)
+		else
+			-- FIXME BUG: we need to do something else with 'Z' if this is a 2d plot inside of a 3d axis!
 		end
-		
+
 		local pt = Coord.new()
 		pt.x = { X, Y, Z}
 
@@ -137,7 +139,7 @@
 
 		coordoutputstream:coord(pt)
 	end
-	
+
 	if not sampleLine then
 		local xmin = domainMin[1]
 		local ymin = domainMin[2]
@@ -167,7 +169,7 @@
 			computeXYZ()
 		end
 	end
-	
+
 	stringToFunctionMap[variableNames[1]] = nil
 	stringToFunctionMap[variableNames[2]] = nil
 	return true
@@ -181,10 +183,10 @@
 		result = result .. self.expressions[i] ..", "
 	end
 	result = result .. "\n  domain=" .. self.domainMin[1] .. ":" .. self.domainMax[1]
-	result = result .. "\n  samples=" .. self.samples[1] 
+	result = result .. "\n  samples=" .. self.samples[1]
 	if #self.domainMin == 2 then
 		result = result .. "\n  domain y=" .. self.domainMin[2] .. ":" .. self.domainMax[2]
-		result = result .. "\n  samples y=" .. self.samples[2] 
+		result = result .. "\n  samples y=" .. self.samples[2]
 	end
 	result = result .. "]"
 	return result

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstable.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -2,7 +2,7 @@
 %
 % Package pgfplotstable
 %
-% Provides support to read and work with abstact numeric tables of the
+% Provides support to read and work with abstract numeric tables of the
 % form
 %
 % COLUMN1	COLUMN2 COLUMN3
@@ -17,12 +17,12 @@
 % 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/>.
 %
@@ -97,7 +97,7 @@
 			\ifnum\c at pgfplotstable@rowindex<\pgfplotstablerows\relax
 				\c at pgfplotstable@colindex=\pgfplotstablerows\relax
 				\advance\c at pgfplotstable@colindex by-\c at pgfplotstable@rowindex
-				\advance\c at pgfplotstable@colindex by\pgfplotstablepartsize				
+				\advance\c at pgfplotstable@colindex by\pgfplotstablepartsize
 				\edef\pgfplotstablepartsize{\the\c at pgfplotstable@colindex}%
 			\fi
 			%
@@ -183,10 +183,10 @@
 	% columns={[index]2,name2,name3,[index]5}
 	/pgfplots/table/columns/.initial=,
 	%
-	% this choice allows 
+	% this choice allows
 	% \pgfplotstableset{
 	%    column name={}, % means: the column's display name is an empty string!
-	%    column name=\pgfkeysnovalue, % means: no value specified. In this case, 
+	%    column name=\pgfkeysnovalue, % means: no value specified. In this case,
 	%             the column's display name will default to column's name.
 	% }
 	/pgfplots/table/column name/.initial=\pgfkeysnovalue,
@@ -266,7 +266,7 @@
 	% 	if the 'process' key hadn't been invoked.
 	% 	It will, however, use the current value of \pgfmathresult.
 	%
-	% 	If \continue is NOT empty, for example \def\continue{0}, 
+	% 	If \continue is NOT empty, for example \def\continue{0},
 	% 	`dec sep align' assumes that \pgfmathresult contains the
 	% 	completely typeset cell, including any alignment material.
 	/pgfplots/table/dec sep align/process/.code=,%
@@ -407,8 +407,13 @@
 		}%
 	},%
 	/pgfplots/table/verb string type/.style={%
+		/pgfplots/table/text special chars={\#,\|},% FIXME: too limited ...
 		/pgfplots/table/assign cell content/.code={%
 			\def\pgfplotstable at loc@TMPa{##1}%
+			% hm... this here might be more robust instead of the line
+			% above. But not much, I suppose:
+			%\t at pgfplotstable@a={##1}%
+			%\edef\pgfplotstable at loc@TMPa{\the\t at pgfplotstable@a}%
 			\pgfplots at command@to at string\pgfplotstable at loc@TMPa\pgfplotstable at loc@TMPa
 			\pgfkeyslet{/pgfplots/table/@cell content}{\pgfplotstable at loc@TMPa}%
 		}%
@@ -599,7 +604,7 @@
 	% 	\let\pgfplots at table@curkeyname=\pgfkeyscurrentname
 	% 	\pgfqkeys{/pgf/number format}{\pgfplots at table@curkeyname=#1}%
 	% },%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	/pgfplots/table/create col/assign first/.style={
 		/pgfplots/table/create col/assign%
 	},
@@ -937,7 +942,7 @@
 		/pgfplots/table/every last column/.code=,
 		/pgfplots/table/every head row/.code=,
 		/pgfplots/table/every odd row/.code=,
-		/pgfplots/table/every even row/.code=,±
+		/pgfplots/table/every even row/.code=,
 		/pgfplots/table/every first row/.code=,
 		/pgfplots/table/every last row/.code=,
 		/pgfplots/table/postproc cell content/.code=,
@@ -958,7 +963,7 @@
 %
 % fills the column with x1,...,xN such that yi(xi) == epsilon where
 %
-% In other words, it computes cuts points between the line 
+% In other words, it computes cuts points between the line
 % y == epsilon and one or more other plots yi(x) and returns the 'x'
 % values of the cuts.
 %
@@ -989,7 +994,7 @@
 
 % A helper macro to automatically remove the "hangover" created by
 % 'colortbl'.
-% This allows compatibility between my 'sci sep align' and 'dec sep align' 
+% This allows compatibility between my 'sci sep align' and 'dec sep align'
 % implementations and \rowcolor. Otherwise, the hangover
 % would overwrite digits near the separator.
 %
@@ -1101,7 +1106,7 @@
 	]{#2}%
 }%
 
-% clears the table. 
+% clears the table.
 \def\pgfplotstableclear#1{%
 	\let#1=\relax
 	\expandafter\let\csname \string#1@@table at name\endcsname=\relax
@@ -1111,7 +1116,7 @@
 % \pgfplotstablenew[<options>]{<numrows>}{<\name>}
 % \pgfplotstablenew*[<options>]{<numrows>}{<\name>}
 %
-% Creates a new table from scratch. 
+% Creates a new table from scratch.
 %
 % The new table will contain all columns listed in the 'columns' key
 % which must be present in <options>. The starred version
@@ -1211,7 +1216,7 @@
 				\pgfplotslistforeachungrouped\pgfplotstable at loc@TMPb\as\pgfplotstable at loc@TMPc{%
 					\t at pgfplots@toka=\expandafter{\pgfplotstable at loc@TMPc}%
 					\edef\pgfplotstable at loc@TMPd{%
-						\noexpand\pgfplotslistpushback{\the\t at pgfplots@toka}\to\expandafter\noexpand\csname\string#1@\pgfplotstable at loc@TMPa\endcsname
+						\noexpand\pgfplotslistpushback{\the\t at pgfplots@toka}\noexpand\to\expandafter\noexpand\csname\string#1@\pgfplotstable at loc@TMPa\endcsname
 					}%
 					\pgfplotstable at loc@TMPd
 				}%
@@ -1228,7 +1233,7 @@
 
 % \pgfplotstabletranspose{<\outtable>}{<intable>}
 % \pgfplotstabletranspose[<colname>]{<\outtable>}{<intable>}
-% Defines <\outtable> to be the transposed of <intable>. 
+% Defines <\outtable> to be the transposed of <intable>.
 %
 % If <colname> is not empty, the respective column's entries will be used to
 % make output column names.
@@ -1258,12 +1263,12 @@
 % Creates a new column named #1 and appends it to table #2.
 %
 % The column entries will be created using the command keys
-% 'create col/assign' 
+% 'create col/assign'
 % 'create col/assign last'
 %
 % The key 'create col/assign' will be invoked for every row of table #2.
 % It is supposed to assign the key 'create col/next content'.
-% During evaluation of 'create col/assign', the macro '\thisrow{<col name>}' 
+% During evaluation of 'create col/assign', the macro '\thisrow{<col name>}'
 % expands to the current row's value of the column named by <col name>.
 % Furthermore, '\nextrow{<col name>}' expands to the \emph{next} row's
 % value of the designated column.
@@ -1273,9 +1278,9 @@
 % value.
 %
 % You can use
-% - \thisrow{<col name>}, 
+% - \thisrow{<col name>},
 % - \getthisrow{<col name>}{\macro}
-% - \nextrow{<col name>}, 
+% - \nextrow{<col name>},
 % - \getnextrow{<col name>}{\macro}
 %
 % FIXME this documentation is incomplete. Please refer to pgfplotstable.pdf .
@@ -1310,7 +1315,7 @@
 % \pgfplotstablerow will expand to the current column index, column
 % name and row index, respectively.
 \def\pgfplotstabletypeset{%
-	\pgfutil at ifnextchar[{%	
+	\pgfutil at ifnextchar[{%
 		\pgfplotstabletypeset at opt
 	}{%
 		\pgfplotstabletypeset at opt[]%
@@ -1361,7 +1366,7 @@
 		\fi
 	\fi
 	\ifpgfplotstabletypeset at includeoutfiles
-		\input \pgfplotstable at outfilename\relax	
+		\input \pgfplotstable at outfilename\relax
 	\else
 		\pgfplotstableread{#2}\pgfplotstabletypesetfile at opt@@
 		\ifx\pgfplotstabletypesetfile at opt@@\relax
@@ -1595,7 +1600,7 @@
 % #2: style arguments
 %
 % All these styles are accumulated into the macro
-% \pgfplots at each@nth at styles. 
+% \pgfplots at each@nth at styles.
 \def\pgfplotstabletypeset at append@every at nth@row#1#2{%
 	\edef\pgfplots at loc@TMPa{#1}%
 	% chech for the special 'each nth row={3[+1]}{...} format:
@@ -1659,7 +1664,7 @@
 	% 	\pgfplots at error{There is no such table '\string#2' loaded into memory. Maybe you meant to use '\string\pgfplotstabletypesetfile{\string#2}' instead of '\string\pgfplotstabletypeset{\string#2}'?}%
 	% 	\pgfplotslistnewempty#2
 	% }{}%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	\def\pgfplotstablename{#2}% the name of the actual table struct
 	\def\pgfplotstablecolname{\pgfplotstable at colname}%
 	\def\pgfplotstablecol{\the\c at pgfplotstable@colindex}%
@@ -1746,7 +1751,7 @@
 	%
 	%
 	\ifpgfplotstable at sort
-		% make sure any columns exist (especially create on use). 
+		% make sure any columns exist (especially create on use).
 		% this can be done by calling getcolumnbyname once for every
 		% column:
 		\pgfplotslistforeachungrouped\pgfplotstable at colnames\as\pgfplotstable at colname{%
@@ -1826,7 +1831,7 @@
 		% temporarily restore it: we may need it in row predicates:
 		\global\advance\c at pgfplotstable@colindex by-1\relax
 		\ifpgfplotstable at disable@rowcolstyles
-			% ok, then don't check for 'columns/<name>' and 
+			% ok, then don't check for 'columns/<name>' and
 			% 'display columns/<index>':
 			\edef\pgfplotstable at loc@TMPa{\the\t at pgfplots@toka}%
 		\else
@@ -1858,7 +1863,7 @@
 		\expandafter\pgfplotslistpushbackglobal\pgfplotstable at coltype\to\pgfplotstabletypeset at final@coltypes
 		%
 		\pgfplotslistnewempty\pgfplotstable at col@processed
-		\c at pgfplotstable@counta=0 
+		\c at pgfplotstable@counta=0
 		\pgfplotslistforeachungrouped\pgfplotstable at col\as\pgfplotstable at entry{%
 			\pgfplotstableuserowtrue
 			\edef\pgfplotstable at loc@TMPa{\noexpand\pgfkeysvalueof{/pgfplots/table/row predicate/. at cmd}\the\c at pgfplotstable@rowindex}%
@@ -2159,6 +2164,7 @@
 
 \def\pgfplotstablecreatecol at opt[#1]#2#3{%
 	\begingroup
+	\pgfkeysinterruptkeyfilter
 	\def\pgfplotstablename{#3}% the name of the table struct
 	\pgfplotstableset{columns=,#1,%
 		/pgf/fpu/handlers/empty number/.code 2 args={%
@@ -2294,6 +2300,7 @@
 		\pgfplotstable at isfirstrowfalse
 		\advance\c at pgfplotstable@rowindex by1\relax
 	\pgfutil at repeat
+	\endpgfkeysinterruptkeyfilter
 	\global\let\pgfplots at glob@TMPc=\pgfplotstable at newcol
 	\global\let\pgfplots at glob@TMPb=\pgfplotstable at newcolname
 	\endgroup
@@ -2310,7 +2317,7 @@
 %
 %-----------------------------------------------------------
 
-%	create on use/cut/.style={create col/function graph cut y={7e-4}{x=Basis,ymode=log,xmode=log}{{table=regtable,y=special-L2}}},
+% create on use/cut/.style={create col/function graph cut y={7e-4}{x=Basis,ymode=log,xmode=log}{{table=regtable,y=special-L2}}},
 % #1 = value of fixed line (I call it epsilon)
 % #2 = options
 % #3 = specification where to get the y from. It is a comma separated
@@ -2350,7 +2357,7 @@
 	\ifx\pgfplotstable at fgc@foreach@\pgfutil at empty
 	\else
 		\edef\pgfplotstable at fgc@foreach at process@append{x={\pgfplotstable at fgc@x},y={\pgfplotstable at fgc@y}}%
-		% we have something like 
+		% we have something like
 		%   foreach={\d in {1,2,3,4}}{table\d}
 		% -> process it!
 		%  This will modify \pgfmathaccumb
@@ -2400,8 +2407,8 @@
 						%
 						% Interpolate:
 						\pgfmathparse{
-							\pgfplotstable at fgc@abscissafirst + 
-							(\pgfplotstable at fgc@eps - \pgfplotstable at fgc@first) / (\pgfplotstable at fgc@second-\pgfplotstable at fgc@first) 
+							\pgfplotstable at fgc@abscissafirst +
+							(\pgfplotstable at fgc@eps - \pgfplotstable at fgc@first) / (\pgfplotstable at fgc@second-\pgfplotstable at fgc@first)
 							* (\pgfplotstable at fgc@abscissasecond - \pgfplotstable at fgc@abscissafirst) }%
 						\if\pgfplotstable at fgc@xmode1
 							\pgfmathfloatexp@{\pgfmathresult}%
@@ -2419,7 +2426,7 @@
 			\ifx\pgfplotstable at fgc@foreach\pgfutil at empty
 				\pgfkeyslet{/pgfplots/table/create col/next content}\pgfmathresult%
 			\else
-				% we have something like 
+				% we have something like
 				%   foreach={\d in {1,2,3,4}}{table\d}
 				% -> process it!
 				%  This will modify \pgfmathaccumb
@@ -2517,13 +2524,13 @@
 			\fi
 			\pgfmathfloatlessthan@{\pgfplotstable at fgc@val}{\pgfplotstable at fgc@eps}%
 			\ifpgfmathfloatcomparison
-				\pgfplotstable at fgc@findintervalwitheps at updateresult 01
+				\pgfplotstable at fgc@findintervalwitheps at updateresult 01%
 			\else
-				\pgfplotstable at fgc@findintervalwitheps at updateresult 10
+				\pgfplotstable at fgc@findintervalwitheps at updateresult 10%
 			\fi
 		\fi
 	}%
-}
+}%
 
 % #1 : the value of \pgfplotstable at fgc@lastwasless for which the loop
 % shall break.
@@ -2947,7 +2954,7 @@
 	% use a side effect: columns are integers, they are stored as
 	% '\pgfp at tmp@<index>'. Thus, column names and array indices are
 	% essentially the same! That simplifies the operation and explains
-	% why we transposed the table. 
+	% why we transposed the table.
 	% We simply interprete the transposed table as array. We don't
 	% even need to copy anything.
 	\pgfplotsarrayresize{\pgfp at tmp}{\pgfplotstable at numrows}%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstableshared.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstableshared.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/numtable/pgfplotstableshared.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -17,12 +17,12 @@
 % 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/>.
 %
@@ -50,7 +50,7 @@
 %  5. foreach column, there is a list of row-values (a row-vector) in
 %  the \pgfplotslist format named
 %  		\csname\string<\namemacro>@<column name>\endcsname
-%   
+%
 
 \newif\ifpgfplotstable at search@header
 \newif\ifpgfplotstable at firstline@is at header
@@ -145,6 +145,7 @@
 	/pgfplots/table/z error minus expr/.initial=,
 	/pgfplots/table/ignore chars/.initial=,
 	/pgfplots/table/white space chars/.initial=,
+	/pgfplots/table/text special chars/.initial=,
 	/pgfplots/table/comment chars/.initial=,
 	/pgfplots/table/skip first n/.initial=0,
 	/pgfplots/table/trim cells/.is if=pgfplotstable at trimcells,
@@ -193,7 +194,7 @@
 
 \pgfkeys{
 	% #1: the argument which should have been assigned.
-	% #2: an error message. 
+	% #2: an error message.
 	/pgfplots/exception/non unique colname/.code 2 args={%
 		\ifx\pgfplotsexceptionmsg\relax
 			\pgfplots at error{#2}%
@@ -364,7 +365,7 @@
 }
 
 % Declares a new getcolmethod class #1.
-% The argument '#1' can then be used as argument for 
+% The argument '#1' can then be used as argument for
 % \pgfplotstable at getcol...\getcolmethod{#1}.
 %
 % #2: a set of keys which redefine the behavior.
@@ -439,7 +440,7 @@
 		%
 		% Ok, then check for special features.
 		%
-		% 1. 'create col/...' 
+		% 1. 'create col/...'
 		% 2. 'create on use'
 		% 3. 'alias'
 		%
@@ -499,7 +500,7 @@
 \def\pgfplotstablegetcolumnbyname at impl@nosuchalias#1\of#2\to#3{
 	\pgfplotstablegetcolumnbyname at impl@nosuchalias@{#1}\of{#2}\to{#3}\pgfplotstablegetcolumnbyname at impl@createonuseforbiddentext at disable
 }%
-	
+
 \def\pgfplotstablegetcolumnbyname at impl@nosuchalias@#1\of#2\to#3#4{%
 	\pgfplotsthrow{no such element}{#3}{Sorry, could not retrieve aliased column '\pgfkeysvalueof{/pgfplots/table/alias/#1}' from table '\pgfplotstablenameof{#2}'. The original request was for '#1', which does not exist either.#4{#1}}\pgfeov%
 }%
@@ -605,7 +606,7 @@
 \def\pgfplotstablegetname#1#2{%
 	\expandafter\let\expandafter#2\csname\string#1@@table at name\endcsname
 }
-	
+
 % expands to the table file name of table '#1'
 \def\pgfplotstablenameof#1{%
 	\csname\string#1@@table at name\endcsname
@@ -698,7 +699,7 @@
 % To show the problem, consider
 % \pgfplotstabletypeset[<options>]
 % 	\loadedtable
-% 
+%
 % and we want to set the catcodes *before* \loadedtable is seen.
 % Well, there is a newline character after ']'! If we change the
 % catcodes, this newline will be considered as character and will make
@@ -772,7 +773,7 @@
 }%
 
 
-% I don't know why; but I started with 
+% I don't know why; but I started with
 % >> \pgfplotstableread[]{file} to \macro
 % That ' to ' is really ugly. This here is for backwards
 % compatibility:
@@ -992,7 +993,7 @@
 					\openin\r at pgfplots@reada=\pgfplotstableread at filename\relax
 				\else
 					\pgfplots at warning{%
-						You requested to open table '\pgfplotstableread at filename', but there is also a '\pgfplotstableread at filename.tex'. 
+						You requested to open table '\pgfplotstableread at filename', but there is also a '\pgfplotstableread at filename.tex'.
 						TeX will automatically append the suffix '.tex', so I will now open '\pgfplotstableread at filename.tex'.
 						Please make sure you don't accidentally load TeX files - this may produce unrecoverable errors.}%
 					\closein\r at pgfplots@reada
@@ -1046,6 +1047,11 @@
 		\else
 			\pgfplotstableinstallignorechars@\pgfplotstable at loc@TMPa{10}%
 		\fi
+		\pgfkeysgetvalue{/pgfplots/table/text special chars}\pgfplotstable at loc@TMPa
+		\ifx\pgfplotstable at loc@TMPa\pgfutil at empty
+		\else
+			\pgfplotstableinstallignorechars@\pgfplotstable at loc@TMPa{12}%
+		\fi
 		\ifx\pgfplotstableuninstallignorechars\pgfutil at empty
 		\else
 			\expandafter\def\expandafter\pgfplotstableuninstallignorechars\expandafter{%
@@ -1054,7 +1060,7 @@
 			}%
 		\fi
 	\fi
-}%		
+}%
 \let\pgfplotstableuninstallignorechars\pgfutil at empty%
 % #1 macro containing the characters as comma-separated list
 % #2 the catcode to assign
@@ -1133,7 +1139,7 @@
 	\fi
 }%
 
-% Copies the table column list and the column vectors of #1 to global buffers. 
+% Copies the table column list and the column vectors of #1 to global buffers.
 % @see \pgfplotstable at copy@globalbuffers at to
 %
 % Use these two methods to avoid scoping problems.
@@ -1170,7 +1176,7 @@
 % @see \pgfplotstable at copy@to at globalbuffers
 %
 % @PRECONDITION the global buffers contain all members of a table.
-% 
+%
 % @POSTCONDITION The table '#1' is be initialised to these members.
 % 		Furthermore, \pgfplotsscanlinelength is set.
 \def\pgfplotstable at copy@globalbuffers at to#1{%
@@ -1222,7 +1228,7 @@
 \def\pgfplotstableread at loop@over at lines@frominline{%
 	\pgfutil at ifnextchar\pgfplotstable at EOI{%
 		\pgfutil at gobble
-	}{%	
+	}{%
 		\pgfplotstableread at loop@next
 	}%
 }%
@@ -1233,7 +1239,7 @@
 	\fi
 }%
 
-% PRECONDITION: 
+% PRECONDITION:
 % 	\pgfplotstable at LINE contains the current input line.
 \def\pgfplotstableread at loop@processnextline{%
 	\expandafter\pgfplotstableread at checkspecial@line\pgfplotstable at LINE\pgfplotstable at EOI
@@ -1252,7 +1258,7 @@
 		% \ifnum\pgfplotstableread at lineno=0
 		% 	\let\pgfplotstable at firstline=\pgfplotstable at LINE
 		% \fi
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 %\pgfplots at message{READING LINE \thepgfplotstableread at lineno: '\meaning\pgfplotstable at LINE'.}%
 		\pgfplotstableread at curline@contains at colnamesfalse
 		\ifnum\pgfplotstableread at numcols=0\relax
@@ -1331,21 +1337,17 @@
 		\pgfplotstableread at skiplinetrue
 	\else
 		\let\pgfplotstableread at tmpb=$%
+		\let\pgfplotstableread at tmpb=\pgfplotstable at EOI%
 		\ifx\pgfplotstableread at tmp\pgfplotstableread at tmpb
-			\let\pgfplotstableread at checkspecial@line@@=\pgfplotstableread at process@flags at line
+			\pgfplotstableread at skiplinetrue
+			\pgfplotsscanlinecomplete% the line is empty; same as \par!
 		\else
-			\let\pgfplotstableread at tmpb=\pgfplotstable at EOI%
+			\let\pgfplotstableread at tmpb=\par%
 			\ifx\pgfplotstableread at tmp\pgfplotstableread at tmpb
 				\pgfplotstableread at skiplinetrue
-				\pgfplotsscanlinecomplete% the line is empty; same as \par!
+				\pgfplotsscanlinecomplete% the line is empty;
 			\else
-				\let\pgfplotstableread at tmpb=\par%
-				\ifx\pgfplotstableread at tmp\pgfplotstableread at tmpb
-					\pgfplotstableread at skiplinetrue
-					\pgfplotsscanlinecomplete% the line is empty;
-				\else
-					\pgfplotstableread at checkspecial@line at default%
-				\fi
+				\pgfplotstableread at checkspecial@line at default%
 			\fi
 		\fi
 	\fi
@@ -1391,14 +1393,8 @@
 % 		}%
 % 	}%
 % }
-%-------------------------------------------------- 
+%--------------------------------------------------
 
-\long\def\pgfplotstableread at process@flags at line$flags {%
-%\pgfplots at message{Ignoring flags line ...}%
-	\pgfplotstableread at skiplinetrue
-	\pgfplotstableread at impl@gobble
-}
-
 \def\pgfplotstableread at create@column at lists{%
 	\pgfutil at loop
 	\ifnum\pgfplotstableread at curcol<\pgfplotstableread at numcols\relax
@@ -1422,7 +1418,7 @@
 
 \def\pgfplotstable at EOI{\pgfplotstable at EOI}%
 
-% A loop command which processes every single entry in a raw data row #2 
+% A loop command which processes every single entry in a raw data row #2
 % and invokes the macro #1{<arg>}  for each found column entry.
 %
 % Columns are separated by the /pgfplots/table/col sep character.
@@ -1596,7 +1592,7 @@
 % \def\thisrow#1{\pgfplotstable at thisrow@impl{#1}{macroprefix@}{\pgfplotstable at thisrow@impl@}}
 %
 % Then, \thisrow{existingcol}
-% will expand to 
+% will expand to
 % -> \pgfplotstable at thisrow@impl@{\csname macroprefix at existingcol\endcsname}
 % -> \csname macroprefix at existingcol\endcsname
 %
@@ -1649,7 +1645,7 @@
 % 	\pgfplotstablereadevalptr{\ptr}{\content}%
 % 	-> do something with \content!
 % }
-% 	
+%
 % \pgfplotstableread{<file>} to listener<\macro>
 %
 % -> will evaluate \macro foreach row.
@@ -1874,7 +1870,7 @@
 }%
 
 \def\pgfplotstabletypeset{%
-	\pgfutil at ifnextchar[{%	
+	\pgfutil at ifnextchar[{%
 		\pgfplotstabletypeset at opt
 	}{%
 		\pgfplotstabletypeset at opt[]%
@@ -1956,7 +1952,7 @@
 	\let\pgfplotstablerow=\relax
 }%
 % helper method to allow nesting. It copies \pgfplotstablerow.
-% #1: the expanded value of \pgfplotstablerow. 
+% #1: the expanded value of \pgfplotstablerow.
 \long\def\pgfplotstableforeachcolumnelement@#1#2{%
 	#2\relax
 	\def\pgfplotstablerow{#1}% restore to old value.

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_loader.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -131,6 +131,38 @@
 }{%
 }%
 
+\pgfutil at IfUndefined{pgfutilifcontainsmacro}{%
+	\gdef\pgfplots at glob@TMPa{1}%
+}{%
+	\gdef\pgfplots at glob@TMPa{0}%
+}%
+\if1\pgfplots at glob@TMPa
+	\begingroup
+	\catcode`\|=0
+	\catcode`\\=12
+	|gdef|pgfutil at backslash@as at other{\}%
+	|endgroup
+	\def\pgfutil at command@to at string#1#2{%
+		\expandafter\pgfutil at command@to at string@@\meaning#1\pgfutil at EOI{#2}%
+	}%
+	\xdef\pgfutil at glob@TMPa{\meaning\pgfutil at empty}%
+	\expandafter\def\expandafter\pgfutil at command@to at string@@\pgfutil at glob@TMPa#1\pgfutil at EOI#2{%
+		\def#2{#1}%
+	}%
+	\def\pgfutilifcontainsmacro#1#2#3{%
+		\def\pgf at marshal{#1}%
+		\pgfutil at command@to at string\pgf at marshal\pgf at marshal
+		\edef\pgf at marshal{\noexpand\pgfutil at in@{\pgfutil at backslash@as at other}{\pgf at marshal}}%
+		\pgf at marshal
+		\ifpgfutil at in@
+			\def\pgf at marshal{#2}%
+		\else
+			\def\pgf at marshal{#3}%
+		\fi
+		\pgf at marshal
+	}%
+\fi
+
 \pgfutil at IfUndefined{pgfapplistnewempty}{%
 	\immediate\write16{Package pgfplots: loading complementary utilities for your pgf version...}
 	\csname newtoks\endcsname\t at pgf@toka
@@ -148,6 +180,19 @@
 	}%
 }{}%
 
+\def\pgfmathfloat at install@unimplemented at broken#1{%
+	\expandafter\pgfmathfloat at prepareuninstallcmd\csname pgfmath@#1@\endcsname%
+	\expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat at notimplemented{#1}}%
+}
+
+\ifx\pgfmathfloat at install@unimplemented\pgfmathfloat at install@unimplemented at broken
+	\def\pgfmathfloat at install@unimplemented#1{%
+		\expandafter\pgfmathfloat at prepareuninstallcmd\csname pgfmath#1@\endcsname%
+		\expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat at notimplemented{#1}}%
+	}%
+\fi
+
+
 \ifpgfplots at LUA@supported
 	\def\PATCH at pgfmath@local at function@body#1;{%
 		\def\pgfmath at local@body{#1}%
@@ -196,12 +241,21 @@
 		}{%
 			% hm. PGF 2.10 ?
 			%
-			% FIXME 
+			% FIXME
 			%\pgfplots at LUA@supportedfalse
 		}%
 		%
+		\gdef\pgfplots at glob@TMPa{1}% "is up to date = 1"
 		\def\pgfplots at glob@TMPa{3.0.1}%
 		\ifx\pgfversion\pgfplots at glob@TMPa
+			\gdef\pgfplots at glob@TMPa{0}% "is up to date = 0"
+		\else
+			\def\pgfplots at glob@TMPa{3.0.1a}%
+			\ifx\pgfversion\pgfplots at glob@TMPa
+				\gdef\pgfplots at glob@TMPa{0}% "is up to date = 0"
+			\fi
+		\fi
+		\if0\pgfplots at glob@TMPa
 			% 3.0.1 does not have the (correct) luamath library.
 			\pgfutil at directlua{%
 		      package.loaded["pgf.luamath.functions"]=nil;
@@ -237,18 +291,18 @@
   \else%
     \pgfutil at read\pgfutil at inputcheck to\pgf at temp% ignored
     \pgfutil at read\pgfutil at inputcheck to\pgf at plot@line%
-	\closein\pgfutil at inputcheck
+    \closein\pgfutil at inputcheck
     \edef\pgf at plot@code{#2\space}%
     \ifx\pgf at plot@code\pgf at plot@line%
       \openin\pgfutil at inputcheck=\pgfretval\relax
       \ifeof\pgfutil at inputcheck%
       \else%
-	    \closein\pgfutil at inputcheck
+        \closein\pgfutil at inputcheck
         \pgf at resample@plotfalse%
       \fi%
     \fi%
   \fi
-  \ifpgf at resample@plot%  
+  \ifpgf at resample@plot%
     \immediate\openout\pgf at plotwrite=\pgf at plotgnuplotfile\relax
     \immediate\pgfutil at write\pgf at plotwrite{\pgf at gnuplot@head}%
     \immediate\pgfutil at write\pgf at plotwrite{#2}%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_misc.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -15,7 +15,7 @@
 %%% Typically, these modifications have been done by the pgfplots team
 %%% as contribution to PGf/TIKZ
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -69,7 +69,7 @@
 \def\pgfutil at insertatbegincurrentpagefrombox@FIXED#1{%
   \edef\pgf at temp{\the\wd\pgfutil at abb}%
   \global\setbox\pgfutil at abb\hbox{%
-  	\unhbox\pgfutil at abb 
+  	\unhbox\pgfutil at abb
 	%
 	% the order in which \pgfutil at insertatbegincurrentpagefrombox
 	% matters unless we make the following -shift!
@@ -156,7 +156,7 @@
 % Solves a linear equation system of size 2x2 using gauss elimination.
 %
 % It employs TeX register arithmetics to do so.
-% #1: should contain 4 sets of braces with matrix entries, 
+% #1: should contain 4 sets of braces with matrix entries,
 % 	{<a11>}{<a12>}
 % 	{<a21>}{<a22>}
 % 	where each entry should be a number without unit.
@@ -207,7 +207,7 @@
 			{\csname m\Pa a\endcsname}%
 		\let\pivot=\pgfmathresult
 		%
-		% \factor := 1/aa * ba 
+		% \factor := 1/aa * ba
 		\csname \Pb a\endcsname=\pivot\csname \Pb a\endcsname
 		\edef\factor{\expandafter\pgf at sys@tonumber\csname \Pb a\endcsname}%
 		%
@@ -431,8 +431,8 @@
     \global\setbox\tikz at tempbox=\copy\tikz at figbox%
     %\global\let\tikz at after@path at smuggle=\tikz at after@path
   \endgroup%
-  \setbox\tikz at figbox=\box\tikz at tempbox%  
-  \tikz at make@last at position{\tikz@@@temp}%  
+  \setbox\tikz at figbox=\box\tikz at tempbox%
+  \tikz at make@last at position{\tikz@@@temp}%
   %\expandafter\tikz at scan@next at command\tikz at after@path at smuggle%
   \tikz at scan@next at command%
 }
@@ -598,8 +598,8 @@
 \def\pgfpatharctoprecomputed#1#2#3#4#5#6#7#8{%
 	\begingroup
 	% Implementation idea:
-	% 
-	% let 
+	%
+	% let
 	%   m = center (#1)
 	%   \gamma_0 = start angle
 	%   \gamma_1 = end angle
@@ -609,7 +609,7 @@
 	% an axis parallel ellipse is parameterized by
 	% C(\gamma) = m + ( a cos(\gamma), b sin(\gamma) ), \gamma in [0,360].
 	%
-	% Now, consider the segment \gamma(t), 
+	% Now, consider the segment \gamma(t),
 	%   \gamma:[0,1] -> [\gamma_0,\gamma_1],
 	%            t   ->  \gamma_0 + t(\gamma_1 - \gamma_0)
 	% and
@@ -625,19 +625,19 @@
 	% For n=3 and given P_0 and P_3, I can directly compute P_1 and P_2 once I know
 	% the derivatives at t=0 and t=1.
 	%
-	% The derivatives in our case are 
-	%   ( C \circ \gamma )'(t) = C'[\gamma(t)] * \gamma'(t) 
+	% The derivatives in our case are
+	%   ( C \circ \gamma )'(t) = C'[\gamma(t)] * \gamma'(t)
 	%   	= ( -a pi/180 sin(\gamma(t)),  b pi/180 cos(\gamma(t)) ) * (\gamma_1 - \gamma_0).
 	% The pi/180 comes into play since we are working with degrees.
 	%
 	% Expression (C\circ\gamma)'(0) using P_0 and (C \circ \gamma)'(1)
 	% using P_3 yields the expressions
-	%   (C \circ \gamma)'(0) = 
+	%   (C \circ \gamma)'(0) =
 	%   	pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_0^y - my), b/a (P_0^x - mx) ]
-	%   (C \circ \gamma)'(1) = 
+	%   (C \circ \gamma)'(1) =
 	%   	pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_3^y - my), b/a (P_3^x - mx) ]
 	%
-	% defining 
+	% defining
 	%  scaleA = a/b * pi / (3*180) * (\gamma_1 - \gamma_0)
 	% and
 	%  scaleB = b/a * pi / (3*180) * (\gamma_1 - \gamma_0)
@@ -771,7 +771,7 @@
 		\let\pgfmath at sign=\pgfmath at empty%
 		\ifdim0pt=\pgfmath at y%
 			\pgfmath at error{You've asked me to divide `#1' by `#2', %
-				but I cannot divide any number by `#2'}%				
+				but I cannot divide any number by `#2'}%
 		\fi%
 		\afterassignment\pgfmath at xa%
 		\c at pgfmath@counta\the\pgfmath at y\relax%
@@ -798,7 +798,7 @@
 			\fi%
 		\fi%
 		\pgfmath at returnone\pgfmath at x%
-	\endgroup%	
+	\endgroup%
 }
 \def\pgfmath at small@number{0.00002}
 \def\pgfmathdivide@@{%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreimage.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreimage.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfcoreimage.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -47,7 +47,7 @@
 %
 % This command declares an image file for later use. Even if the image
 % is used several times in the document, in PDF it will only be stored
-% once. 
+% once.
 %
 % Example:
 %
@@ -66,7 +66,7 @@
   \ifx\pgf at filename\pgfutil at empty%
     \expandafter\pgf at findfile\pgfsys at imagesuffixlist:+{#3}%
   \else%
-    \pgfkeys{/pgf/images/page=}% make page empty     
+    \pgfkeys{/pgf/images/page=}% make page empty
   \fi%
   \ifx\pgf at filename\pgfutil at empty%
     \PackageWarning{pgf}%
@@ -127,7 +127,7 @@
   \ifx\pgf at imageheight\pgfutil at empty%
     \PackageWarning{pgf}{Missing height for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}%
     \edef\pgf at imageheight{1cm}%
-  \fi%  
+  \fi%
   \ifx\pgf at imagepage\pgfutil at empty\else\edef\pgf at imagepagetext{ page \pgf at imagepage}\fi%
   \edef\pgf at image{%
     \hbox to \pgf at imagewidth{%
@@ -145,7 +145,7 @@
 % Declare a soft mask
 %
 % #1 = optional argument: matte specification. default matte is
-%      white. 
+%      white.
 % #2 = name of the mask for later use
 % #3 = filename without extension, automatic extensions are .pdf,
 %      .jpg, and .png for PDF. Postscript is not supported.
@@ -199,7 +199,7 @@
   \expandafter\global\expandafter\let\csname pgf at image@#1!\endcsname=\pgf at temp%
   }
 
-  
+
 % Use an image
 %
 % #1 = name of a previously declared image
@@ -292,7 +292,7 @@
 %
 % Things change when you run tex on your file with the \jobname set to
 % the name of a decalred graphics name. In this case, only your
-% graphic will be typeset, the rest of the document will be "thrown away". 
+% graphic will be typeset, the rest of the document will be "thrown away".
 % To be more precise, everything is gobbled up to the beginning
 % of the first \beginpgfexternal with the given graphics name. Then,
 % the content of the "environment" is put in a box (this "environment"
@@ -320,7 +320,7 @@
 %
 % This command is used to tell pgf that the file named #1 should be
 % typeset normally. If \jobname is not equal to #1, only
-% the graphic called \jobname will be typeset. 
+% the graphic called \jobname will be typeset.
 %
 % Example:
 %
@@ -359,7 +359,7 @@
 	\let\pgfexternal at nofiles@=\relax
 	\def\relax{\relax}%
 	%
-	% suppress generation of LaTeX .aux, .toc etc files. 
+	% suppress generation of LaTeX .aux, .toc etc files.
 	% generation of these files is not thread-safe.
 	% the \csname \endcsname yields \relax if \nofiles doesn't exist.
 	\csname nofiles\endcsname
@@ -412,7 +412,7 @@
 
 
 \AtBeginDocument{
-  \let\beginpgfgraphicnamed=\pgf at externalbegin% overwrite definition of pgfexternal.tex if necessary   
+  \let\beginpgfgraphicnamed=\pgf at externalbegin% overwrite definition of pgfexternal.tex if necessary
   \let\endpgfgraphicnamed=\unskip
 }
 
@@ -428,7 +428,7 @@
   \else%
     \let\pgf at next=\pgf at replacepicturebygraphic%
   \fi%
-  \pgf at next%  
+  \pgf at next%
 }
 
 \long\def\pgf at replacepicturebygraphic#1\endpgfgraphicnamed{%
@@ -494,7 +494,7 @@
 				% are properly expanded to `#'.
 				\immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }%
 				}%
-			\fi				
+			\fi
 		}%
 	\else
 		\def\pgfincludeexternalgraphics at dp{#1#2}%
@@ -509,7 +509,7 @@
 %   this method is also invoked from within the tikz external library.
 \def\pgf at external@grab#1{%
   \def\pgf at filename{#1}%
-  \ifpgfexternal at allow@aux	
+  \ifpgfexternal at allow@aux
   	\begingroup
 	\pgf at external@init at aux@in at dpth
   \fi
@@ -582,4 +582,3 @@
 
 
 \endinput
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -54,13 +54,13 @@
 		\ifpgfmathfloatparseactive
 		\else
 			\pgfutil at ifundefined{pgfmathdeclarefunction}{%
-				% Ohoh - we are running on a TeX distribution with 
+				% Ohoh - we are running on a TeX distribution with
 				% PGF 2.00 which doesn't have the new math engine.
 				% I can provide special treatment here, provided that
 				% all float commands are still able to run (that means
 				% more information needs to be copied from the pgf cvs
 				% to pgf 2.00 - for example pgfmathfloat.code.tex).
-				% 
+				%
 				% I employ this to work with pgfplots and pgf 2.00
 				% using all new features.
 				\pgfmathfloat at parser@install at pgf@two at null@null%
@@ -90,7 +90,7 @@
 			\pgfmathfloatparsenumber{#1}%
 		\fi
 		\let\pgfmathfloatscale=\pgfmathresult%
-	},%		
+	},%
 	% determines the output format of each complete expression parsing
 	% process. If 'scale results' is active, 'fixed' is assumed
 	% automatically.
@@ -217,7 +217,7 @@
 	\pgfmathfloat at marshal%
 }
 
-% 
+%
 \def\pgfmathfloat at parser@install at functions{%
 	% Install float commands...
 	%
@@ -334,7 +334,7 @@
 
 % This here might bring speed improvements... if implemented
 % correctly.
-% However, this heuristics might fail in cases like "1+1" vs "1e+1" ... 
+% However, this heuristics might fail in cases like "1+1" vs "1e+1" ...
 %\def\pgfmathfloat at parse@trynumber at token{numericfpu}
 %\pgfmath at tokens@make{numericfpu}{eE+-Y.0123456789}
 
@@ -350,7 +350,7 @@
 		\noexpand\def\expandafter\noexpand\csname pgfmath at parsefunction@#1\endcsname{%
 			\noexpand\let\noexpand\pgfmath at parsepostgroup\expandafter\noexpand\csname pgfmath at parsefunction@#1@\endcsname%
 			\noexpand\expandafter\noexpand\pgfmath at parse@}%
-		\noexpand\def\expandafter\noexpand\csname pgfmath at parsefunction@#1@\endcsname{%	
+		\noexpand\def\expandafter\noexpand\csname pgfmath at parsefunction@#1@\endcsname{%
 			\noexpand\expandafter\expandafter\noexpand\csname pgfmath#1@\endcsname\noexpand\expandafter{\noexpand\pgfmathresult}%
 			\noexpand\pgfmath at postfunction%
 		}%
@@ -617,7 +617,7 @@
 	\expandafter\pgfmathfloatparsenumber\expandafter{\pgfmathresult}%
 }
 % Compares #1 with #2 and sets \pgfmathresult either to 1.0 or 0.0.
-% 
+%
 % It also sets the boolean \ifpgfmathfloatcomparison (globally).
 \def\pgfmathfloatlessthan@#1#2{%
 %\def\pgfmathfloatlessthan#1#2#3\and#4#5#6{%
@@ -686,7 +686,7 @@
 \let\pgfmathfloatlessthan=\pgfmathfloatlessthan@
 \let\pgfmathfloatless@=\pgfmathfloatlessthan@
 
-% ! (#1 < #2)  <=>  (#1 >= #2) 
+% ! (#1 < #2)  <=>  (#1 >= #2)
 \def\pgfmathfloatnotless@#1#2{%
 	\pgfmathfloatless@{#1}{#2}%
 	\ifpgfmathfloatcomparison
@@ -695,7 +695,7 @@
 		\def\pgfmathresult{1.0}%
 	\fi
 }%
-% ! (#1 > #2)  <=>  (#1 <= #2) 
+% ! (#1 > #2)  <=>  (#1 <= #2)
 \def\pgfmathfloatnotgreater@#1#2{%
 	\pgfmathfloatless@{#2}{#1}%
 	\ifpgfmathfloatcomparison
@@ -806,7 +806,7 @@
 % Renormalizes #1 to extended precision mantisse, meaning
 % 100 <= m < 1000
 % instead of 1 <= m < 10.
-% 
+%
 % The 'extended precision' means we have higher accuracy when we apply pgfmath operations to mantissas.
 %
 % The input argument is expected to be a normalized floating point number; the output argument is a non-normalized floating point number (well, normalized to extended precision).
@@ -842,7 +842,7 @@
 % Sets extended precision to 10^#1.
 %
 % The different choices are
-% 
+%
 % - 0:  normalization      0 <= m < 1 (disable extended precision)
 % - 1:  normalization     10 <= m < 100
 % - 2:  normalization    100 <= m < 1000  (default)
@@ -873,7 +873,7 @@
 %
 % INPUT:
 % #1  normalized floating point number. Maybe a macro (it will be expanded ONCE)
-% 
+%
 % OUTPUT:
 % - \pgfmathresult : the mantisse in extended precision
 % - \pgfmathfloat at a@S : the sign of #1
@@ -1051,7 +1051,7 @@
 % #1=mantisse which needs to be shifted (with smaller exponent)
 % #2=smaller exponent
 % #3=larger exponent
-% 
+%
 % ATTENTION: this helper method DESTROYS contents of \pgfmathfloat at a@S.
 \def\pgfmathfloatadd at shift#1#2#3{%
 	\pgf at xa=#1 pt%
@@ -1113,7 +1113,7 @@
 \let\pgfmathfloatsubtract=\pgfmathfloatsubtract@
 
 % Scales a floating point number #1 with a fixed point number #2 using pgfmathmultiply.
-% 
+%
 % Use this method if #2 is small number.
 \def\pgfmathfloatmultiplyfixed@#1#2{%
 	\begingroup
@@ -1408,14 +1408,14 @@
 
 % Returns the integer part of the floating point number #1.
 %
-% The result is returned as floating point as well. 
+% The result is returned as floating point as well.
 %
 % This operation is not limited to TeX's range of count registers (it
 % works symbolly)
 %
 % @see \pgfmathfloattoint
-% POSTCONDITION: \pgfmathresult contains the result and 
-%	\pgfmathfloatintwasnoop=1 if there was nothing to do 
+% POSTCONDITION: \pgfmathresult contains the result and
+%	\pgfmathfloatintwasnoop=1 if there was nothing to do
 %   \pgfmathfloatintwasnoop=0 if there where non-zero digits after the period
 %   \pgfmathfloatintwasnoop=2 if there where digits after the period. The digits will be stored in \pgfmathfloatintremainder in this case.
 \def\pgfmathfloatint@#1{%
@@ -1603,7 +1603,7 @@
 		% +infty:.
 		\pgfmathfloatcreate{1}{1.0}{0}%
 	\or
-		% -infty: 
+		% -infty:
 		\pgfmathfloatcreate{2}{1.0}{0}%
 	\fi
 	\pgfmath at smuggleone\pgfmathresult
@@ -1756,7 +1756,7 @@
 
 \def\pgfmathfloatatan@#1{%
 	\begingroup
-	\expandafter\ifx\csname pgfmathfloatatan at TMP\endcsname\relax% 
+	\expandafter\ifx\csname pgfmathfloatatan at TMP\endcsname\relax%
 		\pgfmathfloatcreate{1}{1.6}{4}%
 		\global\let\pgfmathfloatatan at TMP=\pgfmathresult
 		\pgfmathfloatcreate{2}{1.6}{4}%
@@ -1802,7 +1802,7 @@
 	\fi
 	%
 	\ifnum\pgfmathfloat at a@E<-3 %
-		\ifnum\pgfmathfloat at b@S=2 % 
+		\ifnum\pgfmathfloat at b@S=2 %
 			% #2 < 0
 			\pgfmathfloatcreate{1}{1.8}{2}% +180
 		\else
@@ -1846,7 +1846,7 @@
 		\pgfmathfloat at scale@deg at to@rad\pgfmathresult
 	\fi
     \pgfmath at smuggleone\pgfmathresult%
-  \endgroup%    
+  \endgroup%
 }%
 \let\pgfmathfloatatantwo@=\pgfmathfloatatantwo
 \expandafter\let\csname pgfmathfloatatan2\endcsname=\pgfmathfloatatantwo
@@ -1911,7 +1911,7 @@
 %
 % This allows numbers such at 10000000 or 5.23e-10 to be represented
 % properly, although TeX-registers would produce overflow/underflow
-% errors in these cases. 
+% errors in these cases.
 %
 % The natural logarithm is computed using log(X*10^Y) = log(X) + log(10)*Y
 %
@@ -1947,7 +1947,7 @@
 
 % Computes exp(#1) in floating point.
 %
-% The algorithm employs the identity 
+% The algorithm employs the identity
 %  exp(x) = exp(x - log(10^k) + log(10^k)
 %         = 10^k exp( x - k*log 10 )
 % with k choosen such that exp( x - k*log10) can be computed with the
@@ -2114,12 +2114,12 @@
 	\else
 		\pgfmathfloatgetflags{#1}\c at pgfmath@counta
 		\ifnum0=\c at pgfmath@counta
-			% ah: 0^x 
+			% ah: 0^x
 			\pgfmathfloatgetflags{#2}\c at pgfmath@counta
 			\ifnum0=\c at pgfmath@counta
 				% ah: 0^0
 				\pgfmathfloatcreate{1}{1.0}{0}%
-			\else	
+			\else
 				% ah: 0^x with x!=0:
 				\pgfmathfloatcreate{0}{0.0}{0}%
 			\fi
@@ -2179,7 +2179,7 @@
 \pgfmathfloat at definemethodfrombasic@NOARG{rnd}
 \pgfmathfloat at definemethodfrombasic@NOARG{false}
 \pgfmathfloat at definemethodfrombasic@NOARG{true}
-% arcsin, arccos 
+% arcsin, arccos
 \pgfmathfloat at definemethodfrombasic@ONEARG{asin}
 \pgfmathfloat at definemethodfrombasic@ONEARG{acos}
 \pgfmathfloat at definemethodfrombasic@ONEARG{not}

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -76,7 +76,7 @@
 % Example: \pgfintersectiongetsolutionsegmentindices{0}{\first}{\second}
 %
 % -> \first may be 0 if point #0 is in the 0'th segment
-% -> \second may be 42 if point #0 is in the 42'th segment 
+% -> \second may be 42 if point #0 is in the 42'th segment
 %
 % The "segment index" is actually close to the "time" of the solution.
 % If a solution is at "time" 42.2, it will have segment index 42.
@@ -132,7 +132,7 @@
 			\def\pgf at temp##1##2##3##4{%
 				\edef#2{##3}%
 				\edef#3{##4}%
-				% 
+				%
 				% check for fallback to segment indices:
 				\ifx#2\pgfutil at empty \edef#2{##1}\fi
 				\ifx#3\pgfutil at empty \edef#3{##2}\fi
@@ -161,7 +161,7 @@
 \long\def\pgfintersectionofpaths#1#2{%
 	\begingroup%
 		\pgfinterruptpath%
-		#1% 
+		#1%
 		\pgfgetpath\pgf at intersect@path at a%
 		\global\let\pgf at intersect@path at temp=\pgf at intersect@path at a%
 		\endpgfinterruptpath%
@@ -170,7 +170,7 @@
 	%
 	\begingroup%
 		\pgfinterruptpath%
-		#2% 
+		#2%
 		\pgfgetpath\pgf at intersect@path at b%
 		\global\let\pgf at intersect@path at temp=\pgf at intersect@path at b%
 		\endpgfinterruptpath%
@@ -220,9 +220,9 @@
 	%
 	% However, \pgf at intersect@time at offset and
 	% \pgf at intersect@time at offset@b are *always* valid. In fact,they
-	% resemble a part of the time: it holds 
+	% resemble a part of the time: it holds
 	%   0 <= \pgf at intersect@time at a < 1
-	% and \pgf at intersect@time at offset > 0. 
+	% and \pgf at intersect@time at offset > 0.
 	%
 	% If we have an intersection in segment 42 of path A,
 	% \pgf at intersect@time at offset will be 42. The time inside of that
@@ -402,7 +402,7 @@
 				\pgf at marshal%
 				\pgfmathdivide@{\pgfmathresult}{\pgf at intersect@length at a}%
 				\pgf at x=\pgfmathresult pt\relax%
-				\advance\pgf at x by\pgf at intersect@time at offset pt\relax%		
+				\advance\pgf at x by\pgf at intersect@time at offset pt\relax%
 				\edef\pgf at intersect@time at a{\pgfmath at tonumber{\pgf at x}}%
 				\expandafter\global\expandafter\let\csname pgf at g@intersect at solution@\the\pgf at intersect@solutions @time at a\endcsname=
 					\pgf at intersect@time at a
@@ -413,7 +413,7 @@
 			\pgf at intersection@store at properties{pgfpoint at g@intersect at solution@\the\pgf at intersect@solutions}%
 		}%
 		%
-	}{}%		
+	}{}%
 }
 
 % Test if two lines L1 and L2 intersect.
@@ -435,16 +435,16 @@
 %
 % t = |x4-x3  x3-x1| / |x4-x3  x2-x1|
 %     |y4-y3  y3-y1|   |y4-y3  y2-y1|
-% 
+%
 % with 0<=s,t<=1
-%		
+%
 % s and t do not need to be calculated:
 %
 % Let s = A / C and t = B / C
-% 
+%
 % Then 0<=s<=1 if !(C=0) && ((A=0) || ((A>0) && !(C<A)) || ((A<0) && !(C>A)))
 %      0<=t<=1 if !(C=0) && ((B=0) || ((B>0) && !(C<B)) || ((B<0) && !(C>B)))
-% 
+%
 \newif\ifpgf at s
 \newif\ifpgf at t
 \def\pgfiflinesintersect#1#2#3#4{%
@@ -479,7 +479,7 @@
 	%
 	% Normalise a little. 16384 may not be a robust choice.
 	%
-	\c at pgf@counta=\pgf at xa\divide\c at pgf@counta by16384\relax% 
+	\c at pgf@counta=\pgf at xa\divide\c at pgf@counta by16384\relax%
 	\c at pgf@countb=\pgf at xb\divide\c at pgf@countb by16384\relax%
 	\c at pgf@countc=\pgf at ya\divide\c at pgf@countc by16384\relax%
 	\c at pgf@countd=\pgf at yb\divide\c at pgf@countd by16384\relax%
@@ -606,12 +606,12 @@
 
 
 % Find the intersections of two bezier curves.
-% 
+%
 % #1 - #4 = curve 1.
 % #5 - #8 = curve 2.
 % #9      = the solution number.
 %
-% There is no guarantee of ordering of solutions. If there are 
+% There is no guarantee of ordering of solutions. If there are
 % no solutions, the origin is returned.
 %
 \def\pgfpointintersectionofcurves#1#2#3#4#5#6#7#8#9{%
@@ -625,7 +625,7 @@
 % Return any intersection points of two curves C1 and C2.
 % No order can be guaranteed for the solutions.
 %
-% #1, #2, #3, #4 - the points on C1 
+% #1, #2, #3, #4 - the points on C1
 % #5, #6, #7, #8 - the points on C2
 %
 % Returns:
@@ -639,7 +639,7 @@
 %		S = {};
 %	  intersection'(C1,C2);
 %		return S;
-%		
+%
 %	intersection'(C1,C2)
 %		B1 = boundingbox(C1);
 %		B2 = boundingbox(C2);
@@ -686,7 +686,7 @@
 	% (\pgf at xa, \pgf at ya) is lower-left
 	% (\pgf at xb, \pgf at yb) is upper-right
 	\edef\pgf at intersect@boundingbox at b{%
-		\noexpand\pgf at x=\the\pgf at xa% 
+		\noexpand\pgf at x=\the\pgf at xa%
 		\noexpand\pgf at y=\the\pgf at ya%
 		\noexpand\pgf at xa=\the\pgf at xb%
 		\noexpand\pgf at ya=\the\pgf at yb%
@@ -701,7 +701,7 @@
 		\noexpand\pgf at yb=\the\pgf at ya%
 		\noexpand\pgf at xc=\the\pgf at xb%
 		\noexpand\pgf at yc=\the\pgf at yb%
-	}%	
+	}%
 	\pgf at intersect@boundingbox at a%
 	\pgf at intersect@boundingbox at b%
 	% check if the two bounding boxes overlap:
@@ -761,8 +761,8 @@
 												\pgf at intersect@solution at candidate%
 										\ifpgf at intersect@sort%
 											\expandafter\xdef%
-											\csname pgf at g@intersect at solution@\the\pgf at intersect@solutions @time at a\endcsname%	
-												{\pgf at intersect@time at a}%						
+											\csname pgf at g@intersect at solution@\the\pgf at intersect@solutions @time at a\endcsname%
+												{\pgf at intersect@time at a}%
 										\fi%
 										\endgroup
 									}%
@@ -855,7 +855,7 @@
 
 \def\pgf at curve@subdivide at left#1#2#3#4{%
 	%
-	% The left curve (from t=0 to t=.5) 
+	% The left curve (from t=0 to t=.5)
 	%
 	\begingroup
 	#1\relax%
@@ -898,7 +898,7 @@
 
 \def\pgf at curve@subdivide at right#1#2#3#4{%
 	%
-	% The right curve (from t=0.5 to t=1) 
+	% The right curve (from t=0.5 to t=1)
 	%
 	\begingroup
 	#1\relax%
@@ -942,7 +942,7 @@
 
 
 % A solution S1 is considered a duplicate of S2, if
-% 
+%
 % |x1 - x2|f < q and |y1 - y2|f < q
 %
 % where q is a small value (tolerance).
@@ -956,7 +956,7 @@
 	\let\pgf at intersect@next=\pgfutil at secondoftwo%
 	\pgfmathloop%
 		\ifnum\pgfmathcounter>\pgf at intersect@solutions\relax%
-		\else%			
+		\else%
 			\pgf at ifsolution@duplicate@{\pgfmathcounter}%
 	\repeatpgfmathloop%
 	\pgf at intersect@next%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,17 +9,17 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Date of this copy: Mi 6. Jan 09:15:30 CET 2016 %%%
+%%% Date of this copy: Mi 8. Feb 20:49:06 CET 2017 %%%
 
 
 
@@ -132,11 +132,32 @@
 \let\pgfmathnotifynewdeclarefunction at orig=\pgfmathnotifynewdeclarefunction
 \def\pgfmathnotifynewdeclarefunction#1#2#3{%
 	\pgfmathnotifynewdeclarefunction at orig{#1}{#2}{#3}%
-	\directlua{pgfluamathparser.pushLocalExpressionFunction(%
-		"\pgfutil at luaescapestring{#1}",%
-		#2,%
-		"\pgfutil at luaescapestring{#3}")}%
 	%
+	% we have to check if '#3' contains control sequences.
+	% this is highly tricky as it may contain '#1'...
+	\begingroup
+		\toks0={#3}%
+		\xdef\pgf at marshal@glob{\the\toks0 }%
+	\endgroup
+	\pgfutil at command@to at string\pgf at marshal@glob\pgf at marshal
+	\expandafter\pgfutilifcontainsmacro\expandafter{\pgf at marshal}{%
+		\def\pgf at temp{1}%
+	}{%
+		\def\pgf at temp{0}%
+	}%
+	\if1\pgf at temp
+		% let lua produce an error when evaluating this function -- we cannot possibly expand the macro to its current state:
+		\directlua{pgfluamathparser.pushLocalExpressionFunction(%
+			"\pgfutil at luaescapestring{#1}",%
+			#2,%
+			"functionMustBeEvaluatedInTeX")}%
+	\else
+		\directlua{pgfluamathparser.pushLocalExpressionFunction(%
+			"\pgfutil at luaescapestring{#1}",%
+			#2,%
+			"\pgfutil at luaescapestring{#3}")}%
+	\fi
+	%
 	% ensure that the local function is removed at the end of the
 	% scope. To this end, we maintain a stack on the LUA side.
 	\aftergroup\pgfluamathparse at pop@local at function
@@ -172,7 +193,7 @@
 %   LUA (defined only in TeX)
 % - some special cases which simply haven't been added to the LUA
 %   parser (yet).
-%   At the time of this writing, this includes 
+%   At the time of this writing, this includes
 % -- arrays created via '{}' and indexed with '[]'
 % -- strings with "<str>"
 % -- 'scalar' function
@@ -209,7 +230,7 @@
   \ifpgfluamathparseractive
     \let\pgfmathparse\pgfluamath at pgfmathparse
     \pgfluamathparseractivefalse
-  \fi}    
+  \fi}
 
 \pgfqkeys{/pgf}{%
   % Enable lua-side computation of \pgfmathresult
@@ -503,7 +524,7 @@
 %   LUA (defined only in TeX)
 % - some special cases which simply haven't been added to the LUA
 %   parser (yet).
-%   At the time of this writing, this includes 
+%   At the time of this writing, this includes
 % -- arrays created via '{}' and indexed with '[]'
 % -- strings with "<str>"
 % -- 'scalar' function
@@ -522,8 +543,8 @@
 \def\pgfluamathparse#1{%
   \pgfluamathusedTeXfallbackfalse
   \pgfutil at directlua{pgfluamathparser.texCallParser(
-  	"\pgfutil at luaescapestring{#1}",
-	\pgfluamath at outputformat@choice, 
+	"\pgfutil at luaescapestring{#1}",
+	\pgfluamath at outputformat@choice,
 	\ifpgfluamathshowerrormessage true\else false\fi)%
   }%
   \ifx\pgfmathresult\pgfutil at empty

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -29,7 +29,7 @@
 %
 % 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/2008/2009 by Christian Feuersänger.
@@ -38,12 +38,12 @@
 % 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/>.
 %
@@ -56,7 +56,7 @@
 % right place.
 %
 % ATTENTION:
-% this is NOT a sophisticated syntax highlighter like lstlistings! 
+% this is NOT a sophisticated syntax highlighter like lstlistings!
 % It has rather strict assumptions about how to use it (the input must
 % have been read verbatim, for example).
 
@@ -96,7 +96,7 @@
 	% For example:
 	%    /codeexample/prettyprint/key value/my key/.code 2 args={name=#1, value =#2}
 	% If such a key exists, it will be invoked with {#1}{#2} as
-	% arguments. Otherwise, the generic method 
+	% arguments. Otherwise, the generic method
 	% 	/codeexample/prettyprint/key value with style detection={#1}{#2}
 	% will be invoked.
 	/codeexample/prettyprint/key value/.code 2 args={%
@@ -158,7 +158,7 @@
 	% on the 'cs arguments/<CS NAME>' key; it contains the integer
 	% number.
 	%
-	% For example, if 
+	% For example, if
 	% |cs arguments/pgfkeys/.initial=1|,
 	% the pretty printer invokes
 	% |cs with args={\pgfkeys}{<argument>}.
@@ -191,9 +191,9 @@
 	%
 	% For every identified control sequence, the key
 	%	/codeexample/prettyprint/cs/<CSNAME>/. at cmd
-	% will be checked. If it exists, it will be used instead of 
+	% will be checked. If it exists, it will be used instead of
 	% 'cs with args' (with the same special case restrictions for
-	% early end-of-input). 
+	% early end-of-input).
 	%
 	% The <CSNAME> must not contain the '\'.
 	%
@@ -207,7 +207,7 @@
 	/codeexample/prettyprint/cs arguments/end/.initial=1,
 	/codeexample/prettyprint/cs/end/.code 2 args={#1\{#2\pgfmanualclosebrace},
 	%
-	% a point coordinate (#1) 
+	% a point coordinate (#1)
 	% Note that '#1' will contain the braces (if there was one),
 	/codeexample/prettyprint/point/.code={#1},%
 	%
@@ -219,7 +219,7 @@
 	% the same with specialised code:
 	%/codeexample/prettyprint/point with cs/<CS NAME>/.code 2 args={(#1:#2},%
 	%
-	% 
+	%
 	% A predefined style which colors every identified token. It's
 	% purpose is only debugging.
 	/codeexample/prettyprint/colored/.style={%
@@ -307,7 +307,7 @@
 %
 % FIXME
 % THIS INTRODUCES A NEW GROUP! Does that hurt the pretty printer??
-% 
+%
 \def\pgfmanual at pretty@installcommenthandler{%
 	\expandafter\def\pgfmanual at pretty@activepercent{%
 		\begingroup
@@ -314,7 +314,7 @@
 		\pgfmanualprettycommentactivetrue
 		\expandafter\let\pgfmanual at pretty@activenl=\pgfmanual at pretty@recoveraftercomment
 		\expandafter\def\pgfmanual at pretty@activepercent{\%}%
-		%\tt 
+		%\tt
 		\% %
 	}%
 }%
@@ -552,7 +552,7 @@
 % 	\pgfmanualprettyprintercollectargcount with balanced braces. The braces
 % 	have \catcode 12.
 % POSTCONDITION:
-% 	1. the arguments will be collected as 
+% 	1. the arguments will be collected as
 % 		'<result> := {<first arg>}{<second arg>}',
 % 	2.1 the macro \pgfmanualprettyprinternumcollectedargs will contain
 % 	the *actual* number of *completely* collected arguments,
@@ -563,8 +563,8 @@
 % 	properly.
 % 	Afterwards, #2 will be invoked to recover from the argument
 % 	collection.
-% 
 %
+%
 % Example:
 % 	\pgfmanualprettyprintercollectargcount{2}{\donnextstep}
 % 		{_12 first argument }_12 {_12 second argument }_12 next tokens%
@@ -573,9 +573,9 @@
 % 		\pgfmanualprettyprinterhandlecollectedargs{{_1 first argument }_2 {_1 second argument }_2 }
 %		\donnextstep
 % 		next tokens
-% 	
 %
 %
+%
 % ATTENTION:
 % 	\pgfmanualprettyprinterhandlecollectedargs will be invoked with a SINGLE
 % 	argument. The argument as such will contain extra braces, one pair
@@ -725,7 +725,7 @@
 \newif\ifpgfmanualprettyprinterfoundterminator
 
 % Collects tokens inside of a token list up to a single delimiting token, dealing with nested
-% catcode-12-braces. 
+% catcode-12-braces.
 %
 % #1: is the end token, the delimiter. It won't be collected.
 % #2: is code to invoke after
@@ -736,7 +736,7 @@
 % 	\pgfmanualprettyprintercollectargcount with balanced braces. The braces
 % 	have \catcode 12.
 % POSTCONDITION:
-% 	- the arguments will be collected as 
+% 	- the arguments will be collected as
 % 		'<result> := <token list>'
 % 	and then, \pgfmanualprettyprinterhandlecollectedargs{<result>} will be
 % 	invoked. Just define \pgfmanualprettyprinterhandlecollectedargs
@@ -745,7 +745,7 @@
 %	- The boolean \ifpgfmanualprettyprinterfoundterminator will be set to true if and only if '#1' has been found.
 %
 % @see \pgfmanualprettyprintercollectargcount for more details.
-% 	
+%
 \def\pgfmanualprettyprintercollectupto#1#2{%
 	\pgfmanualprettyprinterarghasunmatchedbracesfalse
 	\pgfmanualprettyprinterfoundterminatortrue
@@ -918,7 +918,7 @@
 							\ifx\pgfmanual at loc@TMPa\pgfmanual at pretty@rbrace
 								#1%
 							\else
-								% found the beginning of a key! 
+								% found the beginning of a key!
 								% We will collect the key name into
 								% \toks0.
 								\toks0={}%
@@ -1117,4 +1117,3 @@
 	\edef\pgfmanual at loc@TMPa{{\pgfmanual at pretty@pgfkeys at collectkey@keyname}}%
 	\expandafter\pgfmanual at loc@TMPb\pgfmanual at loc@TMPa{#1}\pgfeov
 }
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfmathfloat.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -95,7 +95,7 @@
 %   [FLAGS] MANTISSE EXPONENT
 % meaning
 %   [+-]X.XXXXXXX*10^C
-% where 
+% where
 %   X.XXXXXX is a mantissa with first number != 0, C is an integer and
 % FLAGS contains the sign and some other special cases.
 %
@@ -103,7 +103,7 @@
 % computation is COMPLETELY STRING BASED.
 % This allows numbers such at 10000000 or 5.23e-10 to be represented
 % properly, although TeX-registers would produce overflow/underflow
-% errors in these cases. 
+% errors in these cases.
 %
 % It is to be used to compute logs, because log(X*10^Y) = log(X) + log(10)*Y
 %
@@ -124,7 +124,7 @@
 % where
 % FLAGS is a number in [0-5] where
 % 		0 == '0' (the number is +- 0.0),
-% 		1 == '+', 
+% 		1 == '+',
 % 		2 == '-',
 % 		3 == 'not a number'
 % 		4 == '+ infinity'
@@ -419,7 +419,7 @@
 
 % Converts a float to an integer (in integer format).
 %
-% @see \pgfmathfloatint 
+% @see \pgfmathfloatint
 \def\pgfmathfloattoint#1{%
 	\pgfmathfloattofixed{#1}%
 	\expandafter\pgfmathfloattoint@@\pgfmathresult\relax
@@ -521,7 +521,7 @@
 }
 
 
-% Overloaded method. 
+% Overloaded method.
 %
 % This variant always uses a FIXED number behind the period and fills
 % in zeros if necessary.
@@ -707,7 +707,7 @@
 		% \else
 		% 	\pgfmath at error{INTERNAL ERROR in fixed style - The input sequence did not terminate as expected; which indicates a wrong exponent argument provided to \string\pgfmathprintnumber at fixed@style}{}%
 		% \fi
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		\let\pgfmathprintnumber at fixed@styleDEFAULT at impl@noperiod at NEXT=\relax
 	\fi
 	\pgfmathprintnumber at fixed@styleDEFAULT at impl@noperiod at NEXT
@@ -782,7 +782,7 @@
 % Arguments:
 % #1#2#3e#4\relax
 
-% Input: 
+% Input:
 % #1  the fixed point number to be displayed (maybe a macro).
 % #2#3e#4:  the (possibly unformatted) floating point representation
 %     which belongs to #1. This format is returned (only!) by
@@ -791,7 +791,7 @@
 \let\pgfmathprintnumber at fixed@style=\pgfmathprintnumber at fixed@styleDEFAULT
 
 
-% Rounds a normalized floating point number to \pgfmathfloat at round@precision 
+% Rounds a normalized floating point number to \pgfmathfloat at round@precision
 % digits precision and writes the result to \pgfmathresult.
 %
 % This method uses \pgfmathroundto for the mantissa.
@@ -836,7 +836,7 @@
 % #2: mantissa
 % #3: exponent
 % #4: CODE to display if the mantissa is drawn.
-% 	This code will be shown just before the exponent. 
+% 	This code will be shown just before the exponent.
 % 	Example: #4=\cdot
 % #5: CODE to display if the mantissa is NOT draw. (unused currently)
 % 	Might be used to display '10^1' instead of '1*10^1'.
@@ -1160,7 +1160,7 @@
 		\if0\pgfmathprintnumber at RELATIVE@choice at roundtofixed
 			% relative round mode=mantissa
 			\def\b at round@fixed{0}%
-		\else 
+		\else
 			\if1\pgfmathprintnumber at RELATIVE@choice at roundtofixed
 				% relative round mode=fixed
 				\def\b at round@fixed{1}%
@@ -1196,7 +1196,7 @@
 		\fi
 		\edef\pgfmathresultX{%
 			\the\pgfmathfloat at a@S
-			\the\pgfmathfloat at a@Mtok 
+			\the\pgfmathfloat at a@Mtok
 			\ifpgfmathfloatroundhasperiod\else.0\fi
 			e\the\pgfmathfloat at a@E}%
 		% call another formatter for the result (but avoid rounding inside of it):
@@ -1235,7 +1235,7 @@
 	\fi
 	\edef\pgfmathresultX{%
 		\the\pgfmathfloat at a@S
-		\the\pgfmathfloat at a@Mtok 
+		\the\pgfmathfloat at a@Mtok
 		\ifpgfmathfloatroundhasperiod\else.0\fi
 		e\the\pgfmathfloat at a@E}%
 	\let\pgfmathfloat at round@precision at orig=\pgfmathfloat at round@precision
@@ -1691,8 +1691,8 @@
 	\endgroup
 	\let#3=\pgfmathfloat at glob@TMP
 }%
-	
 
+
 % Changes the current number pretty printer to #1.
 %
 % #1 is the macro base name for the pretty print routine, without the
@@ -1705,7 +1705,7 @@
 \pgfkeys{/pgf/number format/std}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
+%
 % IMPL
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1747,7 +1747,7 @@
 
 % \pgfmathroundto implementation in WORDS:
 %
-% coarse idea: 
+% coarse idea:
 %    1. collect all digits/sign BEFORE the first period in REVERSE order
 %    2. then, collect UP TO \prec digits after the period in REVERSE order
 % Steps 1. and 2. lead to the digit [sign] sequence
@@ -1781,7 +1781,7 @@
 %   		fi
 %   		++q
 %   		if q=0
-%   			discard the period 
+%   			discard the period
 %   		fi
 %   	end while
 %   	if q = r+1
@@ -1858,7 +1858,7 @@
 		\fi
 	\fi
 }
-			
+
 % takes the current input and decides whether trailing zeros shall be
 % discarded or more zeros need to be filled in.
 \def\pgfmathroundto at impl@finish at with@truncation{%
@@ -1991,7 +1991,7 @@
 	\fi
 }
 
-% PRECONDITION: 
+% PRECONDITION:
 %    \c at pgfmathroundto@lastzeros > 0
 \def\pgfmathroundto at impl@discard at suffix@zeros at ITERATE#1{%
 	\advance\c at pgfmathroundto@lastzeros by-1
@@ -2183,7 +2183,7 @@
 		% 	\pgfmathfloattofixed at impl@collectmantissa#2\count\pgfmathfloat at a@E
 		% 	\edef\pgfmathresult{\the\pgfmathfloat at a@Mtok}%
 		% \fi
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		\pgfmathfloat at a@Mtok{#1}%
 		\pgfmathfloattofixed at impl@pos#2000000000\pgfmathfloat at EOI
 		\edef\pgfmathresult{\the\pgfmathfloat at a@Mtok}%

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfutil-common-lists.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfutil-common-lists.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgfutil-common-lists.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -43,7 +43,7 @@
 %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-% Usage: 
+% Usage:
 % \pgfapplistnewempty\macro
 \def\pgfapplistnewempty#1{%
 	\expandafter\let\csname pgfapp@#1\endcsname=\pgfutil at empty
@@ -109,10 +109,10 @@
 	\pgfapplist at flushbuffers{#2}%
 	\expandafter\let\expandafter#1\csname pgfapp@#2\endcsname
 }%
-	
 
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 
+%
 % A variant of applist which has the same runtime requirements, but
 % does PUSH FRONT only.
 %
@@ -119,7 +119,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
-% Usage: 
+% Usage:
 % \pgfprependlistnewempty{list}
 \def\pgfprependlistnewempty#1{%
 	\expandafter\let\csname pgfpPRP@#1\endcsname=\pgfutil at empty

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternal.sty	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,10 +9,10 @@
 %%% 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: Di 25. Dez 18:14:20 CET 2012 %%%
 
@@ -34,7 +34,7 @@
 %
 % This file is intended to be distributed or even inlined into a file
 % when a document needs to be typeset on a system that does not have
-% pgf/TikZ installed. 
+% pgf/TikZ installed.
 %
 % It replaces \tikzpicture/ \endtikzpicture and \tikz and invokes the
 % \includegraphics with the correct file name instead.
@@ -156,9 +156,8 @@
 			{\toks0={#1#2}%
 			\immediate\write\@auxout{\noexpand\def\noexpand\dpthimport{\the\toks0 }\noexpand\dpthimport }%
 			}%
-		\fi				
+		\fi
 	\else%
 		\def\pgfretval{#1#2}%
 	\fi
 }%
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_tikzexternalshared.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 %%% 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
-%%%  
+%%%
 %
-% Support for the contents of this file will NOT be done by the PGF/TikZ team. 
+% Support for the contents of this file will NOT be done by the PGF/TikZ team.
 % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction
 % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything:
 % This file comes without any warranty as the rest of pgfplots; there is no obligation for help.
@@ -37,7 +37,7 @@
 %   tikzlibraryexternal.code.tex
 % ******************************
 %
-% 
+%
 % This file provides a high-level automatic export feature for tikz pictures.
 % It allows to export EACH SINGLE FIGURE into a separate PDF.
 %
@@ -91,10 +91,10 @@
 % Invokes '#1' if the external lib is currently externalizing the NEXT FOLLOWING
 % tikzpicture. It invokes '#2' if that is not the case.
 \def\tikzifexternalizingnext#1#2{%
-	\ifpgf at external@grabshipout 
+	\ifpgf at external@grabshipout
 		\tikzexternalgetnextfilename\tikzexternal at temp
 		\tikzifexternaljobnamematches\tikzexternal at temp{#1}{#2}%
-	\else 
+	\else
 		#2%
 	\fi
 }%
@@ -104,7 +104,7 @@
 % If the command is invoked outside of a picture, '#2' will be
 % invoked.
 \def\tikzifexternalizingcurrent#1#2{%
-	\ifpgf at external@grabshipout 
+	\ifpgf at external@grabshipout
 		\tikzexternalgetcurrentfilename\tikzexternal at temp
 		\ifx\tikzexternal at temp\pgfutil at empty
 			#2%
@@ -111,7 +111,7 @@
 		\else
 			\tikzifexternaljobnamematches\tikzexternal at temp{#1}{#2}%
 		\fi
-	\else 
+	\else
 		#2%
 	\fi
 }%
@@ -241,7 +241,7 @@
 	optimize/restore/.code={},%
 	% Expects two arguments, the command name and (optionally) a count
 	% of expected arguments.
-	% Example: 
+	% Example:
 	% 	'optimize command away=\includegraphics'
 	% 	'optimize command away={\mycommand}{3}'
 	%
@@ -317,7 +317,7 @@
 % 		&& dvipdfm "\image".dvi %
 % 	}%
 % }%
-%-------------------------------------------------- 
+%--------------------------------------------------
 \expandafter\def\csname tikzexternal at driver@pgfsys-xetex.def\endcsname{%
 	\pgfkeyssetvalue{/tikz/external/system call}{%
 		xelatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"%
@@ -349,7 +349,7 @@
 \tikzsetexternalprefix{}
 
 % This method initialises automatic externalization.
-% 
+%
 % The command does need any argument, but it has two optional ones:
 %
 % 1. \tikzexternalize[<options>]
@@ -381,7 +381,7 @@
 	}{%
 		\tikzexternal at auto@detect at jobnametrue
 		\pgfutil at ifundefined{tikzexternalrealjob}{%
-			% ok, \tikzexternalrealjob is not known. 
+			% ok, \tikzexternalrealjob is not known.
 			% Assume we are currently *not* externalizing.
 			\let\tikzexternalrealjob=\jobname
 		}{}%
@@ -421,14 +421,14 @@
 	\fi
 }%
 
-% If mode=`convert with system call', the boolean \ifpgfexternalreadmainaux 
+% If mode=`convert with system call', the boolean \ifpgfexternalreadmainaux
 % will be set depending on the current lock file.
 %
 % The idea is as follows: Suppose
-% pdflatex -shell-escape mainjob.tex 
+% pdflatex -shell-escape mainjob.tex
 % is running.
-% 
-% While it runs, 
+%
+% While it runs,
 % a) it modifies its mainjob.aux file,
 % b) it issues pdflatex -jobname mainjob-figure0 mainjob.tex .
 %
@@ -438,7 +438,7 @@
 % avoid such failure, a locking mechanism is established.
 %
 % The locking mechanisms causes (a) to write a lock command into
-% mainjob.auxlock 
+% mainjob.auxlock
 % just before (b) is called. Then, (b) will check it. After (b) has
 % completed, the lock will be reset.
 %
@@ -599,8 +599,8 @@
 %    final TeX-dialect specific end-image command.
 %    This is really difficult for LaTeX because \end{tikzpicture} either involves dirty
 %    catcode-hacks to parse the braces or an ugly loop which loops until it
-%	finds \end followed by {tikzpicture}. 
-% 
+%	finds \end followed by {tikzpicture}.
+%
 % #1: a macro which will be called with the collected environment contents.
 % all following tokens: the environment contents.
 \long\gdef\tikzexternal at TEXDIALECT@collectpicture#1#2\endtikzpicture{#1{#2}}
@@ -607,7 +607,7 @@
 %
 % 2. the following commands should expand to the TeX-dialect specific begin and end image command, i.e.
 %	\tikzpicture / \endtikzpicture
-%    or 
+%    or
 %	\begin{tikzpicture} / \end{tikzpicture}
 %	or
 %	\starttikzpicture / \stoptikzpicture
@@ -737,7 +737,7 @@
 \def\tikzexternal at getnextfilename@advancecount{%
 	\begingroup
 	\c at pgf@counta=\csname c at tikzext@no@\tikzexternal at figurename\endcsname\relax
-	\advance\c at pgf@counta by1 
+	\advance\c at pgf@counta by1
 	\expandafter\xdef\csname c at tikzext@no@\tikzexternal at figurename\endcsname{\the\c at pgf@counta}%
 	\endgroup
 }%
@@ -810,7 +810,7 @@
 			\let#1=\pgf at tempa
 		\fi
 	\fi
-	% 
+	%
 	\tikzexternal at getnextfilename@resetglobals%
 	%
 	\tikzexternal at protocol@to at file#1%
@@ -1030,7 +1030,7 @@
 \def\tikzpicturedependsonfile#1{}% NO-OP until \tikzexternalize has been called.
 
 
-% This command is invoked 
+% This command is invoked
 %  if and only if ( (grab mode && --jobname matches) || 'mode=graphics if exists' )
 %
 % It converts the current tikzpicture into an image in grab mode
@@ -1195,7 +1195,7 @@
 
 % Processes tikzpicture normally; without any externalization.
 %
-% We need to do further work here to deal with NESTED tikzpicture environments 
+% We need to do further work here to deal with NESTED tikzpicture environments
 % because all of them shall also be typeset normally.
 %
 % Idea:
@@ -1234,7 +1234,7 @@
 	\if5\tikzexternal at opmode
 		\let\tikz at refundefinedtrue@@=\G at refundefinedtrue
 		\gdef\G at refundefinedtrue{%
-			\tikz at refundefinedtrue@@ 
+			\tikz at refundefinedtrue@@
 			\tikzexternal at forceremake@undefined at reference@handler
 		}%
 	\fi
@@ -1378,10 +1378,10 @@
 |xdef|tikzexternal at normal@backslash{\}%
 }
 {
-\catcode`\^^I=12 
+\catcode`\^^I=12
 \catcode`\$=12
 \catcode`\%=12
-\catcode`\#=12 
+\catcode`\#=12
 \gdef\tikzexternal at HASHchar{#}
 \gdef\tikzexternal at TABchar{^^I}\gdef\tikzexternal at PERCENTchar{%}\xdef\tikzexternal at DOLLARchar{$}}
 
@@ -1527,7 +1527,7 @@
 % It is used as argument for \write{..}
 %
 % #1 the hash key to serialize.
-% \def\tikzexternal at hashfct@serialize 
+% \def\tikzexternal at hashfct@serialize
 \long\def\tikzexternal at hashfct@serialize at std#1{%
 	\noexpand\def\noexpand\tikzexternallastkey{#1}%
 }%
@@ -1544,7 +1544,7 @@
 
 \def\tikzexternal at check@uptodate at ext{.md5}
 
-\def\tikzexternal at check@uptodate at mode@warn at fallback{%	
+\def\tikzexternal at check@uptodate at mode@warn at fallback{%
 	\message{! Package tikz Warning: The key 'up to date check=md5' is impossible, there is no macro to compute MD5. Falling back to 'up to date check=diff'.}%
 	%
 	% warn only once:
@@ -1618,8 +1618,8 @@
 }
 
 % Checks whether the current picture needs to be externalized.
-% 
-% This is the case if 
+%
+% This is the case if
 % a) there is no external image yet,
 % b) the picture has been invalidated manually.
 %

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfsys-luatexpatch.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfsys-luatexpatch.def	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfsys-luatexpatch.def	2017-06-05 23:09:50 UTC (rev 44469)
@@ -2,6 +2,12 @@
 %
 %
 
+\ifnum\luatexversion<95
+	\immediate\write-1{luatex driver of PGF: detected lua version \the\luatexversion; falling back to old pdftex driver^^J}%
+	\input pgfsys-pdftex.def
+	\expandafter\endinput
+\fi
+
 % Copyright 2006 by Till Tantau
 %
 % This file may be distributed and/or modified

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/pgflibraryfillbetween.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/pgflibraryfillbetween.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/pgflibraryfillbetween.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -10,7 +10,7 @@
 
 \usepgflibrary{intersections}
 % FIXME : ARCHITECTURE VIOLATION:  REQUIRES
-% \usetikzlibrary{decorations.softclip} 
+% \usetikzlibrary{decorations.softclip}
 %
 %\usepgfmodule{decorations}
 
@@ -31,7 +31,7 @@
 	/pgf/fill between/inner moveto/connect,
 	%
 	% split=true allows to generate individual result paths for every
-	% region induced by the intersection points. Example: 
+	% region induced by the intersection points. Example:
 	% "color positive region in red and negative region in green".
 	% The case split=false results in just one output path
 	% (simpler+faster, but of course less powerful).
@@ -225,13 +225,13 @@
 	% 0. normalize path sequences.
 	%  ATTENTION : there are implicit assumptions on the INTERNAL ORDER of the two paths!
     %    This implementation needs to loop over them synchronously, i.e. it processes
-	%       the 0.th segment of a and the 0th of b, 
-	%       the 1.th segment of a and the 1th of b, 
+	%       the 0.th segment of a and the 0th of b,
+	%       the 1.th segment of a and the 1th of b,
 	%    and so on. Here, "i th segment" implies a sort order in ascending x direction.
 	%    This is, however, a weakness of \pgfintersectionofpaths - it does not really support this kind of sorting.
-	%    
+	%
 	%   I work around this by restricting the implementation to the "common use-cases", i.e. to two plots of functions which do not intersect themselves (i.e. to "functions" in the original sense). This will probably (almost surely) fail for parametric functions or circles.
-    %  
+    %
 	\if0\pgfpathfillbetween at reverse@mode
 		% reverse=false
 		%
@@ -413,7 +413,7 @@
 % Takes a softpath on input, replaces its first moveto by a lineto,
 % and returns it as softpath.
 % #1: a macro containing a softpath (i.e. the result of \pgfgetpath)
-% 
+%
 % On output, \pgfretval contains a modified path.
 \def\pgfpathreplacefirstmoveto#1{%
 	\ifx#1\pgfutil at empty
@@ -440,7 +440,7 @@
 }%
 
 % example: \pgfsyssoftpath at movetotoken{#2}{#3}\pgfsyssoftpath at linetotoken{#5}{#6}#7\pgf at stop
-% example: 
+% example:
 %	\pgfsyssoftpath at movetotoken{#2}{#3}
 %	\pgfsyssoftpath at curvetosupportatoken{<x>}{<y>}
 %	\pgfsyssoftpath at curvetosupportbtoken{<x>}{<y>}
@@ -469,7 +469,7 @@
 	\edef\pgfretval{%
 		\ifdim #1<#3\space
 			+%
-		\else 
+		\else
 			\ifdim #1=#3\space
 				\ifdim #2<#4\space
 					+%
@@ -717,10 +717,10 @@
 %   	\pgfplotsassertequalstok{\the\pgf at x, \the\pgf at y}{128.05057pt, 14.2278pt}{solution 3}
 %   	\pgfpointintersectionsolution{4}%
 %   	\pgfplotsassertequalstok{\the\pgf at x, \the\pgf at y}{156.50636pt, 14.2278pt}{solution 4}
-%   	
-%   
+%
+%
 %   	\pgfcomputeintersectionsegments{1}%
-%   
+%
 %   	\message{OUTPUT: \meaning\pgfretval^^J}%
 %   	\expandafter\def\csname expected at a@0\endcsname{%
 %   		\pgfsyssoftpath at movetotoken {56.90549pt}{0.0pt}%
@@ -745,7 +745,7 @@
 %   		\pgfsyssoftpath at movetotoken{156.50636pt}{14.2278pt}%
 %   		\pgfsyssoftpath at linetotoken {170.71646pt}{0.0pt}%
 %   	}
-%   % 
+%   %
 \def\pgfcomputeintersectionsegments#1{%
 	\pgfcomputeintersectionsegments at set@src{#1}%
 	\ifnum\pgfintersectionsolutions=0 %
@@ -871,7 +871,7 @@
 % Point lerp(float t, Point A, Point B) {
 % return A*(1-t) + B*t; // + and * overloaded for Points
 % }
-% 
+%
 % void split(t, Point P[4], Point L[4], Point R[4]) {
 % 	Point P01 = lerp(t, P[0], P[1]);
 % 	Point P12 = lerp(t, P[1], P[2]);
@@ -883,11 +883,11 @@
 % 	R[0] = Q;
 % 	R[1] = P123; R[2] = P23; R[3] = P[3];
 % }
-%-------------------------------------------------- 
+%--------------------------------------------------
 % INPUT:
 %  #1: a value in the range [0,1] which determines the split point
 %  #2,#3,#4,#5: the points of the curve, each of the form {<x>}{<y>}
-% 
+%
 % OUTPUT:
 %  \pgfretval at L{{<A>}{<B>}{<C>}{<D>}}
 %  \pgfretval at R{{<A>}{<B>}{<C>}{<D>}}
@@ -929,7 +929,7 @@
 %
 % This variants takes a part of a softpath as input:
 %
-% #1: a curveto- a macro containing a softpath of the form 
+% #1: a curveto- a macro containing a softpath of the form
 %   <x><y>\pgfsyssoftpath at curvetosupportatoken<x><y>\pgfsyssoftpath at curvetosupportbtoken<x><y>\pgfsyssoftpath at curvetotoken<x><y>
 % #2: t in [0,1]
 %

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/tikzlibraryfillbetween.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/tikzlibraryfillbetween.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfcontrib/tikzlibraryfillbetween.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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 2013 by Christian Feuersaenger
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -146,7 +146,7 @@
 			\fi
 			%
 			\expandafter\fill\expandafter[\pgfplots at loc@TMPa]
-				\pgfextra 
+				\pgfextra
 				\pgfsetpathandBB{\pgflibraryfill at path}%
 				\pgfkeysgetvalue{/tikz/fill between/path after segment}\tikz at fillbetween@post at segment
 				\expandafter
@@ -159,7 +159,7 @@
 	},
 	/tikz/fill between/.search also={/pgf/fill between,/pgfplots},
 	/tikz/fill between/optimize name intersections/.is if=tikzfillbetween at optimize@name at intersections,
-	% 
+	%
 	% FIXME : this optimization needs much more work... I believe it
 	% would be stable enough, but it covers too few cases.
 	%/tikz/fill between/optimize name intersections=true,
@@ -170,9 +170,9 @@
 	% /pgfplots/execute at begin axis@@/.add={%
 	% 	\def\b at pgfplotslibraryfill@added
 	% }{%
-	% 	
+	%
 	% },%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 }
 
 \def\tikzlibraryfillbetween at parse#1 and #2\pgf at stop{%
@@ -190,7 +190,7 @@
 \def\tikzfillbetween{\pgfutil at ifnextchar[{\tikzfillbetween at opt}{\tikzfillbetween at opt[]}}
 \def\tikzfillbetween at opt[#1]#2{%
 	\begingroup
-	\pgfqkeys{/tikz/fill between}{% 
+	\pgfqkeys{/tikz/fill between}{%
 		% prepare the low-level path generation instruction(s):
 		/tikz/fill between/@draw style={#2},%
 		%
@@ -431,7 +431,7 @@
 	\def\tikz at temp{#2}%
 	\def\tikz@@temp{-}%
 	\ifx\tikz@@temp\tikz at temp
-		% also accept minus signs without curly braces, i.e. 
+		% also accept minus signs without curly braces, i.e.
 		% L-2 instead of L{-2}
 		\def\tikz at next{\tikz at isect@p at next@{#1}{#2}}%
 	\else
@@ -517,7 +517,7 @@
 		\let\pgfpointlastofsetpath=\pgfutil at empty
 	\else
 		\if1\b at tikz@select at all%
-			% ok... select the *entire* path. 
+			% ok... select the *entire* path.
 			% #1 = A|B :
 			\expandafter\let\expandafter\pgfretval\csname tikz at path@segments@\tikz at path@ab\endcsname
 		\else

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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-2013 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -44,7 +44,6 @@
 \input pgfplots.paths.code.tex
 
 
-
 \usetikzlibrary{decorations,decorations.pathmorphing,decorations.pathreplacing}
 
 % FIXME: reduce number of variables!
@@ -74,7 +73,10 @@
 \newif\ifpgfplots at warn@for at filter@discards
 \newif\ifpgfplots at isuniformtick
 \newif\ifpgfplotsplothandlermesh at patch@type at sampling
-\newif\ifpgfplots at clip@limits
+\newif\ifpgfplots at clip@limits at compatmode
+\newif\ifpgfplots at clip@limits at x
+\newif\ifpgfplots at clip@limits at y
+\newif\ifpgfplots at clip@limits at z
 \newif\ifpgfplots at clip
 \newif\ifpgfplots at plot@coords at mathparser
 \pgfplots at plot@coords at mathparsertrue
@@ -135,6 +137,7 @@
 \newif\ifpgfplots at has@cell at picture
 \newif\ifpgfplots at substitute@pgfpoint
 \newif\ifpgfplots at LUA@backend at supported
+\newif\ifpgfplots at threedim@log at sampling
 
 \newif\ifpgfplots at collect@firstplot at astick
 \newif\ifpgfplots at units@use
@@ -164,7 +167,7 @@
 
 \def\pgfplots at label@upgrade at warning{%
 	\ifpgfplots at threedim
-		\pgfplotswarning{center lines upgrade required}\pgfeov% 
+		\pgfplotswarning{center lines upgrade required}\pgfeov%
 		\global\let\pgfplots at label@upgrade at warning=\relax
 	\fi
 }%
@@ -217,7 +220,7 @@
 		% 	\pgfplotswarning{cycle list size limit reached}\pgfeov
 		% 	\breakforeach
 		% \fi
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 	%
 	\pgfutil at ifnextchar\pgfplots at EOI{%
 		\pgfplots at gobble@until at EOI
@@ -319,9 +322,9 @@
 		\begingroup
 		\edef\pgfkeyscurrentkey{#1}%
 		\pgfkeyssplitpath
-		\pgfplots at warning{Loading deprecated style option 
-			\pgfkeyscurrentpath/\pgfkeyscurrentname.  
-			Please replace '\string\tikzstyle{\pgfkeyscurrentname}' 
+		\pgfplots at warning{Loading deprecated style option
+			\pgfkeyscurrentpath/\pgfkeyscurrentname.
+			Please replace '\string\tikzstyle{\pgfkeyscurrentname}'
 			with '\string\pgfplotsset{\pgfkeyscurrentname/.style={}}'
 			(or '\string\pgfplotsset{\pgfkeyscurrentname/.append style={}}').}%
 		\endgroup
@@ -390,7 +393,7 @@
 % Does the work for '[xyz]ticklabel pos'.
 %
 % #1: the axis (x,y or z).
-% #2: the key argument. Accepts 
+% #2: the key argument. Accepts
 % 	'lower',
 % 	'upper',
 % 	'default' -> depends on 'tick pos'
@@ -516,7 +519,7 @@
 \def\pgfplots at colormap@catcodemagic{colormap}
 \pgfplots at command@to at string\pgfplots at colormap@catcodemagic\pgfplots at colormap@catcodemagic
 
-% checks for 
+% checks for
 % - <known list>
 % - [<elements> of]<known list>
 % POSTCONDITION:
@@ -601,7 +604,7 @@
 			% remove spaces from ##1 and ##2:
 			\pgfkeys at spdef\pgfplots at loc@TMPa{##1}%
 			\pgfkeys at spdef\pgfplots at loc@TMPb{##2}%
-			% 
+			%
 			% check if the argument is known:
 			\pgfkeysifdefined{/pgfplots/point meta/\pgfplots at loc@TMPa/. at cmd}{%
 				\def\pgfplots at loc@TMPc{%
@@ -649,7 +652,7 @@
 	\edef\pgfplots at color@of at colormap@value{\pgfplots at color@of at colormap@value}%
 	\pgfkeys at spdef\pgfplots at color@of at colormap@name{#2}%
 }
-% defines 
+% defines
 % - \pgfmathresult to be the resulting color.
 % - \pgfplots at color@of at colormap@name the name of the colormap
 \def\pgfplots at color@of at colormap@define#1{%
@@ -783,7 +786,7 @@
 		\fi
 	},
 	% 'activate layers=false' is the same as 'set layers=none'.
-	% However, 'activate layers=true' does not work unless a 'set layers' 
+	% However, 'activate layers=true' does not work unless a 'set layers'
 	% has been installed as well.
 	/pgfplots/activate layers/.is if=pgfplots at layered@graphics,
 	/pgfplots/activate layers/.default=true,
@@ -1105,7 +1108,7 @@
 	/pgfplots/axis type/.belongs to family=/pgfplots/scale,
 	/pgfplots/@expected axis cs/.initial=cart,
 	/pgfplots/every rectangle axis/.style={},
-	% 
+	%
 	% see \pgfplotsdefinecstransform{<from>}{<to>}{<code>}
 	/pgfplots/data cs/.initial=cart,% the coordinate system of provided data. Will be transformed to the axis' internal coordinate system (@expected axis cs).
 	%
@@ -1186,7 +1189,7 @@
 	%
 	% this here used to be the default up to (and including) pgfplots 1.13.
 	% But it does not support the following use cases:
-	% * 'colormap access=const', 
+	% * 'colormap access=const',
 	% * 'colorbar style={ytick=data}}'
 	% * CMYK shadings
 	% -> deprecated.
@@ -1352,7 +1355,7 @@
 			\c at pgf@countd=\pgfplotscolormaplastindexof{\pgfplots at CM}\relax
 			\edef\pgfplots at colorcount{\the\c at pgf@countd}%
 			\advance\c at pgf@countd by-1 %
-			% XXX : this here is tailored for use with 
+			% XXX : this here is tailored for use with
 			% * 'colormap access=const' and
 			% * 'sample for=const'
 			% where the last color is redundant and must not be
@@ -1717,8 +1720,6 @@
 	/pgfplots/ytick pos/right/.belongs to family=/pgfplots/tick,
 	/pgfplots/ytick pos/both/.code	={\def\pgfplots at ytickposnum{0}},
 	/pgfplots/ytick pos/both/.belongs to family=/pgfplots/tick,
-	/pgfplots/ytick pos/top/.style={/pgfplots/ytick pos/right},
-	/pgfplots/ytick pos/bottom/.style={/pgfplots/ytick pos/left},
 	/pgfplots/ytick pos=both,
 	/pgfplots/ztick pos/.is choice,
 	/pgfplots/ztick pos/.belongs to family=/pgfplots/tick,
@@ -1728,8 +1729,6 @@
 	/pgfplots/ztick pos/right/.belongs to family=/pgfplots/tick,
 	/pgfplots/ztick pos/both/.code	={\def\pgfplots at ztickposnum{0}},
 	/pgfplots/ztick pos/both/.belongs to family=/pgfplots/tick,
-	/pgfplots/ztick pos/top/.style={/pgfplots/ztick pos/right},
-	/pgfplots/ztick pos/bottom/.style={/pgfplots/ztick pos/left},
 	/pgfplots/ztick pos=both,
 	/pgfplots/tickpos/.style={
 		/pgfplots/xtick pos={#1},
@@ -1761,11 +1760,11 @@
 	% This feature is more or less deprecated.
 	% The choice 'auto' should always use 'near ticklabel'.
 	%
-	% Choices are 
+	% Choices are
 	% 	'auto' (value 0),
-	% 	'near ticklabel' (value 1), 
+	% 	'near ticklabel' (value 1),
 	% 	'tikz' (value 2)
-	% with values stored in \pgfplots at ticklabel@anchor@[xyz] 
+	% with values stored in \pgfplots at ticklabel@anchor@[xyz]
 	/pgfplots/xticklabel anchor/.code={\pgfplots at setticklabel@anchor at for x{#1}},
 	/pgfplots/xticklabel anchor/.belongs to family=/pgfplots/tick,
 	/pgfplots/yticklabel anchor/.code={\pgfplots at setticklabel@anchor at for y{#1}},
@@ -2009,22 +2008,22 @@
 			\draw[%
 				/pgfplots/mesh=false,%
 				% reset bar options. This is to address the strange
-				% backwards compatibility handling implemented by 
+				% backwards compatibility handling implemented by
 				% \pgfplots at install@local at bar@handlers (see its docs).
 				% This should not hurt at all since 'line legend' is
 				% unsuitable for bar plots anyway.
-				bar width=3pt,% 
+				bar width=3pt,%
 				bar shift=0pt,%
 				%
 				mark repeat=2,%
-				mark phase=2,##1] 
+				mark phase=2,##1]
 				plot coordinates {
-					(0cm,0cm) 
+					(0cm,0cm)
 					(0.3cm,0cm)
 					(0.6cm,0cm)%
 				};%
 		}%
-	},	
+	},
 	/pgfplots/line legend/.style/.code={\pgfplots at error{This style is supposed to be constant.}},%
 	/pgfplots/line legend/.append style/.code={\pgfplots at error{This style is supposed to be constant.}},%
 	/pgfplots/line legend,
@@ -2070,10 +2069,26 @@
 		}%
 	},%
 	/tikz/trim axis right/.style={/pgfplots/trim axis right},
-	/pgfplots/clip limits/.is if=pgfplots at clip@limits,
-	/pgfplots/clip limits/.default=true,
+	/pgfplots/clip limits compat/.is if=pgfplots at clip@limits at compatmode,
+	/pgfplots/clip limits if compat/.code={
+		\ifpgfplots at clip@limits at compatmode
+		\else
+			\pgfkeysalso{#1}%
+		\fi
+	},
+	/pgfplots/clip xlimits/.is if=pgfplots at clip@limits at x,
+	/pgfplots/clip xlimits/.default=true,
+	/pgfplots/clip ylimits/.is if=pgfplots at clip@limits at y,
+	/pgfplots/clip ylimits/.default=true,
+	/pgfplots/clip zlimits/.is if=pgfplots at clip@limits at z,
+	/pgfplots/clip zlimits/.default=true,
+	/pgfplots/clip limits/.style={
+		/pgfplots/clip xlimits={#1},%
+		/pgfplots/clip ylimits={#1},%
+		/pgfplots/clip zlimits={#1},%
+	},
 	/pgfplots/clip limits=true,
-	/pgfplots/clip limits/.belongs to family=/pgfplots,
+	%/pgfplots/clip limits/.belongs to family=/pgfplots,
 	/pgfplots/clip/.is if=pgfplots at clip,
 	/pgfplots/clip/.default=true,
 	/pgfplots/clip=true,
@@ -2260,7 +2275,7 @@
 		\edef\pgfplots at loc@TMPa{#3}%
 		\expandafter\pgfplots at loc@TMPc\pgfplots at loc@TMPa\relax
 	},%
-	% -> keeps only the nth point, all other ones will get ''. 
+	% -> keeps only the nth point, all other ones will get ''.
 	/pgfplots/each nth point/.style={/pgfplots/each nth point*={x}{#1}},%
 	% #1: the filter name: x, y, z, or something exotic like hist/data
 	% #2: the N of 'each nth'
@@ -2300,8 +2315,8 @@
 	/pgfplots/xfilter/.initial=,% DEPRECATED
 	/pgfplots/yfilter/.initial=,% DEPRECATED
 	/pgfplots/zfilter/.initial=,% DEPRECATED
-	% interpretation: 
-	% if 'samples at'==empty && 'domain' == empty 
+	% interpretation:
+	% if 'samples at'==empty && 'domain' == empty
 	% 	use tikz option	processing!
 	% else if 'samples at' == empty
 	% 	use 'domain'
@@ -2319,7 +2334,7 @@
 	/pgfplots/variable/.code={\pgfkeysalso{/tikz/variable={#1}}},
 	/pgfplots/variable y/.initial=\y,%
 	/pgfplots/sample dim/.initial=auto,
-	% and provide aliases in the '/pgfplots/' tree to avoid 
+	% and provide aliases in the '/pgfplots/' tree to avoid
 	% search path problems just for the following options:
 	/pgfplots/name/.code={\pgfkeysalso{/tikz/name={#1}}},
 	/pgfplots/overlay/.code={\pgfkeysalso{/tikz/overlay={#1}}},
@@ -2328,7 +2343,7 @@
 	/pgfplots/prefix/.code={\pgfkeysalso{/tikz/prefix={#1}}},
 	/pgfplots/raw gnuplot/.code={\pgfkeysalso{/tikz/raw gnuplot={#1}}},
 	/pgfplots/parametric/.code={\pgfkeysalso{/tikz/parametric={#1}}},%
-	% 
+	%
 	/pgfplots/width/.initial=,%
 	/pgfplots/width/.belongs to family=/pgfplots,
 	/pgfplots/height/.initial=,%
@@ -2401,7 +2416,7 @@
 	/pgfplots/scale uniformly strategy/auto,
 	/pgfplots/scale uniformly warning/.is if=pgfplots at scaleuniformly@warning,
 	/pgfplots/scale uniformly warning=false,
-	% number of iterations for the nonlinear method involved 
+	% 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 at allow@reversal at of@rel at axis@cs,%
 	/pgfplots/allow reversal of rel axis cs/.default=true,%
@@ -2631,7 +2646,7 @@
 	/pgfplots/disablelogfilter y/.default=true,
 	/pgfplots/disablelogfilter z/.is if=pgfplots at disablelogfilter@z,
 	/pgfplots/disablelogfilter z/.default=true,
-	/pgfplots/disablelogfilter/.style={	
+	/pgfplots/disablelogfilter/.style={
 		/pgfplots/disablelogfilter x=#1,
 		/pgfplots/disablelogfilter y=#1,
 		/pgfplots/disablelogfilter z=#1,
@@ -3157,9 +3172,9 @@
 		%
 		% 'nodes near coords=<content of node>'.
 		% The content is by default \pgfmathprintnumber\pgfplotspointmeta.
-		% 
-		% Use 'point meta=y' after 'nodes near coords' to typeset the y coordinates 
-		% Use 'point meta=x' to typeset the x coordinates 
+		%
+		% Use 'point meta=y' after 'nodes near coords' to typeset the y coordinates
+		% Use 'point meta=x' to typeset the x coordinates
 		/pgfplots/nodes near coords/.style={%
 			/pgfplots/scatter/@pre marker code/.code={},%
 			/pgfplots/scatter/@post marker code/.code={},%
@@ -3221,7 +3236,7 @@
 				\fi
 				% ok, place the node.
 				\expandafter\node\expandafter[\pgfplots at nodes@near at coords@align,%
-					/pgfplots/every node near coord] 
+					/pgfplots/every node near coord]
 				{%
 					\if1\csname pgfpmeta@\pgfplotspointmetainputhandler @issymbolic\endcsname%
 						% point meta=explicit symbolic
@@ -3402,7 +3417,7 @@
 		/pgf/bar shift={%
 				% total width = n*w + (n-1)*skip
 				% -> subtract half for centering
-				-0.5*(\numplotsofactualtype*\pgfplotbarwidth + (\numplotsofactualtype-1)*(#1))  + 
+				-0.5*(\numplotsofactualtype*\pgfplotbarwidth + (\numplotsofactualtype-1)*(#1))  +
 				% the '0.5*w' is for centering
 				(.5+\plotnumofactualtype)*\pgfplotbarwidth + \plotnumofactualtype*(#1)},%
 	},
@@ -3419,7 +3434,7 @@
 			#1shift={%
 					% total width = n*w + (n-1)*skip
 					% -> subtract half for centering
-					-0.5*(\numplotsofactualtype*(#1) + (\numplotsofactualtype-1)*(#2))  + 
+					-0.5*(\numplotsofactualtype*(#1) + (\numplotsofactualtype-1)*(#2))  +
 					% the '0.5*w' is for centering
 					(.5+\plotnumofactualtype)*(#1) + \plotnumofactualtype*(#2)%
 			},%
@@ -3430,6 +3445,7 @@
 		bar cycle list,
 		xtick align=outside,
 		ybar legend,
+		clip limits if compat={clip ylimits=false},
 		/pgfplots/set point meta if empty=f(x),%
 		/pgfplots/bar shift auto={#1},
 		/pgfplots/error bars/draw error bar/.code 2 args={%
@@ -3466,6 +3482,7 @@
 		bar direction=x,
 		bar cycle list,
 		ytick align=outside,
+		clip limits if compat={clip xlimits=false},
 		/pgfplots/xbar legend,
 		/pgfplots/set point meta if empty=x,%
 		/pgfplots/bar shift auto={#1},
@@ -3496,6 +3513,7 @@
 		bar cycle list,
 		x tick label as interval,
 		xmajorgrids,
+		clip limits if compat={clip ylimits=false},
 		xtick align=outside,
 		xtick=data,
 		ybar interval legend,
@@ -3516,6 +3534,7 @@
 		ymajorgrids,
 		ytick align=outside,
 		xbar interval legend,
+		clip limits if compat={clip xlimits=false},
 		bar interval width={#1/\numplotsofactualtype},
 		bar interval shift={(\plotnumofactualtype+0.5)/\numplotsofactualtype},
 		/tikz/xbar interval,
@@ -3527,6 +3546,7 @@
 		bar direction=x,
 		bar cycle list,
 		single xbar legend,
+		clip limits if compat={clip xlimits=false},
 		stack plots=x,
 		stack dir=#1,
 		/tikz/xbar,
@@ -3539,6 +3559,7 @@
 		bar direction=y,
 		bar cycle list,
 		single ybar legend,
+		clip limits if compat={clip ylimits=false},
 		stack plots=y,
 		stack dir=#1,
 		/tikz/ybar,
@@ -3551,6 +3572,7 @@
 		bar direction=x,
 		/pgfplots/set point meta if empty=x,%
 		bar cycle list,
+		clip limits if compat={clip xlimits=false},
 		single xbar legend,
 		stack plots=x,
 		stack dir=#1,
@@ -3563,6 +3585,7 @@
 		/pgfplots/set point meta if empty=f(x),%
 		bar cycle list,
 		single ybar legend,
+		clip limits if compat={clip ylimits=false},
 		stack plots=y,
 		stack dir=#1,
 		/tikz/ybar interval,
@@ -3593,7 +3616,7 @@
 	/pgfplots/plot graphics/zmin/.initial=,
 	/pgfplots/plot graphics/zmax/.initial=,
 	%
-	% a) to provide a bounding box: points={(0,1) (0,2)} 
+	% a) to provide a bounding box: points={(0,1) (0,2)}
 	% or b) to squeeze the graphics into internal image coordinates:
 	% points={(0,1,0) => (0,4)  (0,0,1) => (40,600)}
 	% or c) both of them.
@@ -3608,7 +3631,7 @@
 	%
 	% this command key should defined \pgfmathresult to be
 	% \pgfmathresult -> {{<wd>}{<ht>}}
-	% where <wd> is the natural width of the input image and 
+	% where <wd> is the natural width of the input image and
 	% <ht> is the natural height.
 	% The input image file name is available as 'plot graphics/src'.
 	% The default implementation invoked 'lowlevel draw={}{}' and
@@ -3812,7 +3835,7 @@
 	%
 	% Set the shader used for surface plots.
 	% RULES:
-	% 	1. meshmode == 'm' (mesh):  
+	% 	1. meshmode == 'm' (mesh):
 	% 		This means we use "shader/flat" to determine the colors
 	% 		and ignore fill colors.
 	% 	2. meshmode == 's' (surf):
@@ -4008,7 +4031,7 @@
 	/pgfplots/colormap uniform/always/.code={\def\pgfplots at colormap@uniform at choice{0}},
 	/pgfplots/colormap uniform/if requested/.code={\def\pgfplots at colormap@uniform at choice{1}},
 	/pgfplots/colormap uniform/always,
-	% 
+	%
 	% #1: a number X with 0<= x <=0.9 which defines the relative size
 	% of the extra interval used for 'colormap access=piecewise constant'
 	% The value #1=0 disables the extra interval.
@@ -4177,7 +4200,7 @@
 			/pgfplots/scatter/@post marker code/.prefix code={\endscope}%
 		}%
 		% Now:remember the classes.
-		\pgfkeyssetvalue{/pgfplots/scatter/classes/values}{#1}% 
+		\pgfkeyssetvalue{/pgfplots/scatter/classes/values}{#1}%
 		%
 		% and generate legend items for every single class,
 		% But ONLY if we really *have* a plot which uses
@@ -4268,6 +4291,9 @@
 	/pgfplots/cube/size x=\pgfplotmarksize,
 	/pgfplots/cube/size y=\pgfplotmarksize,
 	/pgfplots/cube/size z=\pgfplotmarksize,
+	%
+	/pgfplots/3d log sampling/.is if=pgfplots at threedim@log at sampling,
+	%
 	/pgfplots/trig format/.style={/pgf/trig format={#1}},
 	/pgfplots/xtick placement tolerance/.initial=0.05pt,
 	/pgfplots/ytick placement tolerance/.initial=0.05pt,
@@ -4306,6 +4332,7 @@
 	/pgfplots/compat/anchors/1.12/.style= 	{/pgfplots/compat/anchors/1.3},%
 	/pgfplots/compat/anchors/1.13/.style= 	{/pgfplots/compat/anchors/1.3,/pgfplots/correct polar positioning=true},%
 	/pgfplots/compat/anchors/1.14/.style= 	{/pgfplots/compat/anchors/1.13},%
+	/pgfplots/compat/anchors/1.15/.style= 	{/pgfplots/compat/anchors/1.13},%
 	/pgfplots/compat/anchors/default/.style={/pgfplots/compat/anchors/1.3},%
 	%
 	/pgfplots/compat/empty line/.is choice,
@@ -4323,6 +4350,7 @@
 	/pgfplots/compat/empty line/1.12/.style= 	{/pgfplots/compat/empty line/1.4},%
 	/pgfplots/compat/empty line/1.13/.style= 	{/pgfplots/compat/empty line/1.4},%
 	/pgfplots/compat/empty line/1.14/.style= 	{/pgfplots/compat/empty line/1.4},%
+	/pgfplots/compat/empty line/1.15/.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,
@@ -4340,6 +4368,7 @@
 	/pgfplots/compat/path replacement/1.12/.style=   	{/pgfplots/compat/path replacement/1.5.1},
 	/pgfplots/compat/path replacement/1.13/.style=   	{/pgfplots/compat/path replacement/1.5.1},
 	/pgfplots/compat/path replacement/1.14/.style=   	{/pgfplots/compat/path replacement/1.5.1},
+	/pgfplots/compat/path replacement/1.15/.style=   	{/pgfplots/compat/path replacement/1.5.1},
 	/pgfplots/compat/path replacement/default/.style=	{/pgfplots/compat/path replacement/pre 1.3},%
 	%
 	/pgfplots/compat/pgfpoint substitution/.is choice,
@@ -4357,6 +4386,7 @@
 	/pgfplots/compat/pgfpoint substitution/1.12/.style=   	{/pgfplots/compat/pgfpoint substitution/1.11},
 	/pgfplots/compat/pgfpoint substitution/1.13/.style=   	{/pgfplots/compat/pgfpoint substitution/1.11},
 	/pgfplots/compat/pgfpoint substitution/1.14/.style=   	{/pgfplots/compat/pgfpoint substitution/1.11},
+	/pgfplots/compat/pgfpoint substitution/1.15/.style=   	{/pgfplots/compat/pgfpoint substitution/1.11},
 	/pgfplots/compat/pgfpoint substitution/default/.style=	{/pgfplots/compat/pgfpoint substitution/pre 1.3},%
 	%ellipse/.is if=pgfplots at path@replace at ellipse,
 	%
@@ -4384,7 +4414,8 @@
 	/pgfplots/compat/labels/1.12/.style=		{/pgfplots/compat/labels/1.8},%
 	/pgfplots/compat/labels/1.13/.style=		{/pgfplots/compat/labels/1.8},%
 	/pgfplots/compat/labels/1.14/.style=		{/pgfplots/compat/labels/1.8},%
-	/pgfplots/compat/labels/default/.style=	{/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility 
+	/pgfplots/compat/labels/1.15/.style=		{/pgfplots/compat/labels/1.8},%
+	/pgfplots/compat/labels/default/.style=	{/pgfplots/compat/labels/pre 1.3},% maintain backwards compatibility
 	%
 	/pgfplots/compat/bar nodes/.is choice,
 	/pgfplots/compat/bar nodes/pre 1.3/.style={%
@@ -4436,7 +4467,8 @@
 		},%
 	},%
 	/pgfplots/compat/bar nodes/1.14/.style=		{/pgfplots/compat/bar nodes/1.13},%
-	/pgfplots/compat/bar nodes/default/.style=	{/pgfplots/compat/bar nodes/pre 1.3},% maintain backwards compatibility 
+	/pgfplots/compat/bar nodes/1.15/.style=		{/pgfplots/compat/bar nodes/1.13},%
+	/pgfplots/compat/bar nodes/default/.style=	{/pgfplots/compat/bar nodes/pre 1.3},% maintain backwards compatibility
 	/pgfplots/compat/bar nodes/default,
 	%
 	% search for the \pgfplots at compat@scaling at coordmath -- using float
@@ -4468,6 +4500,7 @@
 	/pgfplots/compat/scaling/1.12/.style={/pgfplots/compat/scaling/1.6},
 	/pgfplots/compat/scaling/1.13/.style={/pgfplots/compat/scaling/1.6},
 	/pgfplots/compat/scaling/1.14/.style={/pgfplots/compat/scaling/1.6},
+	/pgfplots/compat/scaling/1.15/.style={/pgfplots/compat/scaling/1.6},
 	/pgfplots/compat/scaling/default/.style={/pgfplots/compat/scaling/1.4},
 	%
 	/pgfplots/compat/scale mode/.is choice,
@@ -4485,6 +4518,7 @@
 	/pgfplots/compat/scale mode/1.12/.style={/pgfplots/compat/scale mode/1.6},
 	/pgfplots/compat/scale mode/1.13/.style={/pgfplots/compat/scale mode/1.6},
 	/pgfplots/compat/scale mode/1.14/.style={/pgfplots/compat/scale mode/1.6},
+	/pgfplots/compat/scale mode/1.15/.style={/pgfplots/compat/scale mode/1.6},
 	/pgfplots/compat/scale mode/default/.style={/pgfplots/compat/scale mode/1.5},
 	%
 	%
@@ -4503,6 +4537,7 @@
 	/pgfplots/compat/plot3graphics/1.12/.style=	{/pgfplots/compat/plot3graphics/1.6},%
 	/pgfplots/compat/plot3graphics/1.13/.style=	{/pgfplots/compat/plot3graphics/1.6},%
 	/pgfplots/compat/plot3graphics/1.14/.style=	{/pgfplots/compat/plot3graphics/1.6},%
+	/pgfplots/compat/plot3graphics/1.15/.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
@@ -4522,9 +4557,9 @@
 	% Consequently, I cannot introduce compatibity switches without
 	% loosing compatibility.
 	%
-	% I chose to keep the correct unary minus sign. If you ever want 
+	% 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
@@ -4547,6 +4582,7 @@
 	/pgfplots/compat/bar width by units/1.12/.style=		{/pgfplots/compat/bar width by units/1.7},
 	/pgfplots/compat/bar width by units/1.13/.style=		{/pgfplots/compat/bar width by units/1.7},
 	/pgfplots/compat/bar width by units/1.14/.style=		{/pgfplots/compat/bar width by units/1.7},
+	/pgfplots/compat/bar width by units/1.15/.style=		{/pgfplots/compat/bar width by units/1.7},
 	/pgfplots/compat/bar width by units/default/.style={/pgfplots/compat/bar width by units/pre 1.3},
 	%
 	/pgfplots/compat/BB/.is choice,
@@ -4564,6 +4600,7 @@
 	/pgfplots/compat/BB/1.12/.style=	{/pgfplots/compat/BB/1.8},%
 	/pgfplots/compat/BB/1.13/.style=	{/pgfplots/compat/BB/1.8},%
 	/pgfplots/compat/BB/1.14/.style=	{/pgfplots/compat/BB/1.8},%
+	/pgfplots/compat/BB/1.15/.style=	{/pgfplots/compat/BB/1.8},%
 	/pgfplots/compat/BB/default/.style={/pgfplots/compat/BB/pre 1.3},
 	%
 	/pgfplots/compat/general/.is choice,
@@ -4577,6 +4614,8 @@
 		/pgfplots/compat/library hook={statistics}{/pgfplots/boxplot/estimator=legacy,/pgfplots/boxplot/ensure mark=false},
 		/pgfplots/colorbar pgfshading,
 		/pgfplots/colorbar=false,
+		/pgfplots/3d log sampling=false,
+		/pgfplots/clip limits compat=true,
 	},%
 	/pgfplots/compat/general/1.3/.style=	{/pgfplots/compat/general/pre 1.3},
 	/pgfplots/compat/general/1.4/.style=	{/pgfplots/compat/general/pre 1.3},%
@@ -4615,6 +4654,11 @@
 		%/pgfplots/colorbar sampled={surf,shader=interp,samples=2},
 		%/pgfplots/colorbar=false,
 	},%
+	/pgfplots/compat/general/1.15/.style=	{%
+		/pgfplots/compat/general/1.14,
+		/pgfplots/3d log sampling=true, % FIXME finish this feature: see unittest_log_sampling_3d
+		/pgfplots/clip limits compat=false,
+	},%
 	/pgfplots/compat/general/default/.style={/pgfplots/compat/general/1.11},
 	%
 	/pgfplots/enable tick line clipping/.is if=pgfplots at enable@tick at line@clipping,
@@ -4632,7 +4676,7 @@
 	/pgfplots/compat/show suggested version/.is if=pgfplots at show@suggested at version,
 	/pgfplots/compat/show suggested version=true,
 	/pgfplots/compat/current/.initial=,
-	/pgfplots/compat/mostrecent/.initial=1.14,
+	/pgfplots/compat/mostrecent/.initial=1.15,
 	/utils/exec={%
 		\pgfplotsutilforeachcommasep{%
 			/pgfplots/compat/current,%
@@ -4761,6 +4805,18 @@
 	},%
 }
 
+\def\pgfplots at glob@TMPa#1{%
+	\pgfkeys{%
+		/pgfplots/#1tick pos/lower/.style={/pgfplots/#1tick pos=left},
+		/pgfplots/#1tick pos/bottom/.style={/pgfplots/#1tick pos=left},
+		/pgfplots/#1tick pos/upper/.style={/pgfplots/#1tick pos=right},
+		/pgfplots/#1tick pos/top/.style={/pgfplots/#1tick pos=right},
+	}%
+}%
+\pgfplots at glob@TMPa x%
+\pgfplots at glob@TMPa y%
+\pgfplots at glob@TMPa z%
+
 \def\pgfplots at ticklabel@typeset at arg#1{\pgfkeysvalueof{/pgfplots/typeset ticklabel/. at cmd}{#1}\pgfeov}%
 
 % backwards compatibility:
@@ -4773,7 +4829,7 @@
 \global\let\pgfplots at colorbar@draw at legacyimpl=\pgfplots at loc@TMPa
 \endgroup
 
-% call 
+% call
 %   \pgfkeyslet{.../. at cmd}\pgfplots at cant@set at in@this at context
 % to replace a key with a generic error message.
 \def\pgfplots at cant@set at in@this at context#1\pgfeov{\pgfplots at cant@set at in@this at context@}
@@ -4924,7 +4980,7 @@
 	% Prepare special alignment features here.
 	%
 	% The idea is to:
-	% 1. Declare a local COORDINATE SYSTEM to place labels, 
+	% 1. Declare a local COORDINATE SYSTEM to place labels,
 	% the 'ticklabel cs' for the current axis.
 	% It takes 1-2 arguments where the first is the coordinate on the
 	% ticklabel axis (between 0 and 1). The second is an optional shift orthogonal to
@@ -4943,7 +4999,7 @@
 	\pgfkeyslet{/tikz/sloped/orig/. at cmd}\pgfplots at loc@TMPa
 	\pgfkeysdef{/tikz/sloped}{\pgfkeysalso{/tikz/sloped like #1 axis={##1}}}%
 	%
-	\node 
+	\node
 		[/pgfplots/every axis label,%
 		/pgfplots/every axis #1 label]
 	{#2};
@@ -4995,8 +5051,8 @@
 
 % Draws outer axis lines, i.e. those which are on the bounding box.
 % This has an effect if and only if axis #1 lines!=center.
-% 
 %
+%
 % Ok, we don't mind whether edges with thick lines look ugly. We just
 % draw separate lines. This here is necessary if we want arrow heads.
 %
@@ -5022,7 +5078,7 @@
 				\pgfplotspointonorientedsurfaceabsetupfor{#2}{#1}{\pgfplotspointonorientedsurfaceN}%
 				\pgfplots at transformshift@along at outer@normal at on@line at of@oriented at surf 0v%
 				\pgfplots at drawgridlines@onorientedsurf at fromto{\csname pgfplots@#2min\endcsname}%
-				\endpgfextra 
+				\endpgfextra
 				};
 		}{}%
 		\pgfplots at ifaxisline@B at onorientedsurf@should at be@drawn{1}{%
@@ -5032,7 +5088,7 @@
 				\pgfplotspointonorientedsurfaceabsetupfor{#2}{#1}{\pgfplotspointonorientedsurfaceN}%
 				\pgfplots at transformshift@along at outer@normal at on@line at of@oriented at surf 1v%
 				\pgfplots at drawgridlines@onorientedsurf at fromto{\csname pgfplots@#2max\endcsname}%
-				\endpgfextra 
+				\endpgfextra
 				};
 		}{}%
 		%
@@ -5079,7 +5135,7 @@
 	%{ (\pgfplots at xmax,	\pgfplots at ymax) }
 	{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymax}}\endpgfextra }
 \else
-	decorate [xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}] 
+	decorate [xdiscont,decoration={pre length=\xdisstart, post length=\xdisend}]
 	%{ -- (\pgfplots at xmax,	\pgfplots at ymax) }
 	{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymax}}\endpgfextra }
 \fi
@@ -5087,7 +5143,7 @@
 	%{ (\pgfplots at xmax,	\pgfplots at ymin) }
 	{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymin}}\endpgfextra }
 \else
-	decorate [ydiscont,decoration={pre length=\ydisend, post length=\ydisstart}] 
+	decorate [ydiscont,decoration={pre length=\ydisend, post length=\ydisstart}]
 	%{ -- (\pgfplots at xmax,	\pgfplots at ymin) }
 	{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymin}}\endpgfextra }
 \fi
@@ -5095,7 +5151,7 @@
 	%{ (\pgfplots at xmin,	\pgfplots at ymin) }
 	{ \pgfextra\pgfpathmoveto{\pgfplotsqpointxy{\pgfplots at xmin}{\pgfplots at ymin}}\endpgfextra }
 \else
-	decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}] 
+	decorate [xdiscont,decoration={pre length=\xdisend, post length=\xdisstart}]
 	%{ -- (\pgfplots at xmin,	\pgfplots at ymin) }
 	{ \pgfextra\pgfpathlineto{\pgfplotsqpointxy{\pgfplots at xmin}{\pgfplots at ymin}}\endpgfextra }
 \fi
@@ -5203,7 +5259,7 @@
 			% 	}
 			% }
 			% to get the different indices into the cycle lists.
-			%-------------------------------------------------- 
+			%--------------------------------------------------
 			\c at pgf@counta=\pgfplots at cycle@dim\relax
 			\c at pgf@countb=\pgfplots at listindex\relax
 			\advance\c at pgf@counta by-1
@@ -5235,7 +5291,7 @@
 				% =\pgfplots at listindex
 				\if A\pgfplots at cycle@multi at list@repeat
 					% 'cycle multiindex list'
-					% 
+					%
 					% ensure that we respect the maxlen of the list:
 					\pgfplotsmathmodint{\pgfplots at listindex}{\pgfkeysvalueof{/pgfplots/cycle multi list/@maxlen}}%
 					\let\pgfplots at listindex=\pgfmathresult
@@ -5317,7 +5373,7 @@
 	% 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. 
+	% level output.
 	%
 	% This here works:
 	% 1. set them to activate plot handlers and parameters like
@@ -5324,7 +5380,7 @@
 	% samples and domain:
 	\tikzset{#1}%
 	%
-	% 2. we need to remember all these options inside of 
+	% 2. we need to remember all these options inside of
 	% 'current plot style' -- otherwise, they would not appear
 	% inside of legend images and markers.
 	\pgfplotssurveyphaseaddoptionsbeforesurveybegins{#1}%
@@ -5384,8 +5440,8 @@
 	\fi
 }
 \def\pgfplots at path@closed at cycle@std{%
-	|- (perpendicular cs: 
-		vertical line through={(current plot begin)}, 
+	|- (perpendicular cs:
+		vertical line through={(current plot begin)},
 		horizontal line through={(\pgfplots at ZERO@x,\pgfplots at ZERO@y)})
 	-- cycle
 }%
@@ -5464,7 +5520,7 @@
 %
 % In contrast to \path, \pgfplotsextra can contain any command(s).
 %
-% Syntax: either 
+% Syntax: either
 % \pgfplotsextra{<argument>}
 % or
 % \pgfplotsextra <argument> \endpgfplotsextra
@@ -5684,7 +5740,7 @@
 % It is called within legend's cell pictures in order to undo global
 % settings like stroke colors or the-like.
 \def\pgfplots at restore@state at before@legend at style{%
-	\pgfsetfillcolor{black}% 
+	\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.
@@ -5731,7 +5787,7 @@
 			\pgfplots at transposelegend
 		\fi
 		%
-		% 
+		%
 		\begingroup
 			\ifx\pgfplots at createlegend@toname\pgfutil at empty
 				% ok, draw legend.
@@ -5748,7 +5804,7 @@
 					\let##1=\pgfplotsretval
 				}%
 			\fi
-			% assemble a 
+			% assemble a
 			% \matrix {
 			% 	small plot  & legend1\\
 			% 	small plot  & legend2\\
@@ -5763,7 +5819,7 @@
 			% }
 			% ( I have allocated the token registers in my
 			% liststructure.sty)
-			% 
+			%
 			% \global\def\pgfplots at glob@TMPa{
 			% 	\matrix {
 			% 		\TOKL at TA
@@ -5807,11 +5863,11 @@
 					%
 					% and the legend image into \t at pgfplots@tokb:
 					\t at pgfplots@tokb=\expandafter{\pgfplotsretval}%
-					% ok. Now, the 
+					% ok. Now, the
 					% - 'b' register contains the IMAGE and
 					% - 'c' register contains the TEXT
 					\ifcase\legendplotpos
-						% legend plot pos=left 
+						% legend plot pos=left
 						\edef\pgfplots at matrixentry{%
 							\the\t at pgfplots@tokb
 							\noexpand\pgfmatrixnextcell
@@ -5933,7 +5989,7 @@
 	}%
 }
 
-% Defines a new \label{#1}. When \ref{#1} is used, the code 
+% Defines a new \label{#1}. When \ref{#1} is used, the code
 % \csname #3#2\endcsname
 % will be invoked.
 % \pgfplots at label[<optional prefix>]{<label name>}{<command prefix>}
@@ -5974,7 +6030,7 @@
 		% this is a work-around to support the mcaption class: it
 		% simply remembers the label name and invokes \label later-on.
 		% This appears to be wrong in this context: I want to generate
-		% a pgfplots label. 
+		% a pgfplots label.
 		%
 		% If someone writes \label{fig:one}, that label will be
 		% redeclared in the margin - which appears to be correct. And
@@ -6162,7 +6218,7 @@
 	\def\bool at pgfplots@loc at enlargelimits@min{0}%
 	\def\bool at pgfplots@loc at enlargelimits@max{0}%
 	%
-	% we can either enlarge 
+	% we can either enlarge
 	% ... using a relative limit (like 0.1 -> 10%)
 	\def\pgfplots at enlargelimits@relthresh{0.1}% the default
 	% ...or an absolute limit ( like 4 units)
@@ -6171,8 +6227,8 @@
 	%
 	% Relative and absolute values are relatively simple: we only need to compute and
 	% add the changes to the already existing limits. The value with
-	% an absolute dimension is surprisingly complicated. 
-	% 
+	% an absolute dimension is surprisingly complicated.
+	%
 	% The problem is: enlargelimits has to be computed before the
 	% image has been scaled into its final size. This is not merely a
 	% technical problem; this is how one wants it to be!
@@ -6227,7 +6283,7 @@
 % This here needs a different treatment because "enlarge x limits={abs=1cm}"
 % has to be applied AFTER the scaling is complete. To this end, it is
 % applied as the very last scaling step. It is applied after any post
-% scales, and it only modifies axis limits. 
+% scales, and it only modifies axis limits.
 %
 % #1: x,y, or z
 % #2: 1 if the lower limit shall be enlarged, 0 if not
@@ -6242,10 +6298,10 @@
 \let\pgfplots at enlargelimits@absdimension at y=\pgfutil at empty
 \let\pgfplots at enlargelimits@absdimension at z=\pgfutil at empty
 
-% Called as soon as the scaling is completely set up and any 
+% Called as soon as the scaling is completely set up and any
 % "enlarge #1 limits={abs=1cm}"
 % enlargements shall be done, i.e. enlargement by unit.
-% 
+%
 % #1: x,y, or z
 \def\pgfplots at scaling@apply at enlargelimits@by at dimension#1{%
 	\expandafter\ifx\csname pgfplots at enlargelimits@absdimension@#1\endcsname\pgfutil at empty
@@ -6261,12 +6317,12 @@
 }%
 
 
-% PRECONDITION: 
+% PRECONDITION:
 %   1. width/height are set
 %   2. the unit vectors point indicate whether the axis is a standard
 %   box or some skewed plot (their precise direction and magnitude is
 %   irrelevant)
-%   3. the enlargelimits code has already evaluated the case 
+%   3. the enlargelimits code has already evaluated the case
 %   "enlargelimits={abs=1cm}"
 %
 % POSTCONDITION:
@@ -6273,7 +6329,7 @@
 % 	width and/or height might be modified
 \def\pgfplots at scaling@changewidthheight at for@enlargelimits at by@dimension{%
 	\ifpgfplots at enlargelimits@respect at figure@size
-		% 
+		%
 		% decide if we need to do anything at all, i.e. if there IS
 		% some option 'enlarge * limits={abs=1cm}' :
 		\pgfplots at loc@tmpfalse
@@ -6328,9 +6384,9 @@
 				\def\pgfplots at loc@TMPc{{1}{1}}%
 				%
 				% ah - we really *have* a standard boxed axis.
-				% Compute 
+				% Compute
 				% newwidth  = width - enlargevalue
-				% newheight = height - enlargevalue 
+				% newheight = height - enlargevalue
 				%
 				% newwidth will be stored in \pgfplots at loc@TMPa
 				% and newheight in \pgfplots at loc@TMPb
@@ -6383,7 +6439,7 @@
 	\fi
 }
 
-% this here applies changes required for 'enlarge #1 limits={abs=1cm}', i.e. 
+% this here applies changes required for 'enlarge #1 limits={abs=1cm}', i.e.
 % for the case of numbers with units.
 %
 % The main difference is that it is applied AFTER the scaling of the
@@ -6451,7 +6507,7 @@
 		\edef\enlargeabsolute{\pgf at sys@tonumber{\pgf at xb}}%
 	\fi
 	\ifdim\pgf at xb>0.001pt
-		% the case with 
+		% the case with
 		%   enlargeabsolute ~= 0
 		% means that \pgfplots@@min ~= \pgfplots@@max.
 		% It is handled in another method.
@@ -6654,7 +6710,7 @@
 		\ifx\pgfplots at data@zmin\pgfplots at invalidrange@zmax
 			\global\let\pgfplots at data@zmax=\pgfplots at zmax
 		\fi
-		\ifpgfplots at clip@limits
+		\ifpgfplots at clip@limits at x
 		\else
 			% there is a rare change that min > max.
 			% Handle that ...
@@ -6662,11 +6718,17 @@
 			\global\let\pgfplots at xmin=\pgfmathresult
 			\pgfplotscoordmath{x}{max}{\pgfplots at xmin}{\pgfplots at xmax}%
 			\global\let\pgfplots at xmax=\pgfmathresult
+		\fi
+		\ifpgfplots at clip@limits at y
+		\else
 			%
 			\pgfplotscoordmath{y}{min}{\pgfplots at ymin}{\pgfplots at ymax}%
 			\global\let\pgfplots at ymin=\pgfmathresult
 			\pgfplotscoordmath{y}{max}{\pgfplots at ymin}{\pgfplots at ymax}%
 			\global\let\pgfplots at ymax=\pgfmathresult
+		\fi
+		\ifpgfplots at clip@limits at z
+		\else
 			%
 			\ifpgfplots at threedim
 				\pgfplotscoordmath{z}{min}{\pgfplots at zmin}{\pgfplots at zmax}%
@@ -6684,7 +6746,7 @@
 % This method finishes the accumulated information of axis limits and
 % all internal flag fields.
 %
-% PRECONDITION:  
+% PRECONDITION:
 % 	- all plots are finally finished; axis and data limits are known.
 %
 % POSTCONDITION:
@@ -6750,6 +6812,9 @@
 	\global\let\pgfplots at firstplot@coords at z=\pgfutil at empty
 	%
 	\pgfplots at limits@ready
+	%
+	\pgfplots at set@options at after@survey1%
+	%
 	\pgfplotspoint at initialisation
 	%
 	%
@@ -6792,7 +6857,7 @@
 
 \def\pgfplots at init@axis at shift{%
 	\pgfplotsforeachentryinCSV{\pgfplots at loc@TMPa}{x,y,z}{%
-		% check if 'axis #1 line shift' is set and non-zero. 
+		% check if 'axis #1 line shift' is set and non-zero.
 		\expandafter\pgfplots at if@has at axis@shift\pgfplots at loc@TMPa{%
 			\pgfkeysgetvalue{/pgfplots/axis \pgfplots at loc@TMPa\space line shift}\pgfplots at loc@TMPb
 			\pgfmathparse{\pgfplots at loc@TMPb}%
@@ -6839,7 +6904,7 @@
 					\pgfplots at separate@axis at linestrue
 				\fi
 			\fi
-			% 
+			%
 			% normalize the value - no need to parse it over and over again:
 			\pgfkeyslet{/pgfplots/axis \pgfplots at loc@TMPa\space line shift}\pgfplots at loc@TMPb
 		}{}%
@@ -6883,10 +6948,25 @@
 			\expandafter\def\csname pgfplots@#1ticklabel\endcsname{\axisdefaultticklabel}%
 		}{%
 			\expandafter\def\csname pgfplots@#1ticklabel\endcsname{\axisdefaultticklabellog}%
-		}% 
+		}%
 	\fi
 	\expandafter\ifx\csname pgfplots at extra@#1ticklabel\endcsname\pgfutil at empty
-		\pgfutil at namelet{pgfplots at extra@#1ticklabel}{pgfplots@#1ticklabel}%
+		\pgfutil at namelet{pgfplots at loc@TMPa}{pgfplots@#1ticklabel}%
+		\pgfutil at namelet{pgfplots at loc@TMPb}{pgfplots at user@ticklabel at list@#1}%
+		\ifx\pgfplots at loc@TMPa\pgfplots at loc@TMPb
+			% Ah - someone used '#1ticklabels' (or its friends).
+			% these are bound to specific positions and make no sense in this context.
+			\pgfplots at if{pgfplots@#1islinear}{%
+				\expandafter\def\csname pgfplots at extra@#1ticklabel\endcsname{\axisdefaultticklabel}%
+			}{%
+				\expandafter\def\csname pgfplots at extra@#1ticklabel\endcsname{\axisdefaultticklabellog}%
+			}%
+		\else
+			% inherit the global argument of '#1ticklabel' -- it will probably contain generic code to
+			% typeset labels at any positions.
+			% The "probably" is a buest-guess, though...
+			\pgfutil at namelet{pgfplots at extra@#1ticklabel}{pgfplots@#1ticklabel}%
+		\fi
 	\fi
 	%
 	\if0\csname pgfplots@#1axislinesnum\endcsname\else
@@ -7114,7 +7194,7 @@
 % Note that the shift in T is not of interest, we only deal with
 % T_a(x) = 10^{s_a} x.
 %
-% Thus, this routine invokes #3 if 
+% Thus, this routine invokes #3 if
 % ( 10^{s1} * veclen1 < 10^{s2} * veclen2 )
 %   <=>
 % ( 10^{s1-s2} * veclen1 < veclen2 ).
@@ -7300,7 +7380,7 @@
 		\pgfpointintersectionoflines
 			{\origin}
 			{\pgfpointadd{\origin}{%
-					\innerdiagonal\global\pgf at x=0sp 
+					\innerdiagonal\global\pgf at x=0sp
 					 \pgfplots at assert@not at zero{\pgf at y}{y axis has eyy=0; cannot compute above origin anchor}%
 				}%
 			}%
@@ -7741,7 +7821,7 @@
 
 
 % Defines a new axis type `#1' with initialization code `#2'.
-% 
+%
 % The name #1 will be available as value for 'axis type=#1' and
 % furthermore, an environment '\begin{#1axis}'  will be available.
 %
@@ -7952,7 +8032,7 @@
 				% have called
 				% \pgfplots at draw@axis again.
 				% The difference is in the
-				% \pgfplotsifaxissurfaceisforeground checks. 
+				% \pgfplotsifaxissurfaceisforeground checks.
 				% Furthermore, I have removed the case distinctions for
 				% the different axis line combinations.
 	%\if10
@@ -8110,7 +8190,7 @@
 % 	- 'vv0' 'vv1'
 % 	- 'v0v' 'v1v'
 % 	' '0vv' '1vv'
-% 
+%
 % @see \pgfplotspointonorientedsurfaceabmatchaxisline for details
 % about those three-character ids.
 %
@@ -8142,9 +8222,9 @@
 %
 % The operation is relatively fast.
 \def\pgfplots at decide@which at figure@surfaces at are@drawn{%
-	\expandafter\def\csname pgfplots at surfviewdepth@2vv\endcsname{f}% 
-	\expandafter\def\csname pgfplots at surfviewdepth@v2v\endcsname{f}% 
-	\expandafter\def\csname pgfplots at surfviewdepth@vv2\endcsname{f}% 
+	\expandafter\def\csname pgfplots at surfviewdepth@2vv\endcsname{f}%
+	\expandafter\def\csname pgfplots at surfviewdepth@v2v\endcsname{f}%
+	\expandafter\def\csname pgfplots at surfviewdepth@vv2\endcsname{f}%
 	\ifpgfplots at threedim
 		\pgfplotsmathvectortocomponents\pgfplots at view@dir at threedim{pgfplots at loc@}{default}%
 		% respect reversed axes here. If I am not mistaken, it should
@@ -8153,22 +8233,22 @@
 			\expandafter\def\csname pgfplots at surfviewdepth@0vv\endcsname{f}% foreground
 			\expandafter\def\csname pgfplots at surfviewdepth@1vv\endcsname{b}% background
 		}{%
-			\expandafter\def\csname pgfplots at surfviewdepth@0vv\endcsname{b}% 
-			\expandafter\def\csname pgfplots at surfviewdepth@1vv\endcsname{f}% 
+			\expandafter\def\csname pgfplots at surfviewdepth@0vv\endcsname{b}%
+			\expandafter\def\csname pgfplots at surfviewdepth@1vv\endcsname{f}%
 		}%
 		\pgfplotscoordmath{default}{if is}{\pgfplots at loc@y}{\if\pgfkeysvalueof{/pgfplots/y dir/value}n+\else-\fi}{%
 			\expandafter\def\csname pgfplots at surfviewdepth@v0v\endcsname{f}% foreground
 			\expandafter\def\csname pgfplots at surfviewdepth@v1v\endcsname{b}% background
 		}{%
-			\expandafter\def\csname pgfplots at surfviewdepth@v0v\endcsname{b}% 
-			\expandafter\def\csname pgfplots at surfviewdepth@v1v\endcsname{f}% 
+			\expandafter\def\csname pgfplots at surfviewdepth@v0v\endcsname{b}%
+			\expandafter\def\csname pgfplots at surfviewdepth@v1v\endcsname{f}%
 		}%
 		\pgfplotscoordmath{default}{if is}{\pgfplots at loc@z}{\if\pgfkeysvalueof{/pgfplots/z dir/value}n+\else-\fi}{%
 			\expandafter\def\csname pgfplots at surfviewdepth@vv0\endcsname{f}% foreground
 			\expandafter\def\csname pgfplots at surfviewdepth@vv1\endcsname{b}% background
 		}{%
-			\expandafter\def\csname pgfplots at surfviewdepth@vv0\endcsname{b}% 
-			\expandafter\def\csname pgfplots at surfviewdepth@vv1\endcsname{f}% 
+			\expandafter\def\csname pgfplots at surfviewdepth@vv0\endcsname{b}%
+			\expandafter\def\csname pgfplots at surfviewdepth@vv1\endcsname{f}%
 		}%
 	\else
 		% FIXME : it might be better to implement that stuff here
@@ -8175,13 +8255,13 @@
 		% implicilty using the 3D algorithms.
 		%
 		% this here is the only important one:
-		\expandafter\def\csname pgfplots at surfviewdepth@vv0\endcsname{b}% 
+		\expandafter\def\csname pgfplots at surfviewdepth@vv0\endcsname{b}%
 		%
-		\expandafter\def\csname pgfplots at surfviewdepth@0vv\endcsname{b}% 
-		\expandafter\def\csname pgfplots at surfviewdepth@1vv\endcsname{f}% 
-		\expandafter\def\csname pgfplots at surfviewdepth@v0v\endcsname{b}% 
-		\expandafter\def\csname pgfplots at surfviewdepth@v1v\endcsname{f}% 
-		\expandafter\def\csname pgfplots at surfviewdepth@vv1\endcsname{f}% 
+		\expandafter\def\csname pgfplots at surfviewdepth@0vv\endcsname{b}%
+		\expandafter\def\csname pgfplots at surfviewdepth@1vv\endcsname{f}%
+		\expandafter\def\csname pgfplots at surfviewdepth@v0v\endcsname{b}%
+		\expandafter\def\csname pgfplots at surfviewdepth@v1v\endcsname{f}%
+		\expandafter\def\csname pgfplots at surfviewdepth@vv1\endcsname{f}%
 		\def\pgfplotsifaxislineisonconvexhull##1##2##3{##2}% ALWAYS TRUE
 		\def\pgfplots at ifaxisline@B at onorientedsurf@should at be@drawn@##1##2##3{##2}% ALWAYS TRUE
 		%
@@ -8189,7 +8269,7 @@
 }
 
 % Initialises the 'pgfplots@[xyz]ticklabelaxisspecs' macro according to
-% the foreground/background situation of the axis and the '[xyz]ticklabel pos' 
+% the foreground/background situation of the axis and the '[xyz]ticklabel pos'
 % keys.
 \def\pgfplots at init@ticklabelaxisspec{%
 	\ifpgfplots at threedim
@@ -8229,14 +8309,14 @@
 % It does NOT work outside of it.
 %
 % It initialises the 'pgfplots@#1ticklabelaxisspec' macro according to
-% the foreground/background situation of the axis and the '#1ticklabel pos' 
+% the foreground/background situation of the axis and the '#1ticklabel pos'
 % key.
 %
 % #1: the axis: x,y or z
 % #2: either x or y. It refers to the PROJECTED coordinate which
-% should be used to compare the 'lower' and 'upper' arguments of the 
+% should be used to compare the 'lower' and 'upper' arguments of the
 % |[xyz]ticklabel pos| key.
-%  
+%
 % PRECONDITION:
 % 	\pgfplots at tmp@center[xy] is set.
 %
@@ -8286,7 +8366,7 @@
 		% }{%
 		% 	\pgfplots at 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.
@@ -8350,7 +8430,7 @@
 		% 		\expandafter\def\csname pgfplots@#1tickposnum\endcsname{3}% set to 'right'
 		% 	\fi
 		% \fi
-		%-------------------------------------------------- 
+		%--------------------------------------------------
 		\if l\csname pgfplots@#1ticklabel at pos\endcsname
 			\expandafter\edef\csname pgfplots@#1ticklabelaxisspec\endcsname{\pgfplots at loc@to at threedim 1}%
 		\fi
@@ -8372,7 +8452,7 @@
 
 % Processes every tick mark in direction #1 and draws tick lines, tick
 % labels, grid lines, axis lines and extra ticks.
-% 
+%
 % #1 : the direction into which tick positions are processed.
 % #2 : the direction in which tick lines and grid lines shall be drawn.
 % #3 : the direction which is currently fixed.
@@ -8500,7 +8580,7 @@
 % certainly use a different style for axis labels than the default 2d
 % style.
 %
-% Thus, all style changes which are relevant for 'every 3d description' 
+% Thus, all style changes which are relevant for 'every 3d description'
 % have NOT YET been processed (they have been appended to 'every axis').
 \def\pgfplots at BEGIN@prepare at description@styles{%
 	\ifpgfplots at threedim
@@ -8521,7 +8601,7 @@
 
 
 % Shortcut for '\pgfplotsset{set layers={#1}}'.
-%	
+%
 % USAGE:
 % 1. \pgfplotssetlayers{<layer config name>} (one declared with /.define layer set)
 % 2. \pgfplotssetlayers (no braces)
@@ -8545,7 +8625,7 @@
 %   - a \pgfsetlayers{<list>} is issued (immediately)
 %   - '/pgfplots/@set layers arg' is defined such that any following axes can initialized their layers.
 \def\pgfplots at key@set at layers#1{%
-	% 
+	%
 	% auto detect if '#1' is a defined layer set:
 	\pgfkeysifdefined{#1/list}{%
 		\def\pgfkeyscurrentname{#1}%
@@ -8704,10 +8784,10 @@
 
 % 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.
 %
 % A posteriori shifting == anchors whose dimensions are not fixed
-% until the complete axis has been "typeset". 
+% 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
@@ -8733,7 +8813,7 @@
 		%
 		% FIXME : do we need to renormalize this here? apparently
 		% not...
-		%\def\pgfplots at anchorname{image}% 
+		%\def\pgfplots at anchorname{image}%
 		%
 		\let\pgfplots at BEGIN@cell at picture=\pgfplots at BEGIN@cell at picture@DISABLED
 		\let\pgfplots at END@cell at picture=\pgfplots at END@cell at picture@DISABLED
@@ -8741,10 +8821,10 @@
 		\let\pgfplots at finally@correct at child@node at positions=\relax
 		%
 		% translate the coordinate system before the 'current axis'
-		% node is generated. 
+		% node is generated.
 		\expandafter\def\expandafter\pgfplots at beforenode\expandafter{\pgfplots at beforenode
 			\setbox\pgfnodepartimagebox=\hbox{}%
-		}%	
+		}%
 	}%
 }
 
@@ -8782,7 +8862,7 @@
 	\pgfplots at 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). 
+	% path/plot commands).
 	\pgfmultipartnode{pgfplots at low@level at shape@INNER}{image}{current axis}{\pgfusepath{discard}}%
 	\endgroup
 }%
@@ -8860,7 +8940,7 @@
 	%
 	%
 	% \pgfplotspointorigininternal:
-	% used for anchor=<some node inside of the axis> and for 
+	% used for anchor=<some node inside of the axis> and for
 	% 'cell picture=true' in order to correct remembered node positions:
 	\xdef\pgfplotspointorigininternal{\global\pgf at x=\the\pgf at picminx\space\global\pgf at y=\the\pgf at picminy\space}%
 	%
@@ -9026,12 +9106,12 @@
 					% - 00v
 					% - 0v0
 					% - v00
-					% so, use 
+					% so, use
 					%    010 (01v) 011
 					%    011 (0v1) 001
 					%    001 (v01) 101
 					%    101 (10v) 100
-					%    100 (1v0) 110 
+					%    100 (1v0) 110
 					%    110 (v10) 011 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmin}{\pgfplots at ymax}{\pgfplots at zmin}}%
@@ -9050,10 +9130,10 @@
 					% - 00v
 					% - 0v1
 					% - v01
-					% so, use 
+					% so, use
 					%    010 (01v) 011
-					%    011 (v11) 111   
-					%    111 (1v1) 101 
+					%    011 (v11) 111
+					%    111 (1v1) 101
 					%    101 (10v) 100
 					%    100 (v00) 000
 					%    000 (0v0) 010 (cycle)
@@ -9077,11 +9157,11 @@
 					% - 0v0
 					% - v10
 					% so, use
-					%   000  (00v) 001   
-					%   001  (0v1) 011   
-					%   011  (v11) 111   
-					%   111  (11v) 110   
-					%   110  (1v0) 100   
+					%   000  (00v) 001
+					%   001  (0v1) 011
+					%   011  (v11) 111
+					%   111  (11v) 110
+					%   110  (1v0) 100
 					%   100  (v00) 000 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmin}{\pgfplots at ymin}{\pgfplots at zmin}}%
@@ -9101,11 +9181,11 @@
 					% - 0v1
 					% - v11
 					% so, use
-					%   000  (00v) 001   
-					%   001  (v01) 101   
-					%   101  (1v1) 111   
-					%   111  (11v) 110   
-					%   110  (v10) 010   
+					%   000  (00v) 001
+					%   001  (v01) 101
+					%   101  (1v1) 111
+					%   111  (11v) 110
+					%   110  (v10) 010
 					%   010  (0v0) 000 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmin}{\pgfplots at ymin}{\pgfplots at zmin}}%
@@ -9129,11 +9209,11 @@
 					% - 1v0
 					% - v00
 					% So, use
-					%   110 (11v) 111   
-					%   111 (1v1) 101   
-					%   101 (v01) 001   
-					%   001 (00v) 000   
-					%   000 (0v0) 010   
+					%   110 (11v) 111
+					%   111 (1v1) 101
+					%   101 (v01) 001
+					%   001 (00v) 000
+					%   000 (0v0) 010
 					%   010 (v10) 110 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmax}{\pgfplots at ymax}{\pgfplots at zmin}}%
@@ -9152,11 +9232,11 @@
 					% - 1v1
 					% - v01
 					% So, use
-					%   110 (11v) 111   
-					%   111 (v11) 011   
-					%   011 (0v1) 001   
-					%   001 (00v) 000   
-					%   000 (v00) 100   
+					%   110 (11v) 111
+					%   111 (v11) 011
+					%   011 (0v1) 001
+					%   001 (00v) 000
+					%   000 (v00) 100
 					%   100 (1v0) 110 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmax}{\pgfplots at ymax}{\pgfplots at zmin}}%
@@ -9177,11 +9257,11 @@
 					% - 1v0
 					% - v10
 					% So, use
-					%   100 (10v) 101   
-					%   101 (1v1) 111   
-					%   111 (v11) 011   
-					%   011 (01v) 010   
-					%   010 (0v0) 000   
+					%   100 (10v) 101
+					%   101 (1v1) 111
+					%   111 (v11) 011
+					%   011 (01v) 010
+					%   010 (0v0) 000
 					%   000 (v00) 100 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmax}{\pgfplots at ymin}{\pgfplots at zmin}}%
@@ -9200,11 +9280,11 @@
 					% - 1v1
 					% - v11
 					% So, use
-					%   100 (10v) 101   
-					%   101 (v01) 001   
-					%   001 (0v1) 011   
-					%   011 (01v) 010   
-					%   010 (v10) 110   
+					%   100 (10v) 101
+					%   101 (v01) 001
+					%   001 (0v1) 011
+					%   011 (01v) 010
+					%   010 (v10) 110
 					%   110 (1v0) 100 (cycle)
 					\def\pgfplots at clippath@install##1{%
 						\pgfpathmoveto{\pgfplotsqpointxyz{\pgfplots at xmax}{\pgfplots at ymin}{\pgfplots at zmin}}%
@@ -9219,7 +9299,7 @@
 				}%
 			}%
 		}%
-				
+
 	\else
 		\pgfplotsqpointxy{\pgfplots at xmin}{\pgfplots at ymin}%
 		\edef\pgfplots at loc@TMPa{\global\pgf at x=\the\pgf at x\space\global\pgf at y=\the\pgf at y\space}%
@@ -9329,9 +9409,9 @@
 }%
 \def\pgfplots at clippath@install at test{\pgfusepath{clip}}%
 
-% This is the main part of the implementation for 
+% This is the main part of the implementation for
 % 'clip bounding box=upper bound' : it collects the bounding box of everything inside of
-% the clipped area. Then in the associated \endscope, it clips that bounding box to the expected 
+% the clipped area. Then in the associated \endscope, it clips that bounding box to the expected
 % clip path -- and protocols that size.
 \def\pgfplots at clippath@install at BB@upper at bound{%
 	\tikzset{
@@ -9747,17 +9827,17 @@
 		{\pgfplots at evalute@tikz at coord@system at interface@x[]}%
 }
 
-% In case of (semi-) logplots, this command will 
+% In case of (semi-) logplots, this command will
 % - assign a filter which invokes \pgfmathlog@{} for each coordinate
 % - replace any user-specified coordinate by its log.
 %
 % All subsequent commands will then work with logarithmic coordinates.
 %
-% PRECONDITION: 
-% - The user input options have been set correctly, 
+% PRECONDITION:
+% - The user input options have been set correctly,
 % - the options have been set, but are not applied
 %
-% POSTCONDITION: 
+% POSTCONDITION:
 % - any user input has been parsed
 % - any user input for log-axis has been replaced by its log if
 %   necessary
@@ -9779,9 +9859,9 @@
 		\expandafter\edef\csname pgfplots at prepare@#1coord\endcsname##1{%
 			% do not expand it here - might contain unexpandable
 			% material which is processed by the #1 coord trafo:
-			% FIXME : this might produce an endless loop if ##1 = \pgfmathresult! 
+			% FIXME : this might produce an endless loop if ##1 = \pgfmathresult!
 			\noexpand\def\noexpand\pgfmathresult{##1}%
-			% this becomes 
+			% this becomes
 			\expandafter\noexpand\csname pgfplots at highlevel@trafo@#1\endcsname{##1}\noexpand\pgfeov
 			%
 			% ensure that it is expanded.
@@ -9911,7 +9991,7 @@
 				%
 				% generate default ticks in the 'log basis', not base 10:
 				\pgfplotsset{/pgfplots/log basis ticks=#1}%
-				% 
+				%
 				\ifdim\pgfkeysvalueof{/pgfplots/log basis #1}pt=10pt
 				\else
 					\pgfplots at identify@log at minor@tick at posfalse
@@ -10061,7 +10141,7 @@
 						\else
 							  \pgfplots at show@label{y}{\pgfplots at label@}%
 						\fi
-				  \fi  
+				  \fi
 	\fi
 	\ifpgfplots at threedim
 		\ifpgfplots at hide@z
@@ -10140,7 +10220,7 @@
 	%
 	\pgfnodealias{parent axis}{current axis}%
 	%
-	% FIXME : 
+	% FIXME :
 	% I would really prefer to find a different way to move these
 	% variables out of the current scope. But expansion leads to
 	% mistakes with '#' characters ... :-(
@@ -10248,7 +10328,7 @@
 			\noexpand\expandafter
 			\noexpand\gdef\noexpand\csname pgfplots at colorbar@to at name@\pgfplots at colorbar@toname\endcsname{\the\toks0}}%
 		\xdef#1{}% NOP.
-		% 
+		%
 		% make sure \ref{<colorbarname>} works:
 		\pgfplots at label{\pgfplots at colorbar@toname}{pgfplots at colorbar@to at name@}%
 	\fi
@@ -10291,7 +10371,7 @@
 					\def\pgfplots at loc@TMPa{cmyk}%
 					\ifx\pgfplots at loc@TMPa\pgfplotsretval
 						\pgfutil at ifundefined{pgfplots at colorbar@CMYK@\pgfplots at loc@TMPb}{%
-							\pgfplotswarning{colorbar CMYK unsupported}{\pgfplots at loc@TMPb}\pgfeov% 
+							\pgfplotswarning{colorbar CMYK unsupported}{\pgfplots at loc@TMPb}\pgfeov%
 							\expandafter\gdef\csname pgfplots at colorbar@CMYK@\pgfplots at loc@TMPb\endcsname{1}%
 						}{}%
 						\def\b at pgfplots@colorbar at fallback@to at sampled{1}%
@@ -10330,7 +10410,7 @@
 	\pgfplotsset{%
 		/pgfplots/every axis plot post/.append code={%
 			\ifpgfplots at collect@firstplot at astick
-				% Oh! Someone wrote 'ytick=data. We want the precise positions. 
+				% Oh! Someone wrote 'ytick=data. We want the precise positions.
 				%
 				% Note that this check needs to be done late: it must
 				% be after \begin{axis} -- and since many colorbar
@@ -10494,16 +10574,16 @@
 
 % Parses all options in #1 which are known in the currently active families.
 %
-% The result will be stored back into the TikZ-style named #1 without 
+% The result will be stored back into the TikZ-style named #1 without
 % further processing.
 %
 % Example:
 % \tikzstyle{every axis}=[xmin=0,xmax=1,line width=1pt
 % \pgfplots at set@keys at from@tikz at style\tmpmacro{every axis}{/pgfplots}
-% 
+%
 % - sets axis options 'xmin' and 'xmax'
 % - calls \tikzstyle{every axis}={line width=1pt}
-% 
+%
 % I assume that this method is called within local TeX groups so
 % nothing will be destroyed outside.
 %
@@ -10755,7 +10835,7 @@
 	%
 	\pgfplots at set@options at of@layered at graphics
 	%
-	% Now, any 'name' and 'alias' options have been processed. 
+	% Now, any 'name' and 'alias' options have been processed.
 	%
 	% Remember their current meaning and reset the tikz options!
 	\let\pgfplots at fig@name=\tikz at fig@name
@@ -10824,7 +10904,7 @@
 	% \pgfkeysactivatefamily{/pgfplots}%
 	% 	\pgfplots at set@keys at from@tikz at style{every axis plot}%
 	% \pgfkeysdeactivatefamily{/pgfplots}%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	%
 	% Attention: do NOT set the description styles here! Setting them
 	% must be postponed until |every 3d description| has been set (to
@@ -10874,7 +10954,7 @@
 	\pgfkeysifdefined{/tikz/on layer}{}{%
 		% make sure assignments 'on layer' in the /tikz/ prefix
 		% doesn't hurt.
-		% this may happen, for example with 
+		% 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).
@@ -10939,7 +11019,7 @@
 	\pgfkeysifdefined{/tikz/name path/. at cmd}{%
 		% 'name path' does not work inside of a pgfplots axis because
 		% pgfplots unnecessarily introduces extra \scopes around each path :-/
-		% it needs to be 'name path global'. 
+		% it needs to be 'name path global'.
 		% PATCH IT:
 		\pgfkeysgetvalue{/tikz/name path global/. at cmd}\pgfplots at loc@TMPa%
 		\ifx\pgfplots at loc@TMPa\pgfplots at name@path at global@cmd at pgf@two at ten
@@ -11089,7 +11169,7 @@
 %
 % This macro is used inside for \label{} / \ref{}; it tries to be
 % reasonable smart about restoring relevant flags stored in a pgfplots
-% axis. If it forgets something... well, it is not too smart. 
+% axis. If it forgets something... well, it is not too smart.
 %
 % #1: the style to export.
 % #2: either empty or the fully qualified name of a code key. If #2 is not empty,
@@ -11101,7 +11181,7 @@
 % The exported routine autodetects whether the result is used inside of
 % a picture. In that case, the '#2' style will be set inside of a
 % scope instead of \tikz[#2].
-% 
+%
 % Assembles a macro \pgfplotsretval which, upon execution, draws the
 % plot style.
 %
@@ -11189,9 +11269,9 @@
 % The implementation for \label{foo} after \addplot. It allows to
 % \ref{foo} (it inserts the 'legend image code').
 %
-% With 
+% With
 % \addplot[scatter/classes={a={}}] ... ;
-% \label[a]{my label}  
+% \label[a]{my label}
 % you can reference scatter/classes labels.
 %
 % I only need to overwrite '\label'; the rest is done by LaTeX.
@@ -11231,7 +11311,7 @@
 		%
 		% b) \protect . If the resulting \ref{} command occurs within
 		% a "moving argument" like \caption or so, we need to use
-		% proper '\protect'ion. 
+		% proper '\protect'ion.
 		%
 		% this here is the low-level implementation of \ref{#3}. Write it into
 		% the .aux file:
@@ -11265,7 +11345,7 @@
 		}%
 }%
 
-% A helper method which defines 
+% A helper method which defines
 %  `/tikz/current plot style' to be {#1}  --- with properly set key
 %  search paths.
 \def\pgfplots at define@currentplotstyle at as#1{%
@@ -11272,7 +11352,7 @@
 	\pgfkeysdef{/tikz/current plot style}{%
 		\pgfplots at search@also at tikz
 		%
-		% Make sure that 
+		% Make sure that
 		% \addplot[every mark/.append style={...}]
 		% or something like that is interpreted as /tikz/ key:
 		\pgfplots at invoke@pgfkeyscode{/handler config/full or existing/. at cmd}{}% restrict
@@ -11410,13 +11490,16 @@
 			\pgfplotsutil at directlua{%
 				pgfplots.gca = pgfplots.Axis.new();
 				pgfplots.gca.is3d = \pgfplots at boolval{pgfplots at threedim};
-				pgfplots.gca.clipLimits = \pgfplots at boolval{pgfplots at clip@limits};
+				pgfplots.gca.clipLimits = { 
+					\pgfplots at boolval{pgfplots at clip@limits at x},
+					\pgfplots at boolval{pgfplots at clip@limits at y},
+					\pgfplots at boolval{pgfplots at clip@limits at z} };
 				pgfplots.gca.autocomputeAllLimits = \pgfplots at boolval{pgfplots at autocompute@all at limits};
-				pgfplots.gca.autocomputeMin = { 
+				pgfplots.gca.autocomputeMin = {
 					\pgfplots at boolval{pgfplots at autocompute@xmin},
 					\pgfplots at boolval{pgfplots at autocompute@ymin},
 					\pgfplots at boolval{pgfplots at autocompute@zmin} };
-				pgfplots.gca.autocomputeMax = { 
+				pgfplots.gca.autocomputeMax = {
 					\pgfplots at boolval{pgfplots at autocompute@xmax},
 					\pgfplots at boolval{pgfplots at autocompute@ymax},
 					\pgfplots at boolval{pgfplots at autocompute@zmax} };
@@ -11449,7 +11532,7 @@
 % until \end{axis}. During the collect phase, axis limits will be
 % computed.
 %
-% The following variables are accummulated between 
+% The following variables are accummulated between
 % \begin{axis}
 % and
 % \end{axis}:
@@ -11456,7 +11539,7 @@
 %
 % -  \pgfplots@[xyz]min
 %    \pgfplots@[xyz]max
-%    	- These denote the axis limits. 
+%    	- These denote the axis limits.
 %    	- They are always assigned globally.
 %    	- For linear axes, they will be computed in floating point.
 %    	- For log axes, they will be computed using pgf math engine.
@@ -11550,11 +11633,11 @@
 %   	(including the 'pt' suffix).
 %
 % - \ifpgfplots at curplot@threedim
-%   	- valid during an '\addplot' preparation step. 
+%   	- valid during an '\addplot' preparation step.
 % - \ifpgfplots at threedim
 %   	- whether the axis shall be threedimensional.
 %
-% - \pgfplots at currentplot@firstcoord@[xyz] 
+% - \pgfplots at currentplot@firstcoord@[xyz]
 % - \pgfplots at currentplot@lastcoord@[xyz]
 %   	- contains the first/last coordinate of the current plot.
 %   	- assigned globally.
@@ -11747,16 +11830,38 @@
 	\pgfkeyslet{/pgfplots/on layer}\pgfutil at empty
 }
 
-\def\pgfplots at set@options at after@survey{%
-	\pgfkeyssetvalue{/pgfplots/xmin}{\pgfplots at xmin}%
-	\pgfkeyssetvalue{/pgfplots/ymin}{\pgfplots at ymin}%
-	\pgfkeyssetvalue{/pgfplots/zmin}{\pgfplots at zmin}%
-	\pgfkeyssetvalue{/pgfplots/point meta min}{\pgfplots at axiswide@metamin}%
+% #1 if and only if the limits are already ready (sanitized to bounded
+% values and transformed)
+\def\pgfplots at set@options at after@survey#1{%
+	\def\pgfplots at set@options at after@survey@@##1{%
+		\edef\pgfmathresult{\csname pgfplots@##1min\endcsname}%
+		\if1#1%
+			\pgfplotscoordmath{##1}{datascaletrafo inverse}{\pgfmathresult}%
+			\pgfplotscoordmath{##1}{tofixed}{\pgfmathresult}%
+		\else
+			% might be unbounded...
+			\pgfplotscoordmath{##1}{tostring}{\pgfmathresult}%
+		\fi
+		\pgfkeyslet{/pgfplots/##1min}\pgfmathresult
+		%
+		\edef\pgfmathresult{\csname pgfplots@##1max\endcsname}%
+		\if1#1%
+			\pgfplotscoordmath{##1}{datascaletrafo inverse}{\pgfmathresult}%
+			\pgfplotscoordmath{##1}{tofixed}{\pgfmathresult}%
+		\else
+			% might be unbounded...
+			\pgfplotscoordmath{##1}{tostring}{\pgfmathresult}%
+		\fi
+		\pgfkeyslet{/pgfplots/##1max}\pgfmathresult
+	}%
+	\pgfplots at set@options at after@survey@@ x%
+	\pgfplots at set@options at after@survey@@ y%
+	\ifpgfplots at threedim
+		\pgfplots at set@options at after@survey@@ z%
+	\fi
 	%
-	\pgfkeyssetvalue{/pgfplots/xmax}{\pgfplots at xmax}%
-	\pgfkeyssetvalue{/pgfplots/ymax}{\pgfplots at ymax}%
-	\pgfkeyssetvalue{/pgfplots/zmax}{\pgfplots at zmax}%
-	\pgfkeyssetvalue{/pgfplots/point meta max}{\pgfplots at axiswide@metamax}%
+	\pgfkeyslet{/pgfplots/point meta min}{\pgfplots at axiswide@metamin}%
+	\pgfkeyslet{/pgfplots/point meta max}{\pgfplots at axiswide@metamax}%
 }%
 
 % \end{axis} :
@@ -11778,7 +11883,7 @@
 	%
 	\pgfplotssurveyphase at setactiveplothandlers
 	%
-	\pgfplots at set@options at after@survey
+	\pgfplots at set@options at after@survey0%
 	\expandafter\pgfplotsset\expandafter{\pgfplots at late@options}%
 	%
 	\pgfplots at prepare@layered at graphics
@@ -11848,7 +11953,7 @@
 		%
 		\pgfplots at create@axis at descriptions
 	%
-	% this here does \endtikzpicture\endpgfinterruptpicture 
+	% this here does \endtikzpicture\endpgfinterruptpicture
 	% (and stores sizes):
 	\pgfplots at END@cell at picture
 	%
@@ -11862,7 +11967,7 @@
 		\def\pgfplots at loc@TMPa##1{%
 			\pgftransformshift{%
 				% So far, the inner node's position has not been
-				% corrected (that happens in 
+				% corrected (that happens in
 				% \pgfplots at finally@correct at child@node at positions).
 				% Do that here with \pgfplots at saveddimen@picminx:
 				\pgfpointdiff
@@ -11965,9 +12070,9 @@
 			{ \pgf at sys@tonumber\pgf at yx, \pgf at sys@tonumber\pgf at yy },
 			{ \pgf at sys@tonumber\pgf at zx, \pgf at sys@tonumber\pgf at zy } });^^J%
 		\ifpgfplots at threedim
-		axis.viewdir = { 
+		axis.viewdir = {
 			pgfplots.pgftonumber("\pgfplots at loc@x"),
-			pgfplots.pgftonumber("\pgfplots at loc@y"), 
+			pgfplots.pgftonumber("\pgfplots at loc@y"),
 			pgfplots.pgftonumber("\pgfplots at loc@z") };^^J%
 		\fi
 	}%
@@ -12073,6 +12178,7 @@
 %   expanded, i.e. it can be a macro.
 \def\pgfplots at stored@plotlist at visualize@selected at phases#1{%
 	\begingroup
+	\def\pgfplotsaxisplotphase{V}%
 	\pgfplotsonlayer{\pgfkeysvalueof{/pgfplots/on layer}}{a plot or graphical element (or inherited from the axis)}%
 	\pgfkeysvalueof{/pgfplots/execute at begin plot visualization}%
 	\ifpgfplots at threedim
@@ -12239,7 +12345,7 @@
 		\pgfplots at polarxy@#2\@@%
 	\else%
 		\pgfplots at polarxy@#2and #2\@@%
-	\fi%  
+	\fi%
 	\pgfmathparse{#1}%
 	\let\pgfpoint at angle=\pgfmathresult%
 	\pgfmathcos@{\pgfpoint at angle}%
@@ -12264,8 +12370,8 @@
   	% see docs of \pgfplots at tikz@do at arc for a motivation:
 	\pgfplots at disable@directionmath
 	%
-	% ok, now, evaluate the arcs. Since this implements 
-	% 'substitute pgfpoint', we have to evaluate the angles via 
+	% ok, now, evaluate the arcs. Since this implements
+	% 'substitute pgfpoint', we have to evaluate the angles via
 	% 'axis direction cs' ...
 	\let\pgfpointxy=\pgfplotspointaxisdirectionxy
 	\let\pgfpointxyz=\pgfplotspointaxisdirectionxyz
@@ -12414,7 +12520,7 @@
 }%
 
 % Replaces the pdfmark for #1 by that of #2.
-% 
+%
 % Note that when this macro is executed (it resides in the .aux file),
 % the pdfmark for #2 is typically UNDEFINED.
 %
@@ -12428,7 +12534,7 @@
 		% Ok, make a "lazy replace":
 		\expandafter\let\expandafter\pgfplots at glob@TMPa\csname pgf at sys@pdf at mark@pos@#1\endcsname
 		\expandafter\global\expandafter\let\csname pgf at sys@pdf at mark@pos@#1 at old\endcsname=\pgfplots at loc@TMPa%
-		% 
+		%
 		\expandafter\gdef\csname pgf at sys@pdf at mark@pos@#1\endcsname{%
 			% this is the lazy replace, assuming knowledge about how
 			% pgf calls its internal structures :-/

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.markers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.markers.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.markers.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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-2013 by Christian Feuersänger.
@@ -13,17 +13,17 @@
 % 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/>.
 %
 %--------------------------------------------
-	
+
 \def\pgfplots at markers@visphase at name@none{none}%
 \def\pgfplots at markers@visphase at name@afterpath at clipped{afterpath at clipped}%
 \def\pgfplots at markers@visphase at name@afterpath at unclipped{afterpath at unclipped}%
@@ -137,7 +137,7 @@
 	% This sets the \iftikz at mode@draw etc:
 	%\tikz at mode
 	% FIXME: using 'color=blue' will NOT activate filltrue!
-	% So: if 'tikz at mode' *contains* 'fillfalse', I know what to do... 
+	% So: if 'tikz at mode' *contains* 'fillfalse', I know what to do...
 	% but all other cases are not clear
 	%--------------------------------------------------
 	% \iftikz at mode@draw
@@ -152,7 +152,7 @@
 	% 	% even if the markers likes to be filled:
 	% 	\let\pgfusepathqfillstroke=\pgfusepathqstroke
 	% \fi
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	%
 	% this here is the MAIN marker code.
 	% It may be modified if scatter plot is enabled, see below.
@@ -242,7 +242,7 @@
 		% check for clip marker paths:
 		\pgfplotsaxisifcontainspoint{\pgfplots at markers@mark at handler@@{#1}}{}%
 	\else
-		\pgfplots at markers@mark at handler@@{#1}
+		\pgfplots at markers@mark at handler@@{#1}%
 	\fi
 }%
 
@@ -365,4 +365,3 @@
 		\pgfkeyslet{/pgfplots/mark layer}\pgfutil at empty%
 	\fi
 }%
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.revision.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -5,10 +5,10 @@
 \catcode`\:=12
 \catcode`\+=12
 \catcode`\-=12
-\gdef\pgfplotsrevision{1.14}
-\gdef\pgfplotsversion{1.14}
-\gdef\pgfplotsversiondatetime{2016-08-10 20:41:40 +0200}
-\gdef\pgfplotsrevisiondatetime{2016-08-10 20:41:40 +0200}
+\gdef\pgfplotsrevision{1.15}
+\gdef\pgfplotsversion{1.15}
+\gdef\pgfplotsversiondatetime{2017-06-05 20:30:57 +0200}
+\gdef\pgfplotsrevisiondatetime{2017-06-05 20:30:57 +0200}
 \gdef\pgfplots at glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3}
 \xdef\pgfplotsversiondate{\expandafter\pgfplots at glob@TMPa\pgfplotsversiondatetime\relax}
 \xdef\pgfplotsrevisiondate{\expandafter\pgfplots at glob@TMPa\pgfplotsrevisiondatetime\relax}

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplots.scaling.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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.
@@ -13,21 +13,21 @@
 % 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: 
+% PRECONDITION:
 % 	- final axis limits are given in transformed range
 % 	-  \pgfplots at set@default at size@options has been invoked before
-% POSTCONDITION: 
+% 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:
@@ -190,7 +190,7 @@
 }
 
 % Takes azimuth (horizontal angle) '#1' and elongation (vertical
-% angle) '#2' (both in degrees) and computes 
+% angle) '#2' (both in degrees) and computes
 % x,y and z vectors which define the view in the direction
 % defined by '#1' and '#2'.
 %
@@ -197,12 +197,12 @@
 % '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 
+% 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) ];
@@ -213,7 +213,7 @@
 % 	sinaz  cosaz cosel   -sinel cosaz; ...
 % 	0	  sinel         cosel ];
 %
-% Then, we use the rotated XZ plane as viewport, that means 
+% 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
@@ -230,7 +230,7 @@
 %
 % 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]' 
+%   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
@@ -241,7 +241,7 @@
 % - #1 : azimuth ("yaw")
 % - #2 : elevation ("pitch")
 % OUTPUT:
-% - #3 : a macro which will be set to '1' if and only if 
+% - #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 at view@dir at threedim will contain the three components
@@ -353,7 +353,7 @@
 }%
 
 % 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 
+% 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).
 %
@@ -373,7 +373,7 @@
 % 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. 
+% will be scaled as-is.
 %
 % PRECONDITION
 % 	- the x, y and z unit vectors have been set to the proper
@@ -384,7 +384,7 @@
 %	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.
@@ -419,7 +419,7 @@
 % 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. 
+% 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.
@@ -427,12 +427,12 @@
 % #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 at BB@for at plotbox@get at unit@scales at for@limits#1#2#3{%
 	\if1\b at pgfplots@plotbox at 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 
+		% I observed that it is much more accurate
 		\pgfmathsubtract@{\pgfplots at xmax}{\pgfplots at xmin}%
 	\else
 		\def\pgfmathresult{1}%
@@ -491,7 +491,7 @@
 	%
 	% 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 
+	% accidentally UNDO the PGF transformation matrix (compare by
 	% writing \tikzpicture[scale=0.5] before the axis).
 	\pgftransformreset
 	%
@@ -526,7 +526,7 @@
 
 \def\pgfplots at scaleaxes@to at BB@prepare at plotbox@limits@#1{%
 	\expandafter\ifx\csname pgfplots@#1\endcsname\pgfutil at empty
-		% Ah - we have no unit vector in this direction. 
+		% Ah - we have no unit vector in this direction.
 		\expandafter\def\csname pgfplots at plotbox@#1min\endcsname{0}%
 		\expandafter\def\csname pgfplots at plotbox@#1max\endcsname{1}%
 		\expandafter\def\csname b at pgfplots@plotbox@#1isunit\endcsname{1}%
@@ -578,7 +578,7 @@
 		%
 		\if3\pgfplots at scale@mode at choice
 			% scale mode=scale uniformly
-			% 
+			%
 			% We need to recompensate in case the previous method chose
 			% different unit scaling scalings:
 			\pgfplots at BB@for at plotbox@get at unit@scales at compensated@axis at limits
@@ -793,7 +793,7 @@
 	\fi
 }%
 
-% Defines 
+% Defines
 % \pgfplots at target@unit at scale@xx
 % \pgfplots at target@unit at scale@xy
 % \pgfplots at target@unit at scale@yx
@@ -905,7 +905,7 @@
 }%
 
 \def\pgfplots at notify@final at scalings#1{%
-	\pgfkeys{/pgfplots/scaling/.cd,	
+	\pgfkeys{/pgfplots/scaling/.cd,
 		.unknown/.code={%
 %\message{setting key '\pgfkeyscurrentkey' to {##1}^^J}
 			\pgfkeyssetvalue{\pgfkeyscurrentkey}{##1}%
@@ -960,7 +960,7 @@
 %
 % OUTPUT:
 %  \pgfplots at target@datascaletrafo at x@exponent and its variants for y and z
-%     -> contains NEW datascaletrafo exponents 
+%     -> contains NEW datascaletrafo exponents
 %  \pgfplots at target@datascaletrafo at x@exponent at old and its variants for y and z
 %     -> contains OLD datascaletrafo exponents
 %  \pgfplots at target@unit at scale@inv at x and its variants for y and z
@@ -980,7 +980,7 @@
 		\expandafter\pgfplots at loc@TMPa\pgfmathresult
 		\pgf at xa=\csname pgfplots at target@limitrescale@#1\endcsname pt
 		\ifdim\pgf at xa>5pt %
-			% We want to enlarge axis limits considerably! 
+			% We want to enlarge axis limits considerably!
 			%
 			\pgfplots at scaling@adjust at datascaling@for at get@compensation{\pgf at xa}%
 			%
@@ -1004,8 +1004,8 @@
 	}%
 }
 
-% Returns 
-%  \pgfplotsretval -> the absolute scaling 
+% Returns
+%  \pgfplotsretval -> the absolute scaling
 %  \pgfplotsretvalb -> the log10 of the scaling
 \def\pgfplots at scaling@adjust at datascaling@for at get@compensation#1{
 	\ifdim#1<100pt %
@@ -1067,7 +1067,7 @@
 		% 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
@@ -1077,7 +1077,7 @@
 		%
 		\pgfmathdivide@{\H}{\h}%
 		\let\scaley=\pgfmathresult
-		% 
+		%
 		% no changes to the axis limits - we only rescale units.
 		\def\pgfplots at target@limitrescale at x@{1}%
 		\def\pgfplots at target@limitrescale at y@{1}%
@@ -1094,7 +1094,7 @@
 		% scale -- but the axis limits can receive individual
 		% compensation scales. But it should "look reasonable well".
 		%
-		% currently, we have 
+		% 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
 		%
@@ -1103,7 +1103,7 @@
 		% they are either 1 (relative coords) or
 		% (xmax-xmin) (absolute coords).
 		%
-		% Now, search for a set of real numbers 
+		% 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)
@@ -1124,8 +1124,8 @@
 		% 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
@@ -1184,17 +1184,17 @@
 % 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. 
+% be necessary.
 % Examples are
 %   unittest_scalemode_2d_standard_1.tex
 % and perhaps
-%   unittest_scalemode_2d_standard_0.tex 
+%   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
@@ -1202,7 +1202,7 @@
 % 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 
+% ATTENTION: the cost function INCLUDES RESULTS OF
 %	\pgfplots at BB@for at plotbox@get at unit@scales at for@limits and its
 %	corrector
 %	\pgfplots at BB@for at plotbox@get at unit@scales at compensated@axis at limits.
@@ -1210,9 +1210,9 @@
 % More precisely, it relies on already computes limit compensation
 % factors which do not depend on the target width/target height: both
 % \pgfplots at BB@for at plotbox@get at unit@scales at compensated@axis at limits and
-% this implementation of  'scale uniformly strategy' can be used to compute 
+% this implementation of  'scale uniformly strategy' can be used to compute
 % the cost of a strategy.
-% 
+%
 \def\pgfplots at get@scale at horiz@and at vert@scaleuniformly at of@optimal at strategy{%
 	\begingroup
 		\def\mathclass{default}%
@@ -1219,7 +1219,7 @@
 		\pgfplotscoordmath{\mathclass}{max limit}%
 		\let\pgfplots at cost@for at choice@superhigh=\pgfmathresult%
 		%
-		% private helpers to compute the cost. 
+		% private helpers to compute the cost.
 		\def\pgfplots at scalestrategy@compute at cost{%
 			\begingroup
 			% ATTENTION: this call changes
@@ -1324,7 +1324,7 @@
 
 \def\pgfplots at tostring@scaleuniformlystrategy#1{%
 	% scale uniformly strategy:
-	\ifcase#1\relax 
+	\ifcase#1\relax
 		auto
 	\or
 		units only
@@ -1419,7 +1419,7 @@
 
 % Computes 'scale uniformly strategy=change horizontal limits'.
 % This is a complicated solution, see the documentation in the
-% implementation for 
+% implementation for
 % 'scale mode=scale uniformly'
 %
 % #1 [output] a macro which will contain the (uniform) scale for the
@@ -1471,7 +1471,7 @@
 	%
 	% This is the (most stupid) nonlinear method which is at hand:
 	% fix point iteration.
-	% choose R arbitrarily (R=1 seems adequate), solve for s. 
+	% 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 at pgf@countc=0
@@ -1500,7 +1500,7 @@
 }%
 
 % 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
@@ -1510,7 +1510,7 @@
 % #4 [output] a macro which will contain a x axis limit compensation scale
 \def\pgfplots at scaleuniformly@change at horizontal@limits at twodim#1#2#3#4{%
 	\begingroup
-	% Assuming that we have a standard 2d axis, i.e. 
+	% 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.
 	%
@@ -1529,7 +1529,7 @@
 	% since this strategy changes horizontal limits (only), we have
 	% Ry := 1.
 	% We find
-	% s : = H/h 
+	% s : = H/h
 	% and
 	% Rx : = W/w /s .
 	%
@@ -1583,7 +1583,7 @@
 
 % This is part of the implementation of 'scale mode=scale uniformly'.
 %
-% Its purpose it to set up the initial scaling such that 
+% 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)
@@ -1727,7 +1727,7 @@
 % EXECUTABLE instructions which will modify the axis limits to fit the
 % scaling.
 %
-% PRECONDITION: 
+% PRECONDITION:
 % - \pgfplots at glob@TMPa contains the already computed
 % scaling factor for 'scale uniformly'
 % - \pgf at xb is the actual height and \pgf at yb is the desired height
@@ -1739,7 +1739,7 @@
 	% The strategy is as follows:
 	% 1. I want to fit the axis into width #1 (\pgf at ya) and
 	% height #1 (\pgf at yb).
-	% 2. I want to MAINTAIN the unit vector ratio. 
+	% 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
@@ -1760,7 +1760,7 @@
 	%
 	% 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,*). 
+	% 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,*) ).
@@ -1771,13 +1771,13 @@
 	% =>
 	% s_z = ( H- s*r_x e_xy - s*r_y e_yy) / ( s * r_z * e_zy).
 	%
-	% Remember that 
+	% 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 at BB@for at plotbox@getunitheight{\pgf at xc}{#1}%
 	%
@@ -1925,7 +1925,7 @@
 % 			\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}
@@ -1934,9 +1934,9 @@
 % 	\addplot3[surf] {x};
 % 	\end{axis}
 % \end{tikzpicture}
-% 
+%
 % }
-% 
+%
 % \def\v{-30}
 % \foreach \h in {30,120,210,300} {
 % \message{VIEW={\h}{\v}^^J}
@@ -1945,9 +1945,9 @@
 % 	\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.
@@ -1954,7 +1954,7 @@
 \def\pgfplotsgetnormalforcurrentview{%
 	\pgfkeysgetvalue{/pgfplots/view dir}\pgfplots at loc@TMPc
 	\ifx\pgfplots at loc@TMPc\pgfutil at empty
-	\begingroup	
+	\begingroup
 		% temporarily undo the effects of reversed axes -- we *really*
 		% need a right-handed-coordinate system here:
 		\if r\pgfkeysvalueof{/pgfplots/x dir/value}%
@@ -1972,7 +1972,7 @@
 		% FIRST: check for special cases.
 		\let\pgfplots at view@dir at threedim=\pgfutil at empty%
 		% Special case:
-		% e_xx = e_xy = 0 
+		% e_xx = e_xy = 0
 		%
 		% i.e.:
 		%
@@ -1981,7 +1981,7 @@
 		%   z |   |
 		%     |---|
 		%       y->
-		% 
+		%
 		% In this case, N must be the x axis.
 		\ifdim\pgf at xx=0pt %
 			\ifdim\pgf at xy=0pt %
@@ -1989,7 +1989,7 @@
 			\fi
 		\fi
 		% Special case:
-		% e_yx = e_yy = 0 
+		% e_yx = e_yy = 0
 		%
 		% i.e.:
 		%
@@ -1998,7 +1998,7 @@
 		%   z |   |
 		%     |---|
 		%       x->
-		% 
+		%
 		% In this case, N must be the y axis.
 		\ifdim\pgf at yx=0pt %
 			\ifdim\pgf at yy=0pt %
@@ -2008,8 +2008,8 @@
 		% Special case:
 		% e_xy = e_yy = 0  (i.e. one row)
 		%
-		% that is hard to draw, use view={30}{0} to see it. 
-		% 
+		% 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 at xy=0pt %
 			\ifdim\pgf at yy=0pt %
@@ -2218,7 +2218,7 @@
 	% 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, 
+	% If the user specifies ONE of width OR height,
 	% the plot will be resized; keeping the aspect ratio.
 	%
 	\let\pgfplots at default@aspect at ratio=\pgfutil at empty
@@ -2248,7 +2248,7 @@
 	% H := 'height' option non-empty
 	%
 	% 		W H
-	% 		0 0 -> \axisdefaultwidth 
+	% 		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!
@@ -2488,7 +2488,7 @@
 				\pgfplots at apply@unit at ratio@find at reference%
 			\fi
 			%
-			% FIXME : I could spent some attention here to save work: 
+			% 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 at apply@unit at ratio@find at reference and once in the
 			% following).
@@ -2553,7 +2553,7 @@
 % 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.
 %
@@ -2627,7 +2627,7 @@
 				% 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 
+				% instead, since I need the value
 				%   max( 1-s_a, 1-s_b )
 				% anyway.
 				\def\pgfplots at ref@is at feasible{1}%
@@ -2671,7 +2671,7 @@
 		\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 at apply@unit at ratio@reference{x}%
 			%
@@ -2678,9 +2678,9 @@
 			% renormalize:
 			\expandafter\pgfplots at apply@unit at ratio@prepareratios\pgfplots at unit@vector at ratio\pgfplots at EOI
 			%
-			% compute scaling factor: 
+			% compute scaling factor:
 			\pgfplots at getscale@unit at vector@reltoreference y\pgfplots at unit@ratio at y%
-			% 
+			%
 %\message{^^Junit vector ratio 2D searching reference: checking \pgfplots at apply@unit at ratio@reference. feasable=\pgfmathresult < 1: \ifdim\pgfmathresult pt <\pgfplots at ONE YES-> use x\else NO->use y\fi^^J}%
 			% and check (1). The condition (2) is irrelevant; it is met
 			% anyway.
@@ -2823,21 +2823,21 @@
 % 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 
+%   - 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 
+% 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 .
@@ -2881,7 +2881,7 @@
 						\xdef\pgfplots at glob@TMPb{\pgf at sys@tonumber{\pgf at xa}}%
 						\xdef\pgfplots at glob@TMPc{\pgfplots at glob@TMPb}%
 					\else
-						% unit rescale keep size=unless limits declared: 
+						% unit rescale keep size=unless limits declared:
 						% do not scale - all limits are declared
 						% explicitly
 						\xdef\pgfplots at glob@TMPb{0.0}%
@@ -2905,7 +2905,7 @@
 % #1: an axis which should be scaled
 % #2: the desired final ratio  ||e_#1||/||e_ref||
 \def\pgfplots at getscale@unit at 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
@@ -2927,13 +2927,13 @@
 	% 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 || 
+	% 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'! 
+	% -> compute 's'!
 	%
 	% Part 1: compute
 	% #2 * ||e_ref|| / ||e_#1||.
@@ -2958,7 +2958,7 @@
 			{\pgfmathresult}%
 			{#2}%
 		\global\let\pgfplots at glob@TMPa=\pgfmathresult
-		% 
+		%
 		% also compute 1/s, required as temporary value:
 		%\pgfmathmultiply@
 		%	{\csname pgfplots@\pgfplots at apply@unit at ratio@reference @inverseveclength\endcsname}
@@ -3004,7 +3004,7 @@
 }
 
 % helper for \pgfplots at check@and at apply@datatrafo at for.
-% 
+%
 \def\pgfplots at compute@number at order@for at trafo@isfloat#1\tocount#2{%
 	\pgfmathfloatparsenumber{#1}%
 	\expandafter\pgfmathfloat at decompose@E\pgfmathresult\relax#2\relax
@@ -3035,7 +3035,7 @@
 %   - the scaling transformation is set up,
 \def\pgfplots at set@optimal at datatrafo@for@#1{%
 	\pgfplots at if{pgfplots at apply@datatrafo@#1}{%
-		% initialise data scale transformation 
+		% initialise data scale transformation
 		%   T(x) = 10^{q-m} * x
 		%
 		\ifpgfplots at disabledatascaling
@@ -3148,16 +3148,16 @@
 				% Now, I introduce a loop which shall avoid cancellation of
 				% significant digits.
 				%
-				% Harmless Example: 
-				%  if we have data shift = -3 and 
+				% 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 
+				%  max = 1980, min = 1930 then
 				%    T(max) = 1.98 and T(min) = 1.93
-				%  and thus T(max)-T(min) = 0.05 . 
+				%  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
@@ -3201,7 +3201,7 @@
 					% 	\fi
 					% 	\pgfplots at loop@CONTINUEfalse
 					% \fi
-					%-------------------------------------------------- 
+					%--------------------------------------------------
 				\pgfutil at repeat
 				\xdef\pgfplots at glob@TMPa{\the\data at EXPONENT}%
 				\xdef\pgfplots at glob@TMPb{\pgfplots at min@fixed}%
@@ -3239,7 +3239,7 @@
 		%
 		% The strategy to fix the transformation is as follows:
 		% 1. we assume that axis limits will be enlarged in order to
-		% satisfy 'scale uniformly'. 
+		% 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

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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-2010 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -89,8 +89,8 @@
 				\else
 					\pgfplotspointbblowerleft
 				\fi}%
-				{\pgfpointxy at orig{##1}{##2}}% 
-				%I use the '@orig' variant here because descriptions may 
+				{\pgfpointxy at orig{##1}{##2}}%
+				%I use the '@orig' variant here because descriptions may
 				%\let\pgfpointxy=\pgfplotspointdescriptionxy
 		}%
 	}%
@@ -104,7 +104,7 @@
 				\else
 					\pgfplotspointbblowerleft
 				\fi}%
-				{\pgfqpointxy at orig{##1}{##2}}% 
+				{\pgfqpointxy at orig{##1}{##2}}%
 		}%
 	}%
 	\pgfplotspoint at initialisation@axes
@@ -131,7 +131,7 @@
 }%
 
 % Determine final  axes this does also fix the axis' dimension.
-% There are the following cases: 
+% There are the following cases:
 % 1. the user really wants a fixed dimension,
 %    i.e. he used 'scale only axis'.
 %    Then, we have to work to get the correct dimension!
@@ -141,9 +141,9 @@
 %
 %    If I am not mistaken, this does ONLY affect the final size,
 %    not the relative plot precision.
-%    
+%
 %    FIXME : really compute the plot precision!
-% 
+%
 % 2. The use specified width and/or height, but not 'scale only
 %    axis'. Accept inaccurate final widths/heights (see above).
 %
@@ -175,7 +175,7 @@
 	\pgfplots at ycoordminTEX=\pgf at y
 	%
 	%--------------------------------------------------
-	% FIXME : WHAT IS THIS HERE FOR? 
+	% FIXME : WHAT IS THIS HERE FOR?
 	% \pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymax}%
 	% \ifx\pgfplots at rectangle@width\pgfutil at empty
 	% 	\def\pgfplots at tmp@xmax at ymin{\pgfplotsqpointxy{\pgfplots at xmax}{\pgfplots at ymin}}%
@@ -197,7 +197,7 @@
 	% 	\advance\pgf at x\pgfplots at height
 	% 	\edef\pgfplots at tmp@xmin at ymax{\noexpand\pgfqpoint{\noexpand\pgfplots at xcoordminTEX}{\the\pgf at x}}%
 	% \fi
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	\pgfpointdiff
 		{\pgfqpoint{\pgfplots at xcoordminTEX}{\pgfplots at ycoordminTEX}}
 		{\pgfplotspointmaxminmin}%
@@ -293,7 +293,7 @@
 % 2. Any other point coordinate should not be altered.
 %
 % Former versions installed a shift and changed e_x, e_y and
-% e_z. However, that was misleading as it disabled point 2). 
+% e_z. However, that was misleading as it disabled point 2).
 % So, my idea here is to replace \pgfpointxy and \pgfqpointxy
 % such that they install the correct coordinate system before
 % doing anything else.
@@ -323,7 +323,7 @@
 % argument is omitted, the <default shift> will be used (0pt if this
 % argument has been omitted as well).
 %
-% \pgfplotspointticklabelcs#1#2: 
+% \pgfplotspointticklabelcs#1#2:
 % #1 is the axis (either x,y or z)
 % #2 is the coordinate (either <relative coord> or <relative coord>,<shift>)
 %
@@ -403,7 +403,7 @@
 % component #1, #2 and #3. The results are directly communicated to
 % \pgfplotsqpointxyz.
 %
-% Expects #1, #2 and #3 to be numbers with units and issues a \pgfplotsqpointxyz 
+% Expects #1, #2 and #3 to be numbers with units and issues a \pgfplotsqpointxyz
 \def\pgfplotsqpointxyzabsolutesize#1#2#3{%
 	\begingroup
 	\pgf at xa=#1\relax
@@ -419,7 +419,7 @@
 
 % Denotes a point in a twodimensional hyperplane. The hyperplane is
 % one of the six planes of the threedimensional axis cube.
-% 
+%
 % The meaning of coordinates #1 and #2 will be redefined depending on
 % which surface we are currently processing. You can get the axis
 % names for '#1' (a) and '#2' (b) using the macros
@@ -456,7 +456,7 @@
 	\pgfplots at error{Internal logic error: \string\pgfplotspointonorientedsurfaceab\ used although surface has not been declared! You need to call \string\pgfplotspointonorientedsurfaceabsetupfor xyz\ or its friends to do so.}%
 }%
 
-% This is a shortcut for 
+% This is a shortcut for
 % \pgfpointadd
 % 	{\pgfplotspointonorientedsurfaceab{#1}{#2}}
 % 	{<shift in B direction of #3>}
@@ -479,7 +479,7 @@
 
 % This macro will be defined after
 % \pgfplotspointonorientedsurfaceabsetupfor...
-% routines. It expands to a three-character string 
+% routines. It expands to a three-character string
 % where the first character contains information about the x axis,
 % the second about the y axis and the third about the z axis.
 %
@@ -518,7 +518,7 @@
 % axis and 'b' is the y axis and the z coordinate has been fixed with
 % \pgfplotspointonorientedsurfaceabsetupforsetz{}.
 %
-% The Z value needs to be fixed with 
+% The Z value needs to be fixed with
 % \pgfplotspointonorientedsurfaceabsetupforsetz .
 \def\pgfplotspointonorientedsurfaceabsetupfor@@xyz{%
 	\def\pgfplotspointonorientedsurfaceab##1##2{\pgfplotsqpointxyz{##1}{##2}{\pgfplotspointonorientedsurfaceabsetupfor at fixedz}}%
@@ -576,7 +576,7 @@
 }%
 
 % Fixes 'x' to #1 for use in
-% \pgfplotspointonorientedsurfaceabsetupfor zyx and 
+% \pgfplotspointonorientedsurfaceabsetupfor zyx and
 % \pgfplotspointonorientedsurfaceabsetupfor yzx.
 %
 % #1: The fixed value for 'x' (a coordinate in transformed range).
@@ -650,7 +650,7 @@
 % the currently active oriented surface.
 % #2 : the macro which will contain the output axis line specification
 % (three-char-string).
-% 
+%
 % Example:
 % \pgfplotspointonorientedsurfaceabsetupfor xyz
 % \pgfplotspointonorientedsurfaceabsetupforsetz{<lower z limit>}{0}
@@ -721,8 +721,8 @@
 % three-character-string '#1' is a foreground surface and code '#3' if
 % the surface '#1' is a background surface.
 %
-% #1: a three-char-string with the keys 
-% 	'v' = 'varying', 
+% #1: a three-char-string with the keys
+% 	'v' = 'varying',
 % 	'0' = 'lower axis limit',
 % 	'1' = 'upper axis limit'.
 % 	The string 'v0v' means that x and z are varying in that surface
@@ -869,7 +869,7 @@
 % This does only handle foreground/background issues; it has NOTHING
 % to do with the actual checks if grid lines are active or not.
 \def\pgfplots at ifgridlines@onorientedsurf at should@be at drawn#1#2{%
-	% grid lines shall be drawn 
+	% grid lines shall be drawn
 	% if and only if BOTH adjacent axis lines shall be drawn:
 	\pgfplots at ifaxisline@B at onorientedsurf@should at be@drawn at allaxislinevariations{0}{%
 		% remark: this is ALWAYS true for 2D plots.
@@ -910,7 +910,7 @@
 % 		surface axis (which is called the 'b' axis).
 % 		Thus, the following values for '#2' can be expected:
 % 		- '' (empty) if the line is not on the surface,
-% 		- 'v' if the line IS on the surface, and '#1' contains a 'v' 
+% 		- 'v' if the line IS on the surface, and '#1' contains a 'v'
 % 		in direction of the surface's 'b' axis.
 % 		- '0' if the line IS on the surface and '#1' contains a '0' in
 % 		direction of the surface's 'b' axis,
@@ -961,7 +961,7 @@
 	\let#3=\pgfplots at loc@TMPa
 }%
 
-% IMPLEMENTATION: 
+% IMPLEMENTATION:
 % The return value is 'yes, #1#2#3 is on the oriented surface #4#5#6'
 % if and only if for all three character pairs, the following single
 % relations hold.
@@ -970,7 +970,7 @@
 %  '0' :         is either 0, a, b, v or 2 (i.e. NOT 1) FIXME : is the '2' correct here!?
 %  '1' :         is either 1, a, b, v or 2 (i.e. NOT 0)
 %  '2' :         is either 2, a, b, v (i.e. NOT 0 or 1)
-% That's all. 
+% That's all.
 %
 % If the 'oriented surface char' is 'v', then we actually don't have
 % an oriented surface but just a surface.
@@ -1049,7 +1049,7 @@
 
 % Provides a point on an arbitrary axis (identified by a
 % three-character-string) which can take any value on that axis and
-% which is shifted in the direction of the outer normal vector. 
+% which is shifted in the direction of the outer normal vector.
 %
 % #1: a three-character-string denoting the desired axis
 % #2: the coordinate on that axis (the coordinate for the 'v'
@@ -1078,9 +1078,9 @@
 
 % A variant of \pgfplotsqpointoutsideofaxis with relative values for
 % #2.
-% That means  
-%   '#2 = 0' === lower axis limit 
-% and 
+% That means
+%   '#2 = 0' === lower axis limit
+% and
 %   '#2 = 1' === upper axis limit.
 \def\pgfplotsqpointoutsideofaxisrel#1#2#3{%
 	\begingroup
@@ -1304,7 +1304,7 @@
 		%
 		% The idea is to return the same normal vector as if this would be a boxed axis.
 		% To this end, we have to access the "ticklabel axis spec"
-		% which would have been used in this case. 
+		% which would have been used in this case.
 		%
 		% We computed it at startup. Might be a hack ... :-(
 		\edef\pgfplots at loc@TMPb{\csname pgfplots@#1ticklabelaxisspec at box\endcsname}%
@@ -1466,7 +1466,7 @@
 % 	}%
 % 	\endgroup
 % }%
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 % Helper method for \pgfplotsqpointoutsideofaxis and its variants.
 % #1: an axis (x,y or z)
@@ -1508,7 +1508,7 @@
 % coordinate directions.
 %
 % \pgfplotstransformtoaxisdirection[<options>]{<axis char>}
-% 
+%
 % <axis char>: the coordinate direction (one of x,y or z)
 %
 % The code is pretty much the same as \pgftransformlineattime, except
@@ -1540,7 +1540,7 @@
 	% '#1#2#3':
 	\pgfqpointscale{\csname pgfplotsunit#2invlength\endcsname}{\csname pgfplotspointunit#2\endcsname}%
 	%
-	\ifdim\pgf at x<0pt%   
+	\ifdim\pgf at x<0pt%
 		% oh. upside down.
 		\pgfkeysvalueof{/pgfplots/sloped/execute for upside down}%
 		\ifpgfplots at sloped@allowupsidedown
@@ -1552,8 +1552,8 @@
 	\fi%
 	%
 	\pgf at ya=-\pgf at y%
-	% set up rotation matrix 
-	%  [ cos(alpha) sin(alpha); 
+	% set up rotation matrix
+	%  [ cos(alpha) sin(alpha);
 	%   -sin(alpha) cos(alpha) ]
 	% where cos(alpha) = n_x and sin(alpha) = n_y:
 	\pgftransformcm%
@@ -1581,7 +1581,7 @@
 	%
 	\pgfdeclaregenericanchor{#3}{\pgfplots at borderanchor@for at axis{#1}{#2}{##1}}%
 	\pgfdeclaregenericanchor{#3 opposite}{\pgfplots at borderanchor@for at axis@{#1}{#2}{##1}{+1}}%
-	% 
+	%
 	% This variant will ALWAYS be placed on the boundary of the node.
 	% It is deprecated, I am keeping it for some time....
 	\pgfdeclaregenericanchor{#3*}{%
@@ -1588,8 +1588,8 @@
 		\csname pgf at anchor@##1 at border\endcsname{%
 			\pgf at process{%
 				%
-				% I want to rotate the node FIRST, then 
-				% I'd like to get the boundary anchor! 
+				% I want to rotate the node FIRST, then
+				% I'd like to get the boundary anchor!
 				%
 				% My idea: apply the INVERSE transformation
 				% matrix, then compute the boundary anchor.
@@ -1676,7 +1676,7 @@
 	% we apply the inverse CM onto it here:
 	\pgf at pos@transform\pgf at x\pgf at y
 	\edef\pgfplots at tmp@normaldir{\global\pgf at x=\the\pgf at x\space\global\pgf at y=\the\pgf at y\space}%
-	% 
+	%
 	\pgfplots at borderanchor@snap at to@nearest at anchor{}% takes \pgf at x and \pgf at y
 	\let\pgfplots at anchor=\pgfplotsretval
 	%
@@ -1748,7 +1748,7 @@
 	\let\pgfplots at anchor@inner=\pgfplotsretval
 	%
 	%
-	% verify that |n^T d | 
+	% verify that |n^T d |
 	\pgf at xc=\pgf at sys@tonumber\pgf at xa\pgf at xb
 	\advance\pgf at xc by\pgf at sys@tonumber\pgf at ya\pgf at yb
 	\ifdim\pgf at xc<0pt \pgf at xc=-\pgf at xc \fi
@@ -1762,7 +1762,7 @@
 			{\pgf at sys@tonumber\pgf at xb}{\pgf at sys@tonumber\pgf at xa}%
 			{\pgf at sys@tonumber\pgf at yb}{\pgf at sys@tonumber\pgf at ya}%
 		}%
-		% 
+		%
 		% This here controls the anchor! Changing it might be more
 		% useful than I thought in the first place...
 		\pgf at sh@reanchor{#3}{\pgfplots at anchor@inner}%
@@ -1806,7 +1806,7 @@
 	% Now:
 	% auto-determine the canonical (north, north east etc) anchor
 	% at which the node touches the axis (remember: the axis is to
-	% be found in direction of the normal vector).  
+	% be found in direction of the normal vector).
 	%
 	% This is kind of a snap-to-nearest-existing-anchor feature. But
 	% it tends to move the node too far away. It is used as starting
@@ -1884,10 +1884,10 @@
 		\pgfplotsmathvectortostring{\pgfplots at view@dir at threedim}{default}%
 		\edef\normal{view = (\pgfplotsretval),^^J}%
 	\fi
-	\message{^^J 
-		x = (\the\pgf at xx,\the\pgf at xy),^^J 
-		y =(\the\pgf at yx,\the\pgf at yy),^^J 
-		z = (\the\pgf at zx,\the\pgf at zy),^^J 
+	\message{^^J
+		x = (\the\pgf at xx,\the\pgf at xy),^^J
+		y =(\the\pgf at yx,\the\pgf at yy),^^J
+		z = (\the\pgf at zx,\the\pgf at zy),^^J
 		\normal
 		unit vector ratio=[\X\space\Y\space 1],^^J}%
 	\endgroup
@@ -1895,7 +1895,7 @@
 
 
 % ==================================================================================
-% 
+%
 % COORDINATE MATH.
 %
 % ==================================================================================
@@ -1910,7 +1910,7 @@
 % possible to use yet a further instance for point meta (or whatever).
 %
 % Coordinate math is used to compute axis limits and to map the range
-% into the pgf number format. 
+% into the pgf number format.
 %
 % It is *not* necessarily used for \pgfmathparse, since switching
 % the number format of \pgfmathparse is quite involved (at the time of
@@ -1921,7 +1921,7 @@
 % #2: methods to override the default.
 %
 % The available methods are documented and shown below in the
-% \pgfqkeys listing. 
+% \pgfqkeys listing.
 %
 % @see the predefined examples, also shown below.
 \def\pgfplotsdeclarecoordmath#1#2{%
@@ -2139,7 +2139,7 @@
 	set log basis/.code=
 		{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ set log basis\endcsname##1{#1}},%
 	%
-	% The inverse to 'log e '. 
+	% The inverse to 'log e '.
 	exp e/.code=
 		{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ exp e\endcsname##1{#1}},%
 	%
@@ -2162,7 +2162,7 @@
 		{\expandafter\def\csname pgfpmth\pgfplotsdeclarecoordmath@ datascaletrafo set shift\endcsname##1{%
 			#1\relax\pgfplotscoordmathnotifydatascalesetfor{\pgfplotscoordmathid}%
 		 }},%
-	% 
+	%
 	% Defines \pgfmathresult to contain the two parameters in the form
 	% {#1}{#2} required for 'datascaletrafo set params':
 	% #1: the EXPONENT (as integer)
@@ -2333,7 +2333,7 @@
 	\else
 		% log basis a ---> log basis 10
 		%
-		% log_a x = log x / log a 
+		% log_a x = log x / log a
 		% log_10 x =  log_a x * log a / log(10) = log x / log(10) [OK]
 		\csname pgfpmth@#1 at op\endcsname{multiply}{{#2}{\pgfmathresult}}%
 	\fi
@@ -2352,7 +2352,7 @@
 	parsenumber={%
 		\pgfmathfloatparsenumber{#1}%
 		\expandafter\pgfmathfloatgetflagstomacro\expandafter{\pgfmathresult}\pgfplotsretval
-		\ifnum\pgfplotsretval>2 
+		\ifnum\pgfplotsretval>2
 			\let\pgfmathresult=\pgfutil at empty
 		\else
 			\pgfmathfloattofixed\pgfmathresult
@@ -2371,7 +2371,7 @@
 		}{},
 	parsenumber=\pgfmathfloatparsenumber{#1},
 	parse={%
-		\begingroup 
+		\begingroup
 		\pgfkeys{/pgf/fpu,%
 			/pgf/fpu/output format=float,%
 		}%
@@ -2563,7 +2563,7 @@
 		\pgf at yb=\pgfplots at current@point at z pt %
 	\fi
 	\def\pgfplots at loc@TMPa{#2}%
-	% 
+	%
 	% I assume that \pgfplots@[xyz]min at reg and min at reg are registers
 	% containing the limits.
 	\ifdim\pgf at xa<\pgfplots at xmin@reg
@@ -2630,7 +2630,7 @@
 	%
 	% 		a macro used to initialise the point meta source when it is
 	% 		selected.
-	% 		This macro body is invoked by pgfplots when someone types 
+	% 		This macro body is invoked by pgfplots when someone types
 	%		'point meta=x' -> will invoke 'pgfpmeta at x@initfor{}'.
 	%		The first argument to initfor can be supplied by the user.
 	%		PRECONDITION for 'initfor':
@@ -2657,7 +2657,7 @@
 	%		- the other input coordinates are already read.
 	%	POSTCONDITION for '@assign':
 	%		- \pgfplots at current@point at meta is ready for use:
-	%		- EITHER a parsed floating point number 
+	%		- EITHER a parsed floating point number
 	%		- OR an empty string,
 	%		- OR a symbolic string (if the issymbolic boolean is true)
 	%	The default implementation is
@@ -2822,9 +2822,9 @@
 
 % Internal stream methods.
 %
-% Please overwrite 
+% Please overwrite
 % - \pgfplots at coord@stream at start@,
-% - \pgfplots at coord@stream at end@ and 
+% - \pgfplots at coord@stream at end@ and
 % - \pgfplots at coord@stream at coord@
 % if you implement streams.
 %
@@ -2934,8 +2934,8 @@
 % In other words, the \pgfplotsscanlinelengthincrease routine is
 % invoked *before* the point is processed. That's important.
 %
-% Now, \pgfplotsscanlinelength expands to either 
-% a) a negative number in which case there is no 
+% Now, \pgfplotsscanlinelength expands to either
+% a) a negative number in which case there is no
 %  unique scanline length.
 %  	More precisely, -1 means "there was no end-of-scanline marker"
 %  	-2 means "there where end-of-scanline markers, but the scanlines
@@ -2972,7 +2972,7 @@
 
 \newif\ifpgfplots at emptyline@compat
 
-% Invoked for 'empty line=auto'. 
+% Invoked for 'empty line=auto'.
 %
 % @POSTCONDITION: '/pgfplots/empty line' is set to something useful
 % (not auto)
@@ -3011,7 +3011,7 @@
 \def\pgfplotsscanlinelength at scanline@complete{%
 	\ifnum\pgfplots at scanlinelength>0
 		\ifnum\c at pgfplots@scanlineindex=0
-			% 
+			%
 			% \pgfplotsscanlinecomplete
 			% \pgfplotsscanlinecomplete
 			% \pgfplotsscanlinecomplete
@@ -3050,7 +3050,7 @@
 % -------------------------------------------------------------------------------
 %
 % empty line=none   class:
-% 
+%
 \let\pgfplotsscanlinelength at none@initzero=\pgfutil at empty
 \let\pgfplotsscanlinelength at none@increase=\relax
 \let\pgfplotsscanlinelength at none@complete=\relax
@@ -3061,7 +3061,9 @@
 \def\pgfplotsscanlinelength at nan@initzero{%
 	\def\pgfplotsscanlinelength at nan@isfirst{1}%
 	\let\pgfplotsscanlinelength at nan@pendingwork=\relax
-	\pgfplotsifinaxis{}{\let\pgfplotsaxisserializedatapoint=\relax}%
+	\pgfplotsifinplot{}{%
+		\let\pgfplotsaxisserializedatapoint=\relax
+	}%
 }%
 \def\pgfplotsscanlinelength at nan@increase{%
 	\def\pgfplotsscanlinelength at nan@isfirst{0}%
@@ -3070,26 +3072,9 @@
 \def\pgfplotsscanlinelength at nan@complete{%
 	\if1\pgfplotsscanlinelength at nan@isfirst
 	\else
-		\def\pgfplotsscanlinelength at nan@pendingwork{%
-			\ifpgfplots at LUA@backend at supported
-				\pgfplotsutil at directlua{pgfplots.texSurveyAddJump()}%
-			\else
-				% this will be executed when the next point has been
-				% found.
-				\def\pgfplots at current@point at x{}%
-				\def\pgfplots at current@point at y{}%
-				\def\pgfplots at current@point at z{}%
-				% simply serialize an empty point. That works -- the
-				% visualization phase checks if the coordinates are empty and
-				% visualizes them as "jump"
-				%
-				% Note that \pgfplotsplothandlersurveypoint is not a good
-				% choice here unless one employs its 'unbounded coords=jump'
-				% feature
-				\def\pgfplotsaxisplothasjumps{1}%
-				\pgfplotsaxisserializedatapoint
-			\fi
-			%
+		\pgfplotsifinplot{%
+			\let\pgfplotsscanlinelength at nan@pendingwork=\pgfplotsscanlinelength at nan@pendingwork at PREPARED
+		}{%
 			\let\pgfplotsscanlinelength at nan@pendingwork=\relax
 		}%
 	\fi
@@ -3096,7 +3081,29 @@
 	\def\pgfplotsscanlinelength at nan@isfirst{1}%
 }%
 \let\pgfplotsscanlinelength at nan@cleanup=\relax
-% 
+\def\pgfplotsscanlinelength at nan@pendingwork at PREPARED{%
+	\ifpgfplots at LUA@backend at supported
+		\pgfplotsutil at directlua{pgfplots.texSurveyAddJump()}%
+	\else
+		% this will be executed when the next point has been
+		% found.
+		\def\pgfplots at current@point at x{}%
+		\def\pgfplots at current@point at y{}%
+		\def\pgfplots at current@point at z{}%
+		% simply serialize an empty point. That works -- the
+		% visualization phase checks if the coordinates are empty and
+		% visualizes them as "jump"
+		%
+		% Note that \pgfplotsplothandlersurveypoint is not a good
+		% choice here unless one employs its 'unbounded coords=jump'
+		% feature
+		\def\pgfplotsaxisplothasjumps{1}%
+		\pgfplotsaxisserializedatapoint
+	\fi
+	%
+	\let\pgfplotsscanlinelength at nan@pendingwork=\relax
+}%
+%
 % -------------------------------------------------------------------------------
 
 
@@ -3105,7 +3112,21 @@
 \def\pgfplotsaxisplothasunboundedpointmeta{0}%
 \newif\ifpgfplotsaxisparsecoordinateok
 
-% Initialises 
+% Possibly values:
+% N = none, is not in \addplot
+% S = survey
+% V = visualization
+\def\pgfplotsaxisplotphase{N}
+
+\def\pgfplotsifinplot#1#2{%
+	\if\pgfplotsaxisplotphase N%
+		#2%
+	\else
+		#1%
+	\fi
+}%
+
+% Initialises
 % \pgfplots at coord@stream at start
 % \pgfplots at coord@stream at coord
 % \pgfplots at coord@stream at end
@@ -3184,12 +3205,12 @@
 	\begingroup
 	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 	\let\E=\noexpand
-	% 
+	%
 %\message{Assembled update-limits \ifpgfplots at curplot@threedim 3D\else 2D\fi macro to {\meaning\pgfplotsaxisupdatelimitsforcoordinate}}%
 	\ifpgfplots at bb@isactive
 	\else
-		% we are inside of 
-		% \pgfplotsinterruptdatabb 
+		% we are inside of
+		% \pgfplotsinterruptdatabb
 		% ..
 		% \endpgfinterruptboundingbox
 		% -> don't change data limits!
@@ -3228,17 +3249,17 @@
 	%
 	% A data point might be a complicated thing which contains
 	% multiple coordinates. You need to invoke
-	% \pgfplotsaxisparsecoordinate and 
+	% \pgfplotsaxisparsecoordinate and
 	% \pgfplotsaxispreparecoordinate for each of them. But
 	% \pgfplotsaxisdatapointsurveyed is invoked once for the complete
 	% set.
-	% 
+	%
 	% @PRECONDITION
 	% 	- \pgfplots at current@point@[xyz] contain final coordinates
 	% 	(i.e. output of \pgfplotsaxispreparecoordinate)
 	%
 	% @POSTCONDITION
-	% 	- stacked plot things, 
+	% 	- stacked plot things,
 	% 	- error bars,
 	% 	- xtick=data
 	% 	are all processed.
@@ -3298,7 +3319,7 @@
 				\ifpgfplots at warn@for at filter@discards
 					\E\pgfplots at message{%
 						NOTE: coordinate (\E\pgfplots at current@point at x@unfiltered,\E\pgfplots at current@point at y@unfiltered\ifpgfplots at curplot@threedim,\E\pgfplots at current@point at z@unfiltered\fi)
-						has been dropped because 
+						has been dropped because
 						\E\ifx\E\pgfplots at unbounded@dir\E\pgfutil at empty
 							of a coordinate filter.
 						\E\else
@@ -3340,7 +3361,7 @@
 	%
 %\message{Prepared macro \string\pgfplots at update@limits at for@one at point: {\meaning\pgfplotsaxisupdatelimitsforcoordinate}}%
 %\message{Prepared macro \string\pgfplots at process@one at point: {\meaning\pgfplots at process@one at point}}%
-	% 
+	%
 	\let\pgfplots at coord@stream at start@=\pgfplots at PREPARE@COORD at STREAM@start@
 	\def\pgfplots at coord@stream at coord@{%
 		\def\pgfplots at set@perpointmeta at done{0}%
@@ -3467,7 +3488,7 @@
 	\endgroup
 }%
 % This is the \pgfplots at coord@stream at end@ routine which is invoked by
-% \pgfplots at PREPARE@COORD at STREAM. 
+% \pgfplots at PREPARE@COORD at STREAM.
 %
 % It finalizes the first pass through the input coordinates and
 % remembers the preprocessed \addplot command.
@@ -3575,14 +3596,14 @@
 				\ifpgfplots at LUA@backend at supported
 					\noexpand\pgfplots at LUA@backend at supportedtrue
 					\pgfplots at LUA@backend at serialized@commands
-				\else 
+				\else
 					\noexpand\pgfplots at LUA@backend at supportedfalse
 				\fi
-				\noexpand\def\noexpand\plotnum{\the\pgfplots at numplots}%
+				\noexpand\def\noexpand\plotnum{\plotnum}%
 				%
 				% store \plotnumofactualtype
 				\noexpand\def\noexpand\plotnumofactualtype{\plotnumofactualtype}%
-				% ... and make sure that it 
+				% ... and make sure that it
 				% remains the same type even if some plot handler uses
 				% other plot handlers internally:
 				\noexpand\def\noexpand\pgfplotsplothandlername at actual{\pgfplotsplothandlername at actual}%
@@ -3679,7 +3700,7 @@
 	\pgfkeysgetvalue{/pgfplots/#1 filter/. at cmd}\pgfplots at loc@TMPc
 	\ifx\pgfplots at loc@TMPc\pgfplots at empty@command at key
 		\let\pgfplotsretval=\pgfutil at empty
-	\else 
+	\else
 		\pgfplots at ifisfilterexpression{#1 filter}{%
 			\pgfkeysgetvalue{/pgfplots/#1 filter/@expressionvalue}\pgfplotsretval
 			\expandafter\pgfplotsutilifcontainsmacro\expandafter{\pgfplotsretval}{%
@@ -3751,11 +3772,10 @@
 		\if m\pgfplots at colormap@access
 		\else
 			\if c\pgfplots at colormap@access
-				\pgfplots at LUA@survey at log@deactivation{color map access=piecewise constant not supported (yet)}%
 			\else
 				\pgfplots at LUA@survey at log@deactivation{color map access=direct not supported (yet)}%
+				\pgfplots at LUA@backend at supportedfalse
 			\fi
-			\pgfplots at LUA@backend at supportedfalse
 		\fi
 		\pgfplotscolormapifisuniform{\pgfkeysvalueof{/pgfplots/colormap name}}{%
 		}{%
@@ -3764,6 +3784,14 @@
 			\pgfplots at LUA@backend at supportedfalse
 		}%
 		%
+		\ifpgfplots at curplot@threedim
+		\else
+			\ifpgfplots at threedim
+				\pgfplots at LUA@survey at log@deactivation{2d plots in 3d axis currently unsupported}%
+				\pgfplots at LUA@backend at supportedfalse
+			\fi
+		\fi
+		%
 		\ifpgfplots at LUA@backend at supported
 			\edef\pgfplots at LUA@backend at plotnum{\pgfutil at directlua{tex.sprint(\pgfplotsHASH pgfplots.gca.plothandlers)}}%
 			\begingroup
@@ -3859,15 +3887,27 @@
 			% Otherwise we would have nothing here.
 			% FIXME : what about \pgfplots at LUA@backend at failed in this context!?
 			\pgfplots at log{\pgfplots at LUA@loglevel at info}{Using 'lua backend=false' for visualization of plot \the\pgfplots at numplots\space (type '\pgfplotsplothandlername'): it has no LUA visualizer.}%
-			\expandafter\def\expandafter\pgfplots at stored@current at data\expandafter{%
+			%  NOTE:
+			%    I use two levels of \expandafter here because 'lua debug =trace'
+			%    introduces another level of expansion. And I do not
+			%    want to use \edef... silly, perhaps..?
+			\expandafter\expandafter\expandafter\def
+			\expandafter\expandafter\expandafter\pgfplots at stored@current at data
+			\expandafter\expandafter\expandafter{%
 				\pgfplotsutil at directlua{pgfplots.texGetSurveyedCoordsToPgfplots()}%
 			}%
 		\else
 			% visualize using LUA! ... and acquire the coordinates.
-			\expandafter\def\expandafter\pgfplots at stored@current at data\expandafter{%
+			%  NOTE:
+			%    I use two levels of \expandafter here because 'lua debug =trace'
+			%    introduces another level of expansion. And I do not
+			%    want to use \edef... silly, perhaps..?
+			\expandafter\expandafter\expandafter\def
+			\expandafter\expandafter\expandafter\pgfplots at stored@current at data
+			\expandafter\expandafter\expandafter{%
 				\pgfplotsutil at directlua{pgfplots.texVisualizePlot(\pgfplotsplothandlerLUAvisualizerfactory)}%
 			}%
-%\message{plot \plotnum: LUA backend returned \pgfplots at stored@current at data^^J}%
+%\message{plot \plotnum: LUA backend returned \meaning\pgfplots at stored@current at data^^J}%
 			%
 			% ... and ensure that the resulting
 			% \pgfplots at stored@current at data can be deserialized. It
@@ -4009,7 +4049,7 @@
 % \pgfplotsaxistransformcs.
 % #1: the source coordinate system
 % #2: the target coordinate system
-% #3: the transformation code. 
+% #3: the transformation code.
 %
 % @see \pgfplotsaxistransformcs for what #3 should do.
 %
@@ -4016,7 +4056,7 @@
 % This does also declare a coordinate system for use in 'data cs'.
 % The minimal requirements are to define the transformations from and
 % to "cart" (cartesian coordinates).
-% 
+%
 \def\pgfplotsdefinecstransform#1#2#3{%
 	\expandafter\def\csname pgfp at transform@#1 at to@#2\endcsname{#3}%
 }%
@@ -4145,9 +4185,9 @@
 % Handle User-defined parts which should be serialized as well.
 % This preparation tool should be called at the start of both, survey
 % and visualization phase.
-% 
+%
 % @PRECONDITION
-% 	- the macros 
+% 	- the macros
 % 	\pgfplotsaxisserializedatapoint at private
 % 	\pgfplotsaxisdeserializedatapointfrom at private
 % 	are known and valid.
@@ -4160,7 +4200,7 @@
 % 	\pgfplotsaxisdeserializedatapointfrom at private
 % 	have been patched to incorporate the '/pgfplots/visualization
 % 	depends on' feature.
-% 	
+%
 \def\pgfplots at prepare@visualization at dependencies{%
 	\pgfkeysgetvalue{/pgfplots/visualization depends on/list}\pgfplots at loc@TMPa
 	\ifx\pgfplots at loc@TMPa\pgfutil at empty
@@ -4176,7 +4216,7 @@
 		%
 		% prepare
 		% \t at pgfplots@tokc={<\macro1><\macro2><\macro3>...}
-		\t at pgfplots@tokc={}% 
+		\t at pgfplots@tokc={}%
 		\expandafter\pgfplotsutilforeachcommasep\expandafter{\pgfplots at loc@TMPa}\as\pgfplots at loc@TMPa{%
 			\ifx\pgfplots at loc@TMPa\pgfutil at empty
 			\else
@@ -4224,7 +4264,7 @@
 					\escapechar=-1
 					\xdef\pgfplots at glob@TMPa{\string##1}%
 				\endgroup
-				\pgfutil at ifundefined{\pgfplots at glob@TMPa}{%	
+				\pgfutil at ifundefined{\pgfplots at glob@TMPa}{%
 					\begingroup
 					\t at pgfplots@toka={##1}%
 					\pgfplotsthrow{invalid argument}
@@ -4246,7 +4286,7 @@
 				\escapechar=-1
 				\xdef\pgfplots at glob@TMPa{\string#1}%
 			\endgroup
-			\pgfutil at ifundefined{\pgfplots at glob@TMPa}{%	
+			\pgfutil at ifundefined{\pgfplots at glob@TMPa}{%
 				\begingroup
 				\t at pgfplots@toka={#1}%
 				\pgfplotsthrow{invalid argument}
@@ -4267,7 +4307,7 @@
 	\t at pgfplots@tokc=\expandafter{\the\t at pgfplots@tokc\csname assign@\string#2\endcsname}%
 }%
 
-% task: define a macro '\csname assign@\string#2\endcsname' which, when executed, 
+% task: define a macro '\csname assign@\string#2\endcsname' which, when executed,
 % defines \csname\string#2 at value\endcsname such that it expands
 % to a the correct value.
 \def\pgfplots at prepare@visualization at depends@on at preparetype#1\as#2{%
@@ -4307,9 +4347,9 @@
 	% ok, prepare the value.
 	\def\pgfplots at loc@TMPb{#2}%
 	\ifx\pgfplots at loc@TMPa\pgfplots at loc@TMPb
-		% oh - a special case! We have value\macro\as\macro. 
+		% oh - a special case! We have value\macro\as\macro.
 		\expandafter\def\csname\string#2 at value\endcsname{#2}%
-		% 
+		%
 		% this is special; we do not need to EXECUTE assign@\string#2 to arrive at its value.
 		% But we need to define #2 at value as that will be stored.
 		\expandafter\let\csname assign@\string#2\endcsname=\relax
@@ -4345,7 +4385,7 @@
 % \pgfplots at PREPARE@COORD at STREAM@end at .
 %
 % POSTCONDITION:
-% 	assigns '/pgfplots/#1 coord sorting=[+-]' 
+% 	assigns '/pgfplots/#1 coord sorting=[+-]'
 % 	i.e. whether #1 (x or y or z) coordinates are in ascending (+) ordering or in
 % 	descending order (-).
 \def\pgfplots at PREPARE@COORD at STREAM@end at determinecoordsorting#1{%
@@ -4365,7 +4405,7 @@
 %
 % The trafo is expected to prepare meta information before it is used
 % as input to \pgfplotscolormapaccess (or
-% \pgfplotscolormapdefinemappedcolor). Thus, the 10^k is chosen to be 
+% \pgfplotscolormapdefinemappedcolor). Thus, the 10^k is chosen to be
 % the same as \pgfplotscolormaprange (which is 1000 per default).
 %
 % If there is no data range (for example because meta information is
@@ -4511,7 +4551,7 @@
 \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
 % \pgfplotspointmetatransformed.
 %
@@ -4542,7 +4582,7 @@
 				its value is empty. %
 				\if1\csname pgfpmeta@\pgfplotspointmetainputhandler @explicitinput\endcsname%
 					\pgfplots at addplot@point at meta@description at of@explicit at value
-				\else 
+				\else
 					Please ensure that the value exists and is not empty
 				\fi
 			}%
@@ -4574,7 +4614,7 @@
 %    call \pgfplots at coord@stream at coord
 % \pgfplots at coord@stream at end
 %
-% #1 a sequence of coordinates of the form 
+% #1 a sequence of coordinates of the form
 %   '(x,y)' or '(x,y,z)'
 %   or
 %   '(x,y[,z]) +- (ex,ey)'
@@ -4875,7 +4915,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
 %
 % A coordinate stream which works like this:
-% 
+%
 % -------------
 % \pgfplots at coord@stream at start
 %
@@ -4918,7 +4958,7 @@
 % A common routine which resets internal data structures for the
 % survey phase, i.e. it is the shared implementation for all \addplot
 % variations.
-% 
+%
 % It takes all options which are provided to \addplot, sets them (at
 % least partially) and remembers them for the command serialization.
 %
@@ -4933,11 +4973,12 @@
 % 	- internal datastructures are initialised (coordinate indexing, fpu)
 % 	- all keys which are required for the current plot are determined
 % 	(and set if necessary).
-% 	They are stored into 
+% 	They are stored into
 % 	\pgfplots at addplot@survey@@optionlist.
-%    
+%
 \def\pgfplots at start@plot at with@behavioroptions#1{%
 	%\begingroup%<-- has been moved to \pgfplots at addplotimpl@plot at withoptions
+	\def\pgfplotsaxisplotphase{S}% "in survey"
 	\c at pgfplots@coordindex=0
 	\def\pgfplots at current@point at coordindex{\the\c at pgfplots@coordindex}% can be used inside of coordinate filters.
 	\def\coordindex{\pgfplots at current@point at coordindex}% valid inside of \addplot
@@ -4967,7 +5008,7 @@
 	\fi
 	%
 	% make sure it is reset, just in case it is not supported by the
-	% input method. 
+	% input method.
 	\pgfplotsscanlinelengthinitzero
 	%
 	\pgfplots at getcurrent@plothandler\pgfplots at basiclevel@plothandler
@@ -5072,12 +5113,12 @@
 % The main interface to draw a plot into an axis.
 %
 % Usage:
-% \addplot 
+% \addplot
 % 	plot coordinates {
 % 		(0,0)
 % 		(1,1)
 % 	};
-% 
+%
 % or
 %
 % \addplot[color=blue,mark=*]
@@ -5087,14 +5128,14 @@
 % 	};
 %
 % or one of the other input types.
-% 
+%
 % The first syntax will use the next plot specification in the list
 % \autoplotspeclist
-% and the first will use blue color and * markers. 
+% and the first will use blue color and * markers.
 %
 % \addplot [<style options>]  plot[<behavior options>]  <input type and args> <post plot path> ;
 % \addplot3[<style options>]  plot[<behavior options>]  <input type and args> <post plot path> ;
-% 
+%
 % The complete accumulation is done GLOBALLY. It should be safe to put
 % '\addplot' into local groups.
 %
@@ -5103,7 +5144,7 @@
 %
 % Low-level implementation:
 %
-% \pgfplots at addplot 
+% \pgfplots at addplot
 % \pgfplots at addplotimpl
 % \pgfplots at start@plot at with@behavioroptions <--- \begingroup
 % ...
@@ -5132,7 +5173,7 @@
 		}{%
 			\pgfplots at getautoplotspec into\nextplotspec
 			% the space after ']' is required here:
-			% FIXME: 
+			% FIXME:
 			% - \addplot[]plot coordinates is NOT allowed!?
 			\expandafter\pgfplots at addplotimpl\expandafter[\nextplotspec]%
 		}%
@@ -5164,7 +5205,7 @@
 	\begingroup% <-- This groups ends in \pgfplots at end@plot
 	%
 	\pgfplotsutil at ifnextchar c{%
-		\pgfplots at addplotimpl@coordinates{#1}{#2}plot 
+		\pgfplots at addplotimpl@coordinates{#1}{#2}plot
 	}{%
 		\pgfplotsutil at ifnextchar f{%
 			\pgfplots at addplotimpl@f{#1}{#2}%
@@ -5230,7 +5271,7 @@
 \long\def\pgfplots at addplotimpl@fillbetween at opt@#1#2#3#4{%
 	\pgfkeysifdefined{/tikz/fill between/of/. at cmd}{%
 		\pgfplotslibraryfillbetween at addplot{#1,#2}{#3}{#4}%
-	}{%	
+	}{%
 		\pgfplotsthrow{invalid argument}
 		{\pgfplots at loc@TMPa}%
 		{Please load \string\usepgfplotslibrary{fillbetween} in order to use `\string\addplot\space fill between'.}%
@@ -5244,7 +5285,7 @@
 
 % PRECONDITION:
 % 	the key-value sets have all been set in the current scope.
-% 
+%
 % POSTCONDITION:
 % 	1. the following macros are initialised and sanitized:
 % 	\pgfplots at plot@domain
@@ -5259,9 +5300,9 @@
 % 		/pgfplots/mesh/rows
 % 		/pgfplots/mesh/cols
 % 		/pgfplots/samples y (will contain a value )
-% 	3. the macro 
-% 		\b at pgfplots@should at sample@LINE 
-% 		will be 
+% 	3. the macro
+% 		\b at pgfplots@should at sample@LINE
+% 		will be
 % 		\def\b at pgfplots@should at sample@LINE{1}
 % 		if the expression plotter should sample a line
 % 		and
@@ -5272,7 +5313,7 @@
 	\pgfkeysgetvalue{/pgfplots/samples y}\pgfplots at plot@samples at y
 	\pgfkeysgetvalue{/pgfplots/samples at}\pgfplots at plot@samples at at
 	\pgfkeysgetvalue{/pgfplots/variable y}\pgfplots at plot@var at y
-	% 
+	%
 	\ifx\pgfplots at plot@samples at y\pgfutil at empty
 	\else
 		\pgfplotscoordmath{default}{parse int}{\pgfplots at plot@samples at y}%
@@ -5306,7 +5347,7 @@
 	\fi
 	%
 	% Check if we have to sample a line or a matrix.
-	% 
+	%
 	\pgfkeysgetvalue{/pgfplots/sample dim}\pgfplots at loc@TMPa
 	\def\pgfplots at loc@TMPb{auto}%
 	\ifx\pgfplots at loc@TMPa\pgfplots at loc@TMPb
@@ -5444,6 +5485,25 @@
 	\def\pgfplots at addplotimpl@expression at hasuniform@y{0}%
 	%
 	%
+	%
+	% if(
+	% 	x is logarithmic &&
+	% 	#1 == '\x' &&
+	% 	the 'samples at' key has not been used )
+	%  -> sample logarithmically!
+	\def\pgfplots at samples@logarithmically at x{0}%
+	\ifpgfplots at xislinear
+	\else
+		\if\pgfplots at addplotimpl@expression at hasuniform@x1%
+			\ifx\pgfplots at plot@samples at at\pgfutil at empty
+				% we don't have 'samples at' -> use domain!
+				\def\pgfplots at samples@logarithmically at x{1}%
+			\fi
+		\fi
+	\fi
+	%
+	\def\pgfplots at samples@logarithmically at y{0}%
+	%
 	% Now, prepare the loops.
 	%
 	% I am using \pgfplotsforeachungrouped in favor of
@@ -5460,15 +5520,6 @@
 		}%
 		\pgfplots at addplotimpl@expression at split@yz#2\pgfplots at EOI%
 		%
-		\ifx\pgfplots at plot@samples at at\pgfutil at empty
-			% we don't have 'samples at' -> use domain!
-			\expandafter\pgfplots at domain@to at foreach\pgfplots at plot@domain\relax{\pgfplots at plot@samples}%
-			\let\pgfplots at expression@xdomain=\pgfplotsretval
-		\else
-			% use 'samples at':
-			\let\pgfplots at expression@xdomain=\pgfplots at plot@samples at at
-		\fi
-		%
 		% do we have '\y' as y coordinate?
 		\expandafter\def\expandafter\pgfplots at loc@TMPb\expandafter{\pgfplots at plot@var at y}%
 		\ifx\pgfplots at addplotimpl@expression at yEXPR\pgfplots at loc@TMPb
@@ -5487,37 +5538,137 @@
 			\fi
 		\fi
 		%
+		\ifpgfplots at yislinear
+		\else
+			\if\pgfplots at addplotimpl@expression at hasuniform@y1%
+				\def\pgfplots at samples@logarithmically at y{1}%
+			\fi
+		\fi
 		%
+		\ifpgfplots at threedim@log at sampling
+		\else
+			\def\pgfplots at samples@logarithmically at x{0}%
+			\def\pgfplots at samples@logarithmically at y{0}%
+		\fi
+		%
+		\if\pgfplots at samples@logarithmically at x1%
+		\else
+			\ifx\pgfplots at plot@samples at at\pgfutil at empty
+				% we don't have 'samples at' -> use domain!
+				\expandafter\pgfplots at domain@to at foreach\pgfplots at plot@domain\relax{\pgfplots at plot@samples}%
+				\let\pgfplots at expression@xdomain=\pgfplotsretval
+			\else
+				% use 'samples at':
+				\let\pgfplots at expression@xdomain=\pgfplots at plot@samples at at
+			\fi
+		\fi
+		%
+		\if\pgfplots at samples@logarithmically at x1%
+			\if\pgfplots at samples@logarithmically at y1%
+				\pgfplots at warning{Sorry, 3d log sampling in BOTH x and y is not implemented yet}%
+				\def\pgfplots at samples@logarithmically at y{0}%
+			\fi
+		\fi
+		%
 		\if0\b at pgfplots@should at sample@LINE
 			% Samples twodimensionally (a lattice):
-			\expandafter\pgfplots at domain@to at foreach\pgfplots at plot@ydomain\relax{\pgfplots at plot@samples at y}%
-			\let\pgfplots at expression@ydomain=\pgfplotsretval
+			\if\pgfplots at samples@logarithmically at y0%
+				\expandafter\pgfplots at domain@to at foreach\pgfplots at plot@ydomain\relax{\pgfplots at plot@samples at y}%
+				\let\pgfplots at expression@ydomain=\pgfplotsretval
+			\fi
 			%
-			% Assemble a 
-			% \pgfplots at plot@data##1 -> 
-			% 	\foreach \y in {-5,-4.6,...,5} {##1}; 
-			% 		\foreach \x in {-5,-4.6,...,5} 
+			% Assemble a
+			% \pgfplots at plot@data##1 ->
+			% 	\foreach \y in {-5,-4.6,...,5} {##1};
+			% 		\foreach \x in {-5,-4.6,...,5}
 			%  macro:
-			\edef\pgfplots at plot@data##1{%
-				\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots at plot@var at y in {\pgfplots at expression@ydomain} 
-					{%
-						\pgfplots at plot@data at notify@next at y
-						\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz at plot@var in {\pgfplots at expression@xdomain} {%
-							\pgfplots at plot@data at notify@next at x
-							##1%
+			\if\pgfplots at samples@logarithmically at x0%
+				\if\pgfplots at samples@logarithmically at y0%
+					% standard case: no log sampling.
+					\edef\pgfplots at plot@data##1{%
+						\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots at plot@var at y in {\pgfplots at expression@ydomain}
+							{%
+								\pgfplots at plot@data at notify@next at y
+								\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz at plot@var in {\pgfplots at expression@xdomain} {%
+									\pgfplots at plot@data at notify@next at x
+									##1%
+								}%
+								\noexpand\pgfplotsplothandlernotifyscanlinecomplete
+							}%
 						}%
-						\noexpand\pgfplotsplothandlernotifyscanlinecomplete
-					}%
-				}%
+				\fi
+			\fi
+			\if\pgfplots at samples@logarithmically at x1%
+				\if\pgfplots at samples@logarithmically at y0%
+					% sample logarithmically in X:
+					\edef\pgfplots at plot@data##1{%
+						\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\pgfplots at plot@var at y in {\pgfplots at expression@ydomain}
+							{%
+								\pgfplots at plot@data at notify@next at y
+								%
+								\noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots at plot@samples][x]
+									\expandafter\noexpand\tikz at plot@var/\noexpand\pgfplots at current@point at x@log
+									in {\pgfplots at plot@domain}%
+								{%
+									\pgfplots at plot@data at notify@next at x
+									##1%
+								}%
+								\noexpand\pgfplotsplothandlernotifyscanlinecomplete
+							}%
+						}%
+				\fi
+			\fi
+			\if\pgfplots at samples@logarithmically at x0%
+				\if\pgfplots at samples@logarithmically at y1%
+					% sample logarithmically in Y:
+					\edef\pgfplots at plot@data##1{%
+						\noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots at plot@samples at y][y]
+							\expandafter\noexpand\pgfplots at plot@var at y/\noexpand\pgfplots at current@point at y@log
+							in {\pgfplots at plot@ydomain}%
+							{%
+								\pgfplots at plot@data at notify@next at y
+								\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz at plot@var in {\pgfplots at expression@xdomain} {%
+									\pgfplots at plot@data at notify@next at x
+									##1%
+								}%
+								\noexpand\pgfplotsplothandlernotifyscanlinecomplete
+							}%
+						}%
+				\fi
+			\fi
+			\if\pgfplots at samples@logarithmically at x1%
+				\if\pgfplots at samples@logarithmically at y1%
+					% sample logarithmically in X and Y:
+					% FIXME : IMPLEMENT!
+					% FIXME : implementation UNFINISHED: also support log
+					% sampling in BOTH 'x' 'y'!
+					% requires to solve FIXME in \pgfplotsforeachlogarithmicungrouped)
+					% -> also adopt  unittest_log_sampling_3d.tex
+					%
+				\fi
+			\fi
 		\else
 			% sample a line:
 			\def\pgfplots at plot@ydomain{0:0}%
-			\edef\pgfplots at plot@data##1{%
-				\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz at plot@var in {\pgfplots at expression@xdomain} {%
-					\pgfplots at plot@data at notify@next at x
-					##1%
+			\if\pgfplots at samples@logarithmically at x1%
+				% sample logarithmically:
+				\edef\pgfplots at plot@data##1{%
+					\noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots at plot@samples][x]
+					\expandafter\noexpand\tikz at plot@var/\noexpand\pgfplots at current@point at x@log
+						in {\pgfplots at plot@domain}%
+					{%
+						\pgfplots at plot@data at notify@next at x
+						##1%
+					}%
 				}%
-			}%
+			\else
+				\edef\pgfplots at plot@data##1{%
+					\noexpand\pgfplotsforeachungrouped\expandafter\noexpand\tikz at plot@var in {\pgfplots at expression@xdomain} {%
+						\pgfplots at plot@data at notify@next at x
+						##1%
+					}%
+				}%
+			\fi
 			%
 			% If we have (\x,\y,f(x)), use (\x,0,f(x)) instead and
 			% suppress the error message which would occur for \y.
@@ -5529,31 +5680,13 @@
 			\fi
 		\fi
 	\else
-		% Assemble a 
+		% Assemble a
 		% \pgfplots at plot@data##1 -> \foreach \x in {-5,-4.6,...,5} {##1} macro:
-		%
-		%
-		% if( 	
-		% 	x is logarithmic && 
-		% 	#1 == '\x' && 
-		% 	the 'samples at' key has not been used )
-		%  -> sample logarithmically!
-		\def\pgfplots at samples@logarithmically{0}%
-		\ifpgfplots at xislinear
-		\else
-			\if\pgfplots at addplotimpl@expression at hasuniform@x1%
-				\ifx\pgfplots at plot@samples at at\pgfutil at empty
-					% we don't have 'samples at' -> use domain!
-					\def\pgfplots at samples@logarithmically{1}%
-				\fi
-			\fi
-		\fi
-		\if\pgfplots at samples@logarithmically1%
-			\def\pgfplotsforeachlogarithmicmathid{x}% use \pgfplotscoordmath{x}
+		\if\pgfplots at samples@logarithmically at x1%
 			% sample logarithmically:
 			\edef\pgfplots at plot@data##1{%
-				\noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots at plot@samples]
-				\expandafter\noexpand\tikz at plot@var/\noexpand\pgfplots at current@point at x@log 
+				\noexpand\pgfplotsforeachlogarithmicungrouped[\pgfplots at plot@samples][x]
+				\expandafter\noexpand\tikz at plot@var/\noexpand\pgfplots at current@point at x@log
 					in {\pgfplots at plot@domain}%
 				{%
 					\pgfplots at plot@data at notify@next at x
@@ -5560,26 +5693,6 @@
 					##1%
 				}%
 			}%
-			%  we have a logarithmic sampling sequence,
-			% \pgfplots at current@point at x@log is already available
-			% logarithmic! We can safe time and accuracy for the x
-			% coordinate by using that one instead of computing
-			% log(exp(\x)) numerically:
-			\pgfplots at disablelogfilter@xtrue
-			\def\pgfplots at addplotimpl@expression at prepare@x{%
-				\let\pgfplots at current@point at x=\pgfplots at current@point at x@log
-			}%
-			\pgflibraryfpuifactive
-				{\relax}
-				{%
-					% ok, if the FPU is NOT active, we should return
-					% results as fixed points.
-					% We need to configure that for
-					% \pgfplotsforeachlogarithmicungrouped manually:
-					\pgfplotsforeachlogarithmicformatresultwith{%
-						\pgfmathfloattofixed{\pgfmathresult}%
-					}%
-				}%
 		\else
 			\ifx\pgfplots at plot@samples at at\pgfutil at empty
 				% we don't have 'samples at' -> use domain!
@@ -5604,6 +5717,50 @@
 	\fi
 	%
 	%
+	\if\pgfplots at samples@logarithmically at x1%
+		%  we have a logarithmic sampling sequence,
+		% \pgfplots at current@point at x@log is already available
+		% logarithmic! We can safe time and accuracy for the x
+		% coordinate by using that one instead of computing
+		% log(exp(\x)) numerically:
+		\pgfplots at disablelogfilter@xtrue
+		\def\pgfplots at addplotimpl@expression at prepare@x{%
+			\let\pgfplots at current@point at x=\pgfplots at current@point at x@log
+		}%
+		\pgflibraryfpuifactive
+			{\relax}
+			{%
+				% ok, if the FPU is NOT active, we should return
+				% results as fixed points.
+				% We need to configure that for
+				% \pgfplotsforeachlogarithmicungrouped manually:
+				\pgfplotsforeachlogarithmicformatresultwith{%
+					\pgfmathfloattofixed{\pgfmathresult}%
+				}%
+			}%
+	\fi
+	\if\pgfplots at samples@logarithmically at y1%
+		%  we have a logarithmic sampling sequence,
+		% \pgfplots at current@point at y@log is already available
+		% logarithmic! We can safe time and accuracy for the y
+		% coordinate by using that one instead of computing
+		% log(exp(\y)) numerically:
+		\pgfplots at disablelogfilter@ytrue
+		\def\pgfplots at addplotimpl@expression at prepare@y{%
+			\let\pgfplots at current@point at y=\pgfplots at current@point at y@log
+		}%
+		\pgflibraryfpuifactive
+			{\relax}
+			{%
+				% ok, if the FPU is NOT active, we should return
+				% results as fixed points.
+				% We need to configure that for
+				% \pgfplotsforeachlogarithmicungrouped manually:
+				\pgfplotsforeachlogarithmicformatresultwith{%
+					\pgfmathfloattofixed{\pgfmathresult}%
+				}%
+			}%
+	\fi
 	% START:
 	%  (NOTE: this does also define 'x', 'y', and 'z' math
 	%  expressions!)
@@ -5724,7 +5881,7 @@
 	\expandafter\let\csname #3 at max\endcsname=\pgfmathresult%
 }%
 \def\pgfplots at addplotimpl@expression at streamall{%
-	% create a backup of the 'x' and 'y' math expressions which 
+	% create a backup of the 'x' and 'y' math expressions which
 	% have been defined in \pgfplots at coord@stream at start:
 	\let\pgfplots at addplotimpl@expression at pseudoconst@old at x=\pgfmathx@
 	\let\pgfplots at addplotimpl@expression at pseudoconst@old at y=\pgfmathy@
@@ -5758,7 +5915,7 @@
 	% negative arguments:
 	% \x^3 ---> -0.2^3  but x^3 = (-0.2)^3 .
 	% This does not happen for use fpu=true.
-	% 
+	%
 	\pgfplots at plot@data{%
 		\let\pgfmathx@=\pgfplots at addplotimpl@expression at pseudoconst@x
 		\let\pgfmathy@=\pgfplots at addplotimpl@expression at pseudoconst@y
@@ -5918,7 +6075,7 @@
 
 \let\pgfplots at backupof@pgfplotxyfile=\pgfplotxyfile
 
-% the following code 
+% the following code
 % results finally in
 %
 % set format "%.7e";; set samples <...>; plot ...
@@ -5973,7 +6130,7 @@
 		\ifx\pgfplots at gnuplot@dummy\pgfutil at empty
 		\else
 			\expandafter\pgfutil at in@\expandafter,\expandafter{\pgfplots at gnuplot@dummy}%
-			\ifpgfutil at in@	
+			\ifpgfutil at in@
 				\def\pgfplots at loc@TMPa##1,##2\pgfeov{\pgfplotsset{variable={##1},variable y={##2}}}%
 			\else
 				\def\pgfplots at loc@TMPa##1\pgfeov{\pgfplotsset{variable={##1}}}%
@@ -6034,10 +6191,10 @@
 			set dummy \pgfplots at gnuplot@x\if0\b at pgfplots@should at sample@LINE,\pgfplots at gnuplot@y\fi;
 			\ifx\pgfplots at gnuplot@logdirs\pgfutil at empty
 			\else
-				set logscale \pgfplots at gnuplot@logdirs\space 2.71828182845905; 
+				set logscale \pgfplots at gnuplot@logdirs\space 2.71828182845905;
 			\fi
 			\iftikz at plot@parametric	set parametric;\fi
-			\ifpgfplots at curplot@threedim 
+			\ifpgfplots at curplot@threedim
 				\if0\b at pgfplots@should at sample@LINE
 					% Samples twodimensionally (a lattice):
 					% and the isosamples thing confuses me.
@@ -6134,7 +6291,7 @@
 	\ifpgfplots at loop@CONTINUE
 		 % Now, invoke 'plot file'.
 		 %
-		 % I invoke the private '@opt@' method because the semicolon ';' 
+		 % I invoke the private '@opt@' method because the semicolon ';'
 		 % character may cause problems due to catcode mismatches.
 		 % *sigh*.
 		\pgfplots at addplotimpl@file at opt@@{}{}{#2}{#1}% this does not invoke the \pgfplots at start@plot at with@behavioroptions method.
@@ -6159,7 +6316,7 @@
 	\pgfplots at gettikzinternal@keyval{prefix}{tikz at plot@prefix}{\jobname.}%
 	\pgfplots at gettikzinternal@keyval{id}{tikz at plot@id}{pgf-shell}%
 	%
-	\def\pgfplots at plot@filename{\tikz at plot@prefix\tikz at plot@id}%  
+	\def\pgfplots at plot@filename{\tikz at plot@prefix\tikz at plot@id}%
 	\def\pgfplots at plot@data{\pgfshell[\pgfplots at plot@filename]{#4}\pgfplotxyfile{\pgfplots at plot@filename.out}}%
 	\def\pgfplotxyfile{\pgfplots at addplotimpl@shellresult{#5}}%
 	\pgfplots at plot@data
@@ -6180,7 +6337,7 @@
 	\ifpgfplots at loop@CONTINUE
 		 % Now, invoke 'plot file'.
 		 %
-		 % I invoke the private '@opt@' method because the semicolon ';' 
+		 % I invoke the private '@opt@' method because the semicolon ';'
 		 % character may cause problems due to catcode mismatches.
 		 % *sigh*.
 		\pgfplots at addplotimpl@file at opt@@{}{}{#2}{#1}%
@@ -6312,7 +6469,7 @@
 		/pgfplots/filter discard warning=false,
 		/pgfplots/mesh/rows=2,% allow \addplot[surf] graphics ... --> yields a good legend.
 		/pgfplots/mesh/cols=2,
-		/pgfplots/mesh/check=false,
+		/pgfplots/mesh/check=false,%
 		#1,/pgfplots/.cd,#2,%
 		/pgfplots/plot graphics/@prepare legend,
 		/pgfplots/plot graphics,%
@@ -6380,7 +6537,7 @@
 % automatically.
 %
 % Input options can be provided in '#2' using
-% - column names, 
+% - column names,
 %   	for example '/pgfplots/table/x=firstcol' or just 'x=firstcol'
 %
 % - column indices,
@@ -6395,14 +6552,14 @@
 %   	\columnerrory, \columnerrorz
 %   	Provide access to the cell content which would be used without
 %   	'expr'.
-%   	The first three access the input coordinate columns, \meta the meta column 
-%   	(if any) and the last three the error data (if any). 
+%   	The first three access the input coordinate columns, \meta the meta column
+%   	(if any) and the last three the error data (if any).
 %
-%		That means it is allowed to provide both, 'x' and 'x expr': 
+%		That means it is allowed to provide both, 'x' and 'x expr':
 %		'x expr' can use the (old) value stored in 'x'. the final x
 %		coordinate will be that returned of 'x expr'.
 %
-%   	- \coordindex 
+%   	- \coordindex
 %
 %   	- \lineno (physical line numbers including comments etc)
 %
@@ -6488,7 +6645,7 @@
 	\pgfplots at addplotimpl@table at fromstructure@prepareexpr at for{#1}{#3}{#4}%
 }
 
-% Invokes `#1' if the command is invoked within 
+% Invokes `#1' if the command is invoked within
 %   \addplot table {<\macro>};
 % and `#2' if not.
 \def\pgfplotsifinaddplottablestruct#1#2{%
@@ -6571,7 +6728,7 @@
 	\ifpgfplotslistempty
 		\pgfplots at loop@CONTINUEfalse
 	\else
-		% This here is just for sanity checking: if the 'y' column is 
+		% This here is just for sanity checking: if the 'y' column is
 		% - for whatever reasons - invalid; provide good error
 		%   recovery.
 		\pgfplotslistcheckempty\addplot at tbl@y
@@ -6671,7 +6828,7 @@
 % PRECONDITION:
 % 	\pgfplots at plot@tbl@#1 contains the column name which would be used
 % 	if '#1 expr' is empty.
-% 
+%
 % POSTCONDITION:
 % 	\pgfplots at plot@tbl@#1 will be CHANGED to use the 'expr' column (a
 % 	temporary name).
@@ -6694,7 +6851,7 @@
 	\pgfkeysgetvalue{/pgfplots/table/#1 expr}{\pgfplots at loc@TMPa}%
 	\ifx\pgfplots at loc@TMPa\pgfutil at empty
 	\else
-		% get expression into register: 
+		% get expression into register:
 		\t at pgfplots@toka=\expandafter{\pgfplots at loc@TMPa}%
 		%
 		%
@@ -7007,7 +7164,7 @@
 	\pgfplots at gettikzinternal@keyval{prefix}{tikz at plot@prefix}{\jobname.}%
 	\pgfplots at gettikzinternal@keyval{id}{tikz at plot@id}{pgf-shell}%
 	%
-	\def\pgfplots at plot@filename{\tikz at plot@prefix\tikz at plot@id}%  
+	\def\pgfplots at plot@filename{\tikz at plot@prefix\tikz at plot@id}%
 	\pgfshell[\pgfplots at plot@filename]{#3}\pgfplots at addplotimpl@table at fromfile{#1}{#2}{\pgfplots at plot@filename.out}#4;%
 }%
 
@@ -7069,7 +7226,7 @@
 
 % \numplotsofactualtype
 % Expands to the number of plots which have been seen in the current
-% axis and which have the same type as the actual plot handler. 
+% axis and which have the same type as the actual plot handler.
 %
 % See also \plotnumofactualtype
 \def\pgfplots at numplotsofactualtype{%
@@ -7095,6 +7252,7 @@
 	%
 	\pgfplotssurveyphase at setactiveplothandlers
 	%
+	\def\plotnum{\the\pgfplots at numplots}%
 	\let\numplotsofactualtype=\pgfplots at numplotsofactualtype@duringplot
 	%
 	% Store this name during the \addplot command. Thus, even if the
@@ -7400,7 +7558,7 @@
 	\fi
 }%
 
-% Takes the current point (defined by a set of macros) as input and defines \pgf at x and \pgf at y 
+% Takes the current point (defined by a set of macros) as input and defines \pgf at x and \pgf at y
 % as the output point. It also defines
 % \pgfplots at current@point at x and its variants to contain the
 % transformed canvas coords (those which can be given to
@@ -7484,7 +7642,7 @@
 
 % Defines where to expect INPUT coordinates
 % \pgfplotspointgetcoordinatesfromnormalized[path=/data point/
-% would expect input coordinates 
+% would expect input coordinates
 %   /data point/x
 %   /data point/y
 %   /data point/z
@@ -7491,7 +7649,7 @@
 \pgfkeyssetvalue{/pgfplots/coords/path}{/data point}
 
 % \pgfplotspointgetcoordinatesfromnormalized[target path=/data point/zero/
-% would write output coordinates 
+% would write output coordinates
 %   /data point/zero/x
 %   /data point/zero/y
 %   /data point/zero/z
@@ -7533,7 +7691,7 @@
 	\let#2=\pgfmathresult
 }%
 
-% Defines an optimized and matching \pgfplotsaxisvisphasetransformcoordinate 
+% Defines an optimized and matching \pgfplotsaxisvisphasetransformcoordinate
 % during the coordinate finalization step in \end{axis}.
 \def\pgfplots at coord@stream at INIT@finalize at storedcoords@prepare at scaletrafomacro{%
 	\begingroup
@@ -7715,14 +7873,14 @@
 % The argument '#1' is optional: if you leave it away, the current value of the 'pos' key will be used.
 % This method will work for most plot handlers, although some of them might be unsupported.
 %
-% As a side-effect, it defines the (global) macros 
+% As a side-effect, it defines the (global) macros
 % - \pgfplotspointplotattimefirst  the start coordinate of the line segment containing #1
 % - \pgfplotspointplotattimesecond the end   coordinate of the line segment containing #1
 % - \pgfplotspointplotattimecoords the coordinates of #1
-% The first two are interesting in order to allow the computation of gradients. 
+% The first two are interesting in order to allow the computation of gradients.
 %	\pgfplotsplothandlerpointtokeys{/data point}%
 % for the \pgfplotspointplotattimecoords point
-% 
+%
 % Any of these macros can be decoded using
 % \pgfplotsplothandlerdeserializepointfrom\pgfplotspointplotattimesecond
 % \pgfplotsaxisvisphasegetpoint
@@ -7738,7 +7896,7 @@
 	\else
 	\pgfplotspointplotattimegetfromcache{#1}%
 	\ifpgfplots at loc@tmp
-		% CACHE HIT! 
+		% CACHE HIT!
 %\message{CACHE HIT for \string\pgfplotspointplotattime{#1}^^J}%
 	\else
 %\message{NO cache hit for \string\pgfplotspointplotattime{#1}^^J}%
@@ -7879,9 +8037,9 @@
 }%
 
 % A macro which is invoked whenever \pgfplotspointplotattime found a
-% line segment. 
+% line segment.
 %
-% INPUT: 
+% INPUT:
 %  - \pgfplots at cur : serialized current point. This current point's
 %     properties are available in the macros
 %    \pgfplots at current@point@[xyz] etc.
@@ -7969,7 +8127,7 @@
 	\fi
 }%
 
-% INPUT: 
+% INPUT:
 % 	either floating point or fixed point coordinates (depending on the
 % 	state of the \ifpgfplots at apply@datatrafo boolean)
 %
@@ -8047,7 +8205,7 @@
 	\fi
 }%
 
-	
+
 % This routine is called at the begin of every plot.
 % It initialises a zero level stream.
 %
@@ -8061,7 +8219,7 @@
 		%    "draw zero level coordinates from list XYZ."
 		% But at the time of this initialisation, the list will be EMPTY!
 		%
-		% It will be filled later. That's ok, because 
+		% It will be filled later. That's ok, because
 		% \pgfplots at initzerolevelhandler will be
 		% used as 'precommand', that means before Tikz sees any
 		% coordinates.
@@ -8184,7 +8342,7 @@
 	% \ifpgfplots at threedim
 	% 	\pgfkeyslet{/pgfplots/axis/zero/z}\pgfplots at logical@ZERO at z
 	% \fi
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 }%
 
 
@@ -8346,8 +8504,8 @@
 }%
 
 % PRECONDITION:
-% 	\pgfplotsplothandlergraphicspointmappointindex is 
-% 	empty if and only if (#4,#5) is empty 
+% 	\pgfplotsplothandlergraphicspointmappointindex is
+% 	empty if and only if (#4,#5) is empty
 % 	or it is an index among all points with non--empty (#4,#5) image
 % 	coordinates.
 \def\pgfplotsplothandlergraphicspointmappoint(#1,#2,#3)(#4,#5){%
@@ -8403,7 +8561,7 @@
 		% involved vectors). Thus, a simple approach is to provide 4
 		% linearly independend points to get 8 equations.
 		%
-		% Then, I solve for o,e_x,e_y,e_z 
+		% Then, I solve for o,e_x,e_y,e_z
 		%
 		\pgfplotsmatrixnewempty\pgfplotsmatrix
 		\pgfplotsmatrixresize\pgfplotsmatrix88%
@@ -8421,8 +8579,8 @@
 			\def\pgfplots at logical@z{##3}%
 		}%
 		% Assemble the linear system such that
-		% x = [ 
-		%  exx 
+		% x = [
+		%  exx
 		%  exy
 		%  eyx
 		%  eyy
@@ -8565,13 +8723,13 @@
 				\t at pgfplots@tokc=\expandafter{\pgfplots at loc@TMPa}%
 				\immediate\write
 					\if1\pgfplotsplothandlergraphicspointmapcomputerequiredview at debug 16\else -1\fi
-					{PGFPlots plot graphics[auto adjust axis=true] {\the\t at pgfplots@tokc} \csname on at line\endcsname: determined options '\pgfplotsretval'. 
+					{PGFPlots plot graphics[auto adjust axis=true] {\the\t at pgfplots@tokc} \csname on at line\endcsname: determined options '\pgfplotsretval'.
 					\if1\pgfplotsplothandlergraphicspointmapcomputerequiredview at debug
 						See \the\t at pgfplots@tokc.dat for debug output.
 					\else
 						Use 'plot graphics[debug]' or 'plot graphics[debug=visual]' to generate debug output files.
 					\fi
-					^^J}% 
+					^^J}%
 				\endgroup
 			\fi
 			%
@@ -8700,9 +8858,9 @@
 	%  DD_x / dd_x = W / w
 	%  DD_y / dd_y = H / h
 	%
-	% where (W,H) is the natural size (i.e. in IMAGE coordinates) of the picture and 
+	% where (W,H) is the natural size (i.e. in IMAGE coordinates) of the picture and
 	% (w,h) is the size the picture will occupy in CANVAS coordinates.
-	%  
+	%
 	\pgfmath at basic@multiply@{\pgfplots at x@rel}{\pgfplots at W}%
 	\let\pgfplots at w=\pgfmathresult
 	%
@@ -8825,7 +8983,7 @@
 	\pgfsetfillcolor{green}%
 	\pgfpathcircle{\pgfplots at point@canvas}{2pt}%
 	\pgfusepath{stroke,fill}%
-	\draw[->,red] 
+	\draw[->,red]
 		\pgfextra{
 			\pgfpathmoveto{\pgfplots at point@canvas at check}%
 			\pgfpathlineto{\pgfplots at point@canvas}};
@@ -8846,8 +9004,8 @@
 		\pgfplots at error{Error using 'plot graphics': I got too few coordinates! I expected the lower left and upper right corners!}%
 		\xdef\pgfplots at plot@handler at graphics@bb at first{\noexpand\pgfqpoint{0pt}{0pt}}%
 		\xdef\pgfplots at plot@handler at graphics@bb at first{\noexpand\pgfqpoint{0pt}{0pt}}%
-		
-	\fi	
+
+	\fi
 	\begingroup
 	% determine the lower left / upper right corners.
 	\pgfplots at plot@handler at graphics@bb at first

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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-2015 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -26,7 +26,7 @@
 
 % The low-level tikz plot handler for 3D mesh and surface plots.
 %
-% It expects 
+% It expects
 % a) a coordinate stream which is a linearized matrix, iterated either
 % rowwise or column wise,
 % b) the current set of options in /pgfplots/mesh/.
@@ -55,7 +55,7 @@
 % 		pgfplots axes - as long as \pgfplots at current@point at meta is in
 % 		the range [0,1000].
 % 	- for the case 'shader=interp', a bounding box must be established
-% 	before the plot is finished. This must be done using 
+% 	before the plot is finished. This must be done using
 %	\def\pgfplotspointbbupperright{\pgfqpointxyz{2}{2}{0.9}}
 %	\def\pgfplotspointbblowerleft {\pgfqpointxyz{0}{0}{0.1}}
 %	or something like that.
@@ -76,24 +76,24 @@
 % 		mesh/rows=4,
 % 		mesh/cols=4,
 % 		mesh/num points=,
-% 		/tikz/x={(0.44237cm,-0.07439cm)}, 
+% 		/tikz/x={(0.44237cm,-0.07439cm)},
 % 		/tikz/y={(0.30942cm,0.23932cm)},
 % 		/tikz/z={(0.0cm,1.5cm)},
 % 	]
 % \makeatletter
-% 
+%
 % 	\global\let\pgfplots at metamax=\pgfutil at empty
 % 	\pgfplots at curplot@threedimtrue
-% 
+%
 % 	\pgfplotsplothandlermesh
 % 	\pgfplotstreamstart
-% 
+%
 % 	\def\rangea{0.21}%
 % 	\def\rangeb{0.9}%
-% 
+%
 % 	\pgfmathparse{1000/(\rangeb-\rangea)}
 % 	\let\factor=\pgfmathresult
-% 
+%
 % 	\def\simplecoordinate(#1,#2,#3){%
 % 		\pgfmathparse{\factor*(#3 - \rangea)}%
 % 		\let\pgfplots at current@point at meta=\pgfmathresult
@@ -102,31 +102,31 @@
 % 	% for the case 'shaer=interp':
 %	\def\pgfplotspointbbupperright{\pgfqpointxyz{2}{2}{0.9}}
 %	\def\pgfplotspointbblowerleft {\pgfqpointxyz{0}{0}{0.1}}
-% 
+%
 % \simplecoordinate(0,3,0.7)
 % \simplecoordinate(1,3,0.5)
 % \simplecoordinate(2,3,0.58)
 % \simplecoordinate(3,3,0.9)
-% 
+%
 % \simplecoordinate(0,2,0.68)
 % \simplecoordinate(1,2,0.22)
 % \simplecoordinate(2,2,0.25)
 % \simplecoordinate(3,2,0.4)
-% 
+%
 % \simplecoordinate(0,1,0.6)
 % \simplecoordinate(1,1,0.3)
 % \simplecoordinate(2,1,0.21)
 % \simplecoordinate(3,1,0.3)
-% 
+%
 % \simplecoordinate(0,0,0.8)
 % \simplecoordinate(1,0,0.56)
 % \simplecoordinate(2,0,0.5)
 % \simplecoordinate(3,0,0.75)
-% 
-% 
+%
+%
 % 	\pgfplotstreamend
 % 	\pgfusepath{stroke}
-% 
+%
 % 	\endscope
 % \end{tikzpicture}
 % ----------------------------------------------------------
@@ -199,7 +199,7 @@
 		\fi
 	\fi
 	%
-	% 
+	%
 	\pgfplotsifisvisualizationphase{%
 		\pgfplotsplothandlermesh at init@variables
 	}{}%
@@ -223,7 +223,7 @@
 		%
 		% Prepare color data source:
 		\ifx\pgfplotspointmetainputhandler\pgfutil at empty%
-			% oh. There is no color data!? 
+			% oh. There is no color data!?
 			\pgfplotsplothandlermesh at init@path at without@point at meta
 			%
 		\else
@@ -362,7 +362,7 @@
 				% -> perhaps the check can be skipped entirely.
 				%
 				% oh. shading type=5 is *essentially* the same as
-				% matrix output, but matrix output is forbidden. 
+				% matrix output, but matrix output is forbidden.
 				% In that case, triangulate the matrix and shade the
 				% triangles:
 				\def\pgfplotsplothandlermesh at triangulate{1}%
@@ -381,7 +381,7 @@
 	\else
 		\edef\pgfplotsplothandlerLUAvisualizerfactory{
 			function(plothandler) return pgfplots.MeshVisualizer.new(
-				plothandler, 
+				plothandler,
 				\pgfplotsretval(),
 				pgfplots.pgftonumber("\pgfkeysvalueof{/pgfplots/mesh/rows}"),
 				pgfplots.pgftonumber("\pgfkeysvalueof{/pgfplots/mesh/cols}"),
@@ -403,7 +403,7 @@
 %
 % PRECONDITION:
 % 	The values of
-% - '/pgfplots/mesh/rows' 
+% - '/pgfplots/mesh/rows'
 % - '/pgfplots/mesh/cols'
 % - '/pgfplots/mesh/num points'
 % - \pgfplotsscanlinelength
@@ -429,12 +429,12 @@
 %
 % PRECONDITION:
 % 	The values of
-% - '/pgfplots/mesh/rows' 
+% - '/pgfplots/mesh/rows'
 % - '/pgfplots/mesh/cols'
 % - '/pgfplots/mesh/num points'
 % - '/pgfplots/mesh/ordering'
 %   are assigned properly.
-%   If 
+%   If
 % - \pgfplotsscanlinelength
 %   exists and is positive, it may also be used.
 %
@@ -537,7 +537,7 @@
 								\pgfplotswarning{matrix delinearize uses sqrt}{\pgfplotsplothandlermesh at rows}{\pgfplotsplothandlermesh at cols}{\pgfplotsplothandlermesh at numpoints}{\pgfmathresult}\pgfeov%
 							\else
 								\pgfplots at error{Sorry, 'plot mesh' needs either '[mesh/rows=<N>]' or '[mesh/cols=<N>]' set,
-									but it did not find any of them. 
+									but it did not find any of them.
 									I also tried rows = sqrt(num points) = sqrt(\pgfplotsplothandlermesh at numpoints) = \pgfmathresult\space without success.}%
 							\fi
 							\pgfmath at smuggleone\pgfplotsplothandlermesh at rows
@@ -616,7 +616,7 @@
 	\expandafter\pgfplots at loc@TMPa\expandafter{\pgfplotsplothandlermesh at cols}%
 }%
 
-%% 
+%%
 %% Helper structs for patch plots (surfaces)
 
 % #1: the canvas x coordinate
@@ -634,7 +634,7 @@
 }%
 
 % Assumes that #1 expands to an argument of \pgfplotspatchvertex and
-% that #2 is a macro containing another patch vertex. 
+% that #2 is a macro containing another patch vertex.
 %
 % It then replaces #2 by a new vector which is equal to #2 except for
 % the point meta which is taken from #1.
@@ -858,7 +858,7 @@
 }%
 
 % Declares a new patch class named #1.
-% 
+%
 % #1: a string name.
 % #2: methods defining the class, provided as key values. See the
 % predefined classes to adjust your own ones. Documentation about the
@@ -1011,7 +1011,7 @@
 	% type).
 	%
 	% 'sample in unit cube={<code to invoke for each sampled point>}'
-	% 
+	%
 	% It will invoke <code to invoke for each sampled point> once for
 	% every sampled vertex. The complete unit cube will be covered.
 	% Depending on the patch type, either one or more patches are
@@ -1019,8 +1019,8 @@
 	% \pgfplotspatchready will be invoked.
 	%
 	%
-	% PRECONDITION: 
-	%  -\pgfplotspatchready is defined. 
+	% PRECONDITION:
+	%  -\pgfplotspatchready is defined.
 	%
 	% Arguments:
 	%  #1: code which will be invoked whenever a new coordinate is
@@ -1078,7 +1078,7 @@
 	first vertex before z buffer/.code=
 		{\expandafter\def\csname pgfpptch\pgfplotsdeclarepatchclass@ first vertex before z buffer\endcsname{#1}},%
 	%
-	% invokes 
+	% invokes
 	% 	\pgfplotspatchvertex...\endvertex
 	% 	#1
 	% for the every vertex.
@@ -1085,7 +1085,7 @@
 	foreach vertex/.code=
 		{\expandafter\def\csname pgfpptch\pgfplotsdeclarepatchclass@ foreach vertex\endcsname##1{#1}},%
 	%
-	% invokes 
+	% invokes
 	% 	\pgfplotspatchvertex...\endvertex
 	% 	#1
 	% for every colored vertex.
@@ -1182,7 +1182,7 @@
 	% 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 at serialize@logical at coords).
 	compute normal/.code=
 		{\expandafter\def\csname pgfpptch\pgfplotsdeclarepatchclass@ compute normal\endcsname{#1}},%
@@ -1593,7 +1593,7 @@
 			% reverse xy seq
 			\let\pgfplots at loc@TMPa\pgfplotspatchclass at rect@C
 		\or
-			% sort 
+			% sort
 			\let\pgfplots at loc@TMPa\pgfplotspatchclass at rect@A
 		\else
 			% the choices 'default' or 'auto' should have been expanded already. Nothing to do here:
@@ -1614,7 +1614,7 @@
 			% reverse xy seq
 			\let\pgfplots at loc@TMPa\pgfplotspatchclass at rect@C
 		\or
-			% sort 
+			% sort
 			\let\pgfplots at loc@TMPa\pgfplotspatchclass at rect@A
 		\else
 			% the choices 'default' or 'auto' should have been expanded already. Nothing to do here:
@@ -1628,8 +1628,8 @@
 % D <-- C
 % |     ^
 % v     |
-% A --> B 
-%       
+% A --> B
+%
 \pgfplotsdeclarepatchclass{rectangle}{%
 	allow matrix=\def\pgfplotsretval{1},
 	new=\def\pgfplotspatchclass at rect@no{0},
@@ -1758,7 +1758,7 @@
 % Furthermore, for fixed v, the 'u=1' point should belong
 % to the foreground (as it is drawn on top of u=0).
 %
-% In other words, if the coons patch looks like 
+% In other words, if the coons patch looks like
 %
 % BB-------CC   <--v=1
 %  |        |
@@ -1769,7 +1769,7 @@
 %  u=0      u=1
 %
 % where the AA,BB,CC,DD are the corners of the coons
-% patch, The FOREGROUND POINT of our visualization here should be CC, 
+% patch, The FOREGROUND POINT of our visualization here should be CC,
 % the second most foreground point BB (assuming that
 % foreground point and second most foreground point are
 % adjacent).
@@ -1796,7 +1796,7 @@
 %
 % Note that this method works also for biquadratic patches since these
 % patches also have #1A, #1B, #1C and #1D as their corners.
-% 
+%
 \def\pgfplotspatchclass at rect@to at coonspatch@findshadingsequence at for@depth#1#2#3{%
 	\def#2{A}%
 	\def#3{}%
@@ -1862,7 +1862,7 @@
 		\def\pgfplotsplothandlermesh at VISUALIZE{\pgfplotsplothandlermesh at VISUALIZE@globalpath at fill@andor at stroke}%
 		\let\pgfplotsplothandlermesh at pathmoveto=\pgfplotsplothandlermesh at pathmoveto@globalpath
 		\let\pgfplotsplothandlermesh at setlastpoint=\pgfplotsplothandlermesh at setlastpoint@globalpath
-		% 
+		%
 		% This activates tikz colors:
 		%\tikz at options
 		\pgfplots at drawoptions
@@ -2094,7 +2094,7 @@
 		% mesh input=lattice|image
 		% Init memory:
 		%
-		% And now finally: initialise the conversion from 
+		% And now finally: initialise the conversion from
 		%  LINEARIZED COORD STREAM -> DATA MATRIX:
 		\if\pgfplots at plot@mesh at ordering0%
 			% x varies (=rowwise):
@@ -2285,12 +2285,12 @@
 }
 
 % Invokes \pgfplotsscanlinecomplete if the scanline is complete according to the keys 'mesh/rows' and/or 'mesh/cols'
-% 
+%
 % This routine improves the precision of the scanline computation, but not much.
 % At the time of this writing, its only purpose is to help 'matrix input=image'
 % as that requires information about the current scanline in order to update its
 % axis limits.
-% 
+%
 % Note that this macro is unnecessary in many cases: if the user input _contains_ end-of-scanline markers, it is redundant.
 %
 % Limitations of this routine:
@@ -2339,7 +2339,7 @@
 	%
 	\ifpgfplotsplothandlermesh at needs@scanlinecomplete at notifications
 		%
-		% OK, we EXPECT that the code generated 
+		% OK, we EXPECT that the code generated
 		% notifications of sorts \pgfplotsscanlinecomplete.
 		%
 		% If this turns out to be NOT the case, we generate a
@@ -2351,7 +2351,7 @@
 		% input has been surveyed)
 		% 2. OR \pgfplotsscanlinecomplete has been called due to scan
 		% line length comparison with mesh/cols or mesh/rows. In this
-		% case, the required argument must have been set, see 
+		% case, the required argument must have been set, see
 		%  \pgfplotsplothandlersurveypoint at mesh@check at scanline@length at init
 		%
 		\ifnum\c at pgfplotsplothandlermesh@image at numscanlines<2
@@ -2386,7 +2386,7 @@
 	\fi
 }%
 
-\def\pgfplotsplothandlersurveyaftersetpointmeta at mesh@cdatanormalize{%	
+\def\pgfplotsplothandlersurveyaftersetpointmeta at mesh@cdatanormalize{%
 	\pgfplotsplothandlersurveyaftersetpointmeta at default
 	\if0\pgfplotsplothandlermesh at colorinput
 		% mesh/color input=colormap
@@ -2691,7 +2691,7 @@
 		% mesh/color input=colormap
 		\if d\pgfplots at colormap@access
 			% colormap access=direct
-			% we assume that the color *is* already normalized, 
+			% we assume that the color *is* already normalized,
 			% i.e. it is {<comma-separate-components>} and to be
 			% interpreted in the correct color space.
 			\edef\pgfplots at loc@TMPb{%
@@ -2707,7 +2707,7 @@
 	\else
 		% mesh/color input=explicit
 		%
-		% we assume that the color *is* already normalized, 
+		% we assume that the color *is* already normalized,
 		% i.e. it is {<comma-separate-components>} and to be
 		% interpreted in the correct color space.
 		\edef\pgfplots at loc@TMPb{%
@@ -2787,8 +2787,8 @@
 		% nor in two dimensions.
 		\pgfkeyssetvalue{/pgfplots/surf shading/anchor}{\pgfpointorigin}%
 		%
- 		% do NOT update the picture's BB using the streamed low-level coordinates 
-		% (which are bezier control points in most cases). 
+ 		% do NOT update the picture's BB using the streamed low-level coordinates
+		% (which are bezier control points in most cases).
 		% We do that on our own using the input vertices.
 		\pgfkeys{/pgfplots/surf shading/update BB=false}%
 		\if1\b at pgfplotsplothandlermesh@matrixoutput
@@ -2841,7 +2841,7 @@
 					% ordering=x varies:
 					% nothing special to do
 				\else
-					% FIXME 
+					% FIXME
 					% [this happens only for mesh input=lattice]
 					% colwise:
 					%
@@ -2956,7 +2956,7 @@
 		% segment.
 		\let\pgfplotsplothandlermesh at usepath=\pgfplotsplothandlermeshusepathstroke
 	\else
-		% 'surf' plot: 
+		% 'surf' plot:
 		\let\pgfplotsplothandlermesh at usepath=\pgfplotsplothandlermeshusepathfillstroke
 		\if\pgfplotsplothandlermesh at shader3% faceted interp
 			% it has an extra fill command (shading)
@@ -3120,7 +3120,7 @@
 		\fi
 		%
 		\if 1\pgfplots at loc@TMPa
-			% ok, this uses (only) 'shader=flat' 
+			% ok, this uses (only) 'shader=flat'
 			\if c\pgfplotsplothandlermesh at flatmode
 				% 'flat corner':
 				\if1\b at pgfplots@correct at shader@flat
@@ -3174,7 +3174,7 @@
 			\let\pgfplotsplothandlermesh at compute@vertex at depth=\pgfplotsplothandlermesh at compute@vertex at depth@doit%
 			%
 			% the "element depth" is defined to be the MEAN of all
-			% vertex depths. 
+			% 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
@@ -3269,7 +3269,7 @@
 		/pgfplots/mesh input=lattice,
 		/pgfplots/patch type=rectangle,
 		/pgfplots/z buffer=default,
-		/tikz/x={(0.44237cm,-0.07439cm)}, 
+		/tikz/x={(0.44237cm,-0.07439cm)},
 		/tikz/y={(0.30942cm,0.23932cm)},
 		/tikz/z={(0.0cm,1.5cm)},
 		scale=0.4,
@@ -3406,7 +3406,7 @@
 % 		get (i-1, j) from front of deque // remember: i: rows, j : cols. We iterate rowwise.
 % 		push (i,j) to back of deque
 % 		if j > 0
-% 			draw 
+% 			draw
 % 				(i-1,j-1) [from last iteration]  -- (i-1,j  ) [from deque]
 % 			--  (  i,j  ) [from last iteration]  -- (i  ,j-1) [from #1]
 % 			-- cycle
@@ -3421,7 +3421,7 @@
 % #2: a callback (TeX code) which will be executed for each point with j>0
 % #3: a callback (TeX code) which will be executed if the scanline is completed, i.e. j=cols
 \def\pgfplotsplothandlermesh at PIPE@DECODE at matrix@collect at and@callback#1#2#3{%
-	% NOTATION: 
+	% NOTATION:
 	% 	'im == (i-1)'
 	% 	'jm == (j-1)'
 	\pgfplotsplothandlermesh at compute@vertex at depth% <-- this modifies \pgfplotsretval

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsplothandlers.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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 2010 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -68,7 +68,7 @@
 % \pgfplotstreamstart
 % foreach <serizalized point> {
 % 	\pgfplotsplothandlerdeserializepointfrom{<serialized point>}
-% 	apply data transformations 
+% 	apply data transformations
 % 	handle plot marks
 % 	\pgfplotstreampoint{\pgfplotsqpointxy{<x>}{<y}}
 % }
@@ -148,7 +148,7 @@
 % coordinates. But it may be more complex.
 %
 % So, the coordinate input routine provides whatever the user has
-% chosen. Let's assume, we are using \addplot table. Then, we can 
+% chosen. Let's assume, we are using \addplot table. Then, we can
 % access every cell in the current row (using \thisrow{<colname>} for
 % example). The plot handler knows how to extract its information from
 % this state. In general, the following steps are taken:
@@ -159,7 +159,7 @@
 %   \pgfplotsaxisparsecoordinate{}
 %   This will apply coordinate filters, parse the single coordinates
 %   and apply high level transformations and any logarithms.
-%   It is some sort of advanced coordinate parser which works only for 
+%   It is some sort of advanced coordinate parser which works only for
 %   (x,y) or for (x,y,z).
 %   It yields (x,y,z). But the axis might need to change its
 %   components! Thus, you also need to call
@@ -191,12 +191,12 @@
 %   point as "readily surveyed". It is allowed if this does *not*
 %   happen inside of \pgfplotsplothandlersurveypoint, but it must
 %   happen before \pgfplotsplothandlersurveyend is finished.
-%   
+%
 %   The plot handler invokes \pgfplotsaxisdatapointsurveyed.
 %   This tells the axis that it can perform its own surveying tasks
 %   (see below) and furthermore, that it can serialize the data point.
 %   Consequently, it will invoke
-%   \pgfplotsplothandlerserializepointto{<\macro>} 
+%   \pgfplotsplothandlerserializepointto{<\macro>}
 %   and it will remember that \macro internally. This serialization is
 %   employed to place plot marks and to apply z buffering techniques
 %   (that's why it is done by the axis and not by the plot handler on
@@ -340,7 +340,7 @@
 %
 % For example:
 % \pgfplotsplothandlers at get@tikz at backup@name{\pgfplothandlerlineto}
-% will return \pgfplotsretval={\\pgfplothandlerlineto at tikz} 
+% will return \pgfplotsretval={\\pgfplothandlerlineto at tikz}
 % (up to \escapechar)
 \def\pgfplotsplothandlers at get@tikz at backup@name#1{%
 	\begingroup
@@ -363,7 +363,7 @@
 		% ... get the name of the backup (see \pgfplotsplothandlers at init)
 		\expandafter\pgfplotsplothandlers at get@tikz at backup@name\pgfplots at loc@TMPa
 		\expandafter\ifx\pgfplotsretval\tikz at plot@handler
-			% AH! \tikz at plot@handler is the same as some backup name! 
+			% AH! \tikz at plot@handler is the same as some backup name!
 			% Replace it:
 			\expandafter\let\expandafter\tikz at plot@handler\pgfplots at loc@TMPa
 		\fi
@@ -468,7 +468,7 @@
 			\let\pgfplots at loc@TMPa=\pgfmathresult
 			\csname pgfplotstransformdirection\pgfplots at bar@direction at choice@\endcsname{\pgfplots at loc@TMPa}%
 			\let\pgfplots at loc@TMPa=\pgfmathresult
-			\if\pgfplots at bar@direction at choice@ x%	
+			\if\pgfplots at bar@direction at choice@ x%
 				\pgfqpointxy at orig{\pgfplots at loc@TMPa}{0}%
 				\edef\pgfmathresult{\pgf at sys@tonumber\pgf at x}%
 			\else
@@ -523,7 +523,7 @@
 }%
 
 % This should expand to a LUA function which takes the axis and the point
-% meta handler. 
+% meta handler.
 % Use empty if there is none.
 \def\pgfplotsplothandlerLUAfactory at default{}%
 
@@ -565,7 +565,7 @@
 % The data point as such is available using the current state of any
 % macros which are assigned during the survey phase (during \addplot).
 % This includes any table macros etc.
-% PGFPlots stores the x,y and z coordinates into \pgfplots at current@point@[xyz]. 
+% PGFPlots stores the x,y and z coordinates into \pgfplots at current@point@[xyz].
 % The point meta coordinate is in \pgfplots at current@point at meta.
 %
 % Note that since any currently assigned macro can be used here, the
@@ -615,7 +615,7 @@
 	% Store normalized point for list:
 	% We need
 	% xi,yi,zi;
-	% where zi may be empty. 
+	% where zi may be empty.
 	%
 	% Note that per-point meta information is stored in
 	% \pgfplotsaxisserializedatapoint .
@@ -726,7 +726,7 @@
 % \pgfplotsplothandlersurveydifflen#1#2
 %
 % computes the length between two points which are given in logical
-% coordinates. 
+% coordinates.
 % #1 a serialized point
 % #2 a serialized point
 %
@@ -791,7 +791,7 @@
     \advance\pgf at y by-\pgf at ya%
     \ifpgfallowupsidedownattime%
     \else%
-      \ifdim\pgf at x<0pt%   
+      \ifdim\pgf at x<0pt%
         \pgf at x=-\pgf at x%
         \pgf at y=-\pgf at y%
       \fi%
@@ -830,7 +830,7 @@
 }%
 % ==================================
 
-% Defines 
+% Defines
 % - a generic update limits routine,
 %   \pgfplotsaxisupdatelimitsforcoordinate#1#2#3
 %   if #3 is empty, it will assume a 2d point, otherwise a 3d point
@@ -897,7 +897,7 @@
 %\E\tracingmacros=2\E\tracingcommands=2
 %\E\pgfplots at message{Updating limits for (##1,##2) ...}%
 		%
-		% VIM SEARCH PATTERN: 
+		% VIM SEARCH PATTERN:
 		%   [^E]\zs\\\ze[^E]
 		% -> this finds '\' which is neither '\E' nor is it prefixed
 		%  by 'E'.
@@ -906,7 +906,7 @@
 		%
 		\E\pgfplots at update@limits at for@one at point@ISCLIPPEDfalse
 		% check whether we need to clip limits:
-		\ifpgfplots at clip@limits
+		\ifpgfplots at clip@limits at x
 			\ifpgfplots at autocompute@xmin
 			\else
 				\ifpgfplots at xislinear
@@ -935,6 +935,8 @@
 					\E\fi
 				\fi
 			\fi
+		\fi
+		\ifpgfplots at clip@limits at y
 			\ifpgfplots at autocompute@ymin
 			\else
 				\ifpgfplots at yislinear
@@ -963,6 +965,8 @@
 					\E\fi
 				\fi
 			\fi
+		\fi
+		\ifpgfplots at clip@limits at z
 			\ifpgfplots at curplot@threedim
 				\ifpgfplots at autocompute@zmin
 				\else
@@ -1103,7 +1107,7 @@
 	% multiple times for a single data "point" (for example, a quiver
 	% point might call it for the point where the vector starts and
 	% where the vector ends).
-	% 
+	%
 	% @PRECONDITION
 	% 	- the plot's survey phase is running (has already been started)
 	% 	- \pgfplots at current@point@[xyz] contains the coordinates of the
@@ -1218,7 +1222,7 @@
 % Its input is (x_i,y_i); (u_i,v_i) for data point i and it draws a
 % vector in direction (u_i,v_i) starting from (x_i,y_i) .
 % It also supports 3D arrows (involving z_i and w_i).
- 
+
 \newif\ifpgfplots at quiver@usetikz
 \newif\ifpgfplots at quiver@updatelimits
 
@@ -1227,7 +1231,7 @@
 	%
 	% User Interface:
 	% use /pgfplots/quiver to enable the plot handler.
-	% Then, provide `quiver/u value' or `quiver/u' to 
+	% Then, provide `quiver/u value' or `quiver/u' to
 	% tell where to find the 'x' coordinates of the vectors, and similarly
 	% for 'v' and 'w' instead of 'u'.
 	quiver/.code={%
@@ -1253,9 +1257,9 @@
 					\def\pgfplots at quiver@v{1}%
 					\def\pgfplots at quiver@w{1}%
 				},%
-			] 
+			]
 				plot coordinates {
-					(0cm,0cm) 
+					(0cm,0cm)
 				};%
 		}%
 	},
@@ -1647,8 +1651,8 @@
 	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},
-		/pgfplots/symbolic coords={x}{A,B,C,D,E,F,G,H,I,J},
+		/pgfplots/symbolic coords={hist/data}{#1},
+		/pgfplots/symbolic coords={x}{#1},
 	},%
 }%
 \def\pgfplotsplothandlerhistogram{%
@@ -1779,11 +1783,11 @@
 	\expandafter\pgfplotsplothandlersurveyend at hist@loop\pgfplots at hist@data\pgfplots at EOI
 	\let\pgfplots at hist@data=\relax
 	%
-	
+
 	% Calculate total count
 	\c at pgf@counta=0
 	\pgfplotsarrayforeachungrouped{pgfp at hist}\as\pgfplots at hist@count{%
-		\advance\c at pgf@counta by\pgfplots at hist@count\relax	
+		\advance\c at pgf@counta by\pgfplots at hist@count\relax
 		\def\pgfplots at loc@TMPa{\pgfplotsarrayset{\pgfplotsarrayforeachindex}\of{pgfp at hist}\to}%
 	}%
 	\pgfmathfloatparsenumber{\the\c at pgf@counta}%
@@ -1814,11 +1818,11 @@
 		\else
 			\pgfmathfloatmultiply@{\pgfp at hist@totalcount at inv}{\pgfplotsplothandlerhistogram at invh}%
 			\let\pgfp at hist@totalcount at times@h at inv=\pgfmathresult
-% FIXME : this here is a patch suggestion for 
+% FIXME : this here is a patch suggestion for
 % https://sourceforge.net/tracker/?func=detail&atid=1060656&aid=3609245&group_id=224188
 %
 % FIXME : this line would actually compute relative frequencies...
-% might not be too bad at all, but is no density 
+% might not be too bad at all, but is no density
 %\let\pgfp at hist@totalcount at times@h at inv=\pgfp at hist@totalcount at inv
 			\pgfplotsarrayforeachungrouped{pgfp at hist}\as\pgfplots at hist@count{%
 				\pgfmathfloatparsenumber{\pgfplots at hist@count}%
@@ -1864,7 +1868,7 @@
 	% This here might be inefficient, because
 	% there needs to be a compatible "x coord trafo" as well -- and
 	% that transformation will (most likely) do the very same thing as
-	% the hist/data coord trafo. 
+	% the hist/data coord trafo.
 	%
 	% But I did not find a way to combine the transformations
 	% automatically without resorting to hackery.
@@ -1988,7 +1992,7 @@
 	},%
 	contour/labels/.is if=pgfplotsplothandlercontour at labels,
 	contour/labels=true,
-	% 
+	%
 	% XXX : this here is dead code... it has been superseded by
 	% \pgfplotsplothandlercontourfilled:
 	contour/filled/.is if=pgfplotsplothandlercontour at filled,
@@ -2078,14 +2082,14 @@
 		contour external={%
 			scanline marks=required,
 			script={
-				unset surface; 
+				unset surface;
 				\ifx\thecontourlevels\empty
 				set cntrparam levels \thecontournumber;
 				\else
 				set cntrparam levels discrete \thecontourlevels;
 				\fi
-				set contour; 
-				set table \"\outfile\"; 
+				set contour;
+				set table \"\outfile\";
 				splot \"\infile\";
 			},
 			cmd={gnuplot \"\script\"},%
@@ -2524,7 +2528,7 @@
 	\let\pgfplotsplothandlercontour at lastlastcanvas=\pgfutil at empty
 	\ifpgfplotsplothandlercontour at labels
 		\def\pgfplotsplothandlercontour at haslabel{0}%
-		% 
+		%
 		% this here means that 20% of labeldist are already there.
 		% it moves the first label nearer to its start.
 		\pgf at xa=\pgfplotsplothandlercontour at labeldist\relax
@@ -2664,7 +2668,7 @@
 	%
 	\if0\pgfplotsplothandlercontourexternal at scanlinemode
 		\pgfplotsset{plot to file/scanline marks/false}%
-	\else	
+	\else
 		\pgfplotsset{plot to file/scanline marks/if in input}% the choice 'always' is unaware of existing end-of-scanline marks
 	\fi
 	\pgfplotsplothandlertofile{\pgfplotsplothandlercontourexternal at file.dat}%
@@ -2805,10 +2809,10 @@
 }%
 }
 
-		
 
 
 
+
 % the `plot unprocessed to file' plot handler simply copies the input data
 % UNPROCESSED to an output file.
 %
@@ -2994,11 +2998,11 @@
 	%
 	\pgfkeysgetvalue{/pgfplots/contour/levels}\pgfplots at loc@TMPa
 	\ifx\pgfplots at loc@TMPa\pgfutil at empty
-		% no levels. 
+		% no levels.
 		% Ok, check the other keys in the order of precedence:
 		\pgfkeysgetvalue{/pgfplots/contour/levels from colormap}\pgfplots at loc@TMPa
 		\ifx\pgfplots at loc@TMPa\pgfutil at empty
-			% no 'levels from colormap'. 
+			% no 'levels from colormap'.
 			% Ok, check the other keys in the order of precedence:
 			\pgfkeysgetvalue{/pgfplots/contour/number}\pgfplots at loc@TMPa
 			\ifx\pgfplots at loc@TMPa\pgfutil at empty
@@ -3077,5 +3081,3 @@
 %\message{contour filled: assembled options \meaning\pgfplots at contour@cm at options^^J}%
 	\fi
 }%
-
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/pgfplotsticks.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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/2008 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -37,15 +37,15 @@
 % Arguments:
 % #1.#2  the value log10(T)
 %
-% Implementation:  
+% Implementation:
 % if T = i*10^j,  log10(T) = log10(i) + j.
 % That means if log10(T) in \Z,  we have T = 10^j. If not, we need to
 % check wether i is an integer. Please note that log10(i) < 1.
 %
 % Further note: log(T) < 0 <=>  j<0.
-% In case j<0, we have 
-%   #1.#2 = j + log(i) 
-%         = - ( -j - log(i) ) 
+% In case j<0, we have
+%   #1.#2 = j + log(i)
+%         = - ( -j - log(i) )
 %         = - ( -j - 1  + (1-log(i)) )
 %         = #1 '.' #2 [ up to the '0.'
 % that means #1 = j-1  and #2 = 1-log(i).
@@ -138,10 +138,10 @@
 % PRECONDITION:
 %    Axis limits for #1 are given. I need their values before any data
 %    scale transformation has been applied.
-%    If  
-%    	\pgfplots@#1min at unscaled@as at float 
+%    If
+%    	\pgfplots@#1min at unscaled@as at float
 %    and
-%    	\pgfplots@#1max at unscaled@as at float 
+%    	\pgfplots@#1max at unscaled@as at float
 %    exist; I will use these macros.
 %    Otherwise, I will use \pgfplots@#1min and \pgfplots@#1max;
 %    assuming that no data scale transformation is active.
@@ -223,7 +223,7 @@
 % and we want to use B's exponent (only) for the decision here.
 %
 % INPUT:
-%  - \pgfplots at cur@min at unscaled, 
+%  - \pgfplots at cur@min at unscaled,
 %  - \pgfplots at cur@max at unscaled,
 %  - \pgfmathfloat at a@E
 %  - \pgfmathfloat at b@E
@@ -234,7 +234,7 @@
 	\pgfmathfloatgetflags\pgfplots at cur@min at unscaled\pgfmathfloat at a@S
 	\pgfmathfloatgetflags\pgfplots at cur@max at unscaled\pgfmathfloat at b@S
 	\ifcase\pgfmathfloat at a@S%
-		% min = 0. 
+		% min = 0.
 		\ifcase\pgfmathfloat at b@S
 			% max =0
 			% normalize to 0 * 10^0 !
@@ -455,7 +455,7 @@
 	\expandafter\xdef\csname pgfplots at maxtickdimen@#1\endcsname{\the\pgf at xa}%
 	\endgroup
 }%
-% 
+%
 % #1: the axis (x,y or z)
 % #2: the normal vector
 \def\pgfplots at ticklabel@maxtickdimen at prepare@for at normalvec#1#2{%
@@ -462,7 +462,7 @@
 	\pgf at process{#2}%
 	\edef\pgfplots at loc@vector at to@outside{\pgf at x=\the\pgf at x\space\pgf at y=\the\pgf at y\space}%
 	% Identify the corner point of the ticklabel bounding box which
-	% shall be used: 
+	% shall be used:
 	\ifdim\pgf at x>0sp
 		\ifdim\pgf at y>0sp
 			% NORTH EAST
@@ -711,9 +711,9 @@
 % Fills the macros
 %   \pgfplots at tick@LOWER at b \pgfplots at tick@end at a
 %   \pgfplots at tick@UPPER at b \pgfplots at tick@end at b
-% with coordinates such that 
+% with coordinates such that
 %   (\pgfplots at tick@LOWER at b,\pgfplots at tmpa) -- (\pgfplots at tick@end at a,\pgfplots at tmpa)
-% produces a correct tick line. 
+% produces a correct tick line.
 %
 % The '@b' variant is only used in case of \pgfplots at ytickposnum = 0
 %
@@ -833,7 +833,7 @@
 	\fi
 }
 
-% Check if the current tick position, stored in \pgfplots at tmpa, 
+% Check if the current tick position, stored in \pgfplots at tmpa,
 % does not cross the y-axis.
 %
 % This is just a special case for centered axis lines.
@@ -934,7 +934,7 @@
 % #1: the axis
 % #2: the tick list.
 %
-% PRECONDITION:  
+% PRECONDITION:
 % 	- \pgfplots at determinedefaultvalues has been executed.
 % 		That means particularly that \pgfplots@[xy][min,max] are available in TeX point
 % 		range (after datascaling and logs).
@@ -1010,6 +1010,12 @@
 			}%
 		\fi
 		%
+		% compute the last index because it won't receive minor ticks:
+		\gdef\pgfplots at glob@TMPd{-1}%
+		\foreach \x in {#2} {%
+			\pgfplotsutil at advancestringcounter@global\pgfplots at glob@TMPd
+		}%
+		\let\c at pgfplots@ticknum at last=\pgfplots at glob@TMPd
 		%
 		\gdef\pgfplots at glob@TMPa{0}%
 		\foreach \x in {#2} {%
@@ -1027,29 +1033,34 @@
 			\fi
 			% X-Axis ticks bottom and top
 			\ifpgfplots at needsminorloop
-				% SEE BELOW for the 'minor #1tick' feature -- it has a
-				% separate loop.
-				\foreach \pgfplots at i in {1,...,\pgfplots at minor@tick at num} {%
-					\ifpgfplots at islinear
-						\pgfmathmultiply@{\pgfplots at i}{\pgfplots at minor@tick at dist}%
-					\else
-						% in log:
-						%  log( i*10^k ) = log\pgfplots at i + k\log10 -> draw ticks for i=1..9
-						\pgfplotscoordmath{#1}{log unsigned int}{\pgfplots at i}%
-						\pgfplotscoordmath{#1}{tofixed}{\pgfmathresult}%
-					\fi
-					\pgfplots at prepare@tick at coordlists@for at advance\pgfplots at tmpa by\pgfmathresult
-					\pgfplots at tickshowtrue
-					\pgfplots at prepare@tick at coordlists@for at checkdatalimits#1%
-					\pgfplots at checktickminmax
-					\ifpgfplots at tickshow
-						\pgfplots at prepare@tick at coordlists@for at tofixed\pgfplots at tmpa
-						\c at pgf@counta=\pgfplots at ticknum\relax
-						\advance\c at pgf@counta by\pgfplots at i\relax
-						\edef\x{{\the\c at pgf@counta}{\pgfmathresult}}%
-						\expandafter\pgfplotslistpushbackglobal\x\to\pgfplots at prepared@tick at positions@minor
-					\fi
-				}%
+				\ifnum\pgfplots at ticknum=\c at pgfplots@ticknum at last\relax
+				\else
+					% SEE BELOW for the 'minor #1tick' feature -- it has a
+					% separate loop.
+					\foreach \pgfplots at i in {1,...,\pgfplots at minor@tick at num} {%
+						% XXX : bug 165 [minor ticks] minor tick drawn after the last xtick 
+						% seems to be here. Does that harm?
+						\ifpgfplots at islinear
+							\pgfmathmultiply@{\pgfplots at i}{\pgfplots at minor@tick at dist}%
+						\else
+							% in log:
+							%  log( i*10^k ) = log\pgfplots at i + k\log10 -> draw ticks for i=1..9
+							\pgfplotscoordmath{#1}{log unsigned int}{\pgfplots at i}%
+							\pgfplotscoordmath{#1}{tofixed}{\pgfmathresult}%
+						\fi
+						\pgfplots at prepare@tick at coordlists@for at advance\pgfplots at tmpa by\pgfmathresult
+						\pgfplots at tickshowtrue
+						\pgfplots at prepare@tick at coordlists@for at checkdatalimits#1%
+						\pgfplots at checktickminmax
+						\ifpgfplots at tickshow
+							\pgfplots at prepare@tick at coordlists@for at tofixed\pgfplots at tmpa
+							\c at pgf@counta=\pgfplots at ticknum\relax
+							\advance\c at pgf@counta by\pgfplots at i\relax
+							\edef\x{{\the\c at pgf@counta}{\pgfmathresult}}%
+							\expandafter\pgfplotslistpushbackglobal\x\to\pgfplots at prepared@tick at positions@minor
+						\fi
+					}%
+				\fi
 			\fi
 			\pgfplotsutil at advancestringcounter\pgfplots at ticknum
 			% carry \ticknum outside of this scope:
@@ -1269,8 +1280,8 @@
 	\pgfkeysgetvalue{/pgfplots/axis \pgfplots at loc@TMPa\space line shift}\pgfplots at loc@TMPb
 	\ifx\pgfplots at loc@TMPb\pgfutil at empty
 	\else
-		% in this case, we KNOW that is is 
-		%   (a) parsed and 
+		% in this case, we KNOW that is is
+		%   (a) parsed and
 		%   (b) nonzero and
 		%   (c) a dimension WITHOUT unit
 		% See \pgfplots at init@axis at shift
@@ -1297,7 +1308,7 @@
 % The oriented surface is two dimensional and has been initialised
 % with \pgfplotspointonorientedsurfaceabsetupfor*** somehow.
 %
-% The idea is now the following: 
+% The idea is now the following:
 % - the tick positions change along the FIRST coordinate of this
 %   surface:
 %
@@ -1310,7 +1321,7 @@
 %   | ---- | ---- | ---- |   | SECOND
 %   |      |      |      |   v
 %
-% for example, 
+% for example,
 % \pgfplotspointonorientedsurfaceab at setupfor@xyZ{1}
 % \pgfplots at drawticklines@onorientedsurf
 % will draw ticks at x-positions designated by \pgfplots at xtick. The
@@ -1323,7 +1334,7 @@
 % will draw ticks at y-positions designated by \pgfplots at ytick. The
 % small tick lines will be drawn along the x axis.  For each processed
 % point, the z coordinate will be fixed to '-1'.
-% 
+%
 % Tick positions are taken out of the already precomputed list
 % \pgfplots at prepared@tick at positions@major at ...
 \def\pgfplots at drawticklines@onorientedsurf{%
@@ -1559,13 +1570,13 @@
 %
 % That's all, basically.
 %
-% For 3D axes, all these points are basically ... the same! 
+% For 3D axes, all these points are basically ... the same!
 % Now it can happen that the current oriented surface shall
 % not contain ANY tick label. In that case, we do nothing.
 % Furthermore, the "outside" direction (i.e. the anchoring of the
 % label nodes) is a little bit more difficult.
-% 
 %
+%
 % See \pgfplots at drawticklines@onorientedsurf@ for a description of the
 % oriented surface.
 \def\pgfplots at drawticklabels@onorientedsurf{%
@@ -1608,7 +1619,7 @@
 				%\pgfmathmultiply@{\pgfplots at tick@offset}{\csname pgfplots@\pgfplotspointonorientedsurfaceB @inverseveclength\endcsname}%
 				\let\pgfplots at tick@offset=\pgfmathresult
 			}%
-			%				
+			%
 			\if2\csname pgfplots@#1axislinesnum\endcsname % Centered axis lines?
 				\expandafter\let\expandafter\pgfplots at tick@origin\csname pgfplots at logical@ZERO@\pgfplotspointonorientedsurfaceB\endcsname%
 				% FIXME : that stuff here does not respect
@@ -1646,7 +1657,7 @@
 						\if2\pgfplots at ticklabelside
 						\else
 							% Should never happen.
-							\pgfplots at error{Internal logic error during tick label placement (got placement character '\pgfplots at ticklabelside'). 
+							\pgfplots at error{Internal logic error during tick label placement (got placement character '\pgfplots at ticklabelside').
 									Please report this as a bug or verify your input arguments to #1ticklabel pos.}%
 						\fi
 					\fi
@@ -1699,7 +1710,7 @@
 % 		'a': this is the direction in which tick positions are known.
 % 		'b': the 'orthogonal' axis to 'a' which is also in the surface.
 % 		'n': the surface normal.
-% 	Now, the idea for tick labels is to place them at 
+% 	Now, the idea for tick labels is to place them at
 % 		SCALE_b * b + SCALE_n * n,
 % 	where the SCALE_[bn] numbers are choosen such that the label is
 % 	outside of the axis.
@@ -1717,7 +1728,7 @@
 % PRECONDITION:
 %   - called inside of  \pgfplots at drawticklabels@onorientedsurf@
 % POSTCONDITION:
-% 	- defines 
+% 	- defines
 % 		- \pgfplots at tickposchoicea
 % 			if called, sets keys such that tick labels are RIGHT (TOP) of
 % 			the axis,
@@ -1735,7 +1746,7 @@
 	\or
 		% 1: near ticklabel.
 		% The following code contains automatically
-		% aligned tick labels (especially for 3D axes). 
+		% aligned tick labels (especially for 3D axes).
 		% see the manual for the |near ticklabel| anchors.
 		\pgfkeys{/tikz/anchor=near #1ticklabel}%
 		%
@@ -1812,7 +1823,7 @@
 % Checks whether the argument to xtick or ytick is a UNIFORM tick
 % sequence.
 %
-% A uniform tick sequence is 0,...,10 and 3,4,5 and -5,-4,-2 but 
+% A uniform tick sequence is 0,...,10 and 3,4,5 and -5,-4,-2 but
 % NOT 0,2,4 or 4,10.
 %
 % Furthermore, any NON-integer tick arguments are also assumed to be
@@ -1819,7 +1830,7 @@
 % NOT uniform.
 %
 % INPUT:
-% #1: a tick argument (i.e. something which can be put to 
+% #1: a tick argument (i.e. something which can be put to
 %     \foreach \x in {#1})
 %
 % OUTPUT:
@@ -1914,7 +1925,7 @@
 % This is part of \pgfplots at assign@default at tick@foraxis and relies on
 % its temporary variables.
 %
-% INPUT: 
+% INPUT:
 %   \MIN : the lower axis limit of #1 (a TeX register, in transformed range)
 %   \MAX : same with upper axis limit of #1
 %   \desirednumticks: the number of ticks to use
@@ -2208,10 +2219,10 @@
 		% it won't be printed).
 		\advance\MIN by-\H\relax
 	\else
-		% Now, we want to activate the Tick set 
+		% Now, we want to activate the Tick set
 		%   {lowest, lowest+H, ..., highest}
 		%
-		% Where 
+		% Where
 		% 	lowest =  I * log(10) + rest, |rest| < log(10).
 		% this is conceptionally different from the approach for
 		% linear axes, because H = j*log(10).
@@ -2235,7 +2246,7 @@
 			% near the lower axis limit.
 			%
 			% "Near" means either directly above or directly below ymin.
-			% 
+			%
 			% My application example is as follows:
 			% Let H = 2*log(10).
 			% Furthermore, ymin = 3e-6, ymax= 8e-2. That means we can choose either
@@ -2250,12 +2261,12 @@
 			% shift the current tick by log(10):
 			%  if( ymin - I * log(10) < 0.5*H ->  use I+1, that means add log(10).
 			%
-			% that's equivalent to 
+			% that's equivalent to
 			%  2*(ymin - I * log(10)) - H < 0.
 			\advance\MINH by-\MIN
 			\multiply\MINH by2
 			\advance\MINH by-\H
-			% 
+			%
 			\ifdim\MINH<0pt
 				\advance\MIN \pgfplots at loc@log at to@display at log@scale pt
 			\fi
@@ -2268,9 +2279,9 @@
 	% That's useless, so check for it.
 	%
 	% That's the case if
-	%    MIN < ORIGMIN && MAX < MIN+2 H 
+	%    MIN < ORIGMIN && MAX < MIN+2 H
 	% MIN < ORIGMIN by construction (ok, MIN <= ORIGMIN by
-	% construction, but I don't care about this case). 
+	% construction, but I don't care about this case).
 	% So: check only the second condition.
 %\message{Got MIN=\pgf at sys@tonumber\MIN; H=\pgf at sys@tonumber\H; MAX=\pgf at sys@tonumber\MAX.^^J}%
 	\def\pgfplots at tick@returnval at ready{0}%
@@ -2280,7 +2291,7 @@
 	\ifdim\MAX<\pgfplots at tmpa
 		\if1\b at pgfplots@ticks at computed@tick at distance@is at final
 			% OK, we cannot auto adjust tick labels -- if if there are
-			% too few of them. 
+			% too few of them.
 		\else
 			\pgfplots at assign@default at tick@foraxis at autoadjust@result#1%
 		\fi
@@ -2290,7 +2301,7 @@
 	% FIXME :this minimum might actually be too small...
 	\ifdim\MINH=\MIN
 		\pgfplotsthrow{dimension too small in ticks}{#1}\pgfeov%
-		% 
+		%
 		% make sure that the compilation succeeds:
 		\H=1pt %
 		\advance\MINH by\H
@@ -2316,16 +2327,16 @@
 %    see manual
 %
 % Idea:
-% We want ticks at each 
+% We want ticks at each
 %    { i*H, i in \Z }.
-% Of course, there shouldn't be TOO MUCH ticks. 
+% Of course, there shouldn't be TOO MUCH ticks.
 %
 % Our heuristics is to set
 %    desirednumticks = round(ACTUAL WIDTH / (max space between ticks) )
 % and generate H = (axis range) / (desirednumticks).
 %
-% Since not all step sizes H look well, restrict H to a set of allowed 
-% step sizes such as 
+% Since not all step sizes H look well, restrict H to a set of allowed
+% step sizes such as
 %   { 1, 1/2, 1/5, 1/10 },
 % or, to be more precise:
 %   { 1*10^e, 2*10^e, 5*10^e }
@@ -2346,12 +2357,12 @@
 %   -> for the data scaling case, I will use floating point
 %   arithmetics to compute that last step.
 %   I will acquire \pgfplots@[xy]min at unscaled@as at float here.
-%     
 %
 %
 %
 %
-% For log-plots, 
+%
+% For log-plots,
 % 	H in { j*log(10), j=1,2,3,... }
 % where the usual case should be j = 1.
 %
@@ -2359,7 +2370,7 @@
 % TICK={MIN,MIN+H,...,MAX}
 % where
 %    MIN = I*H
-% is chosen such that 
+% is chosen such that
 %    axis minimum limit = I*H + rest; |rest| < H.
 %
 % Again, log plots follow a slightly different approach: here,
@@ -2453,13 +2464,13 @@
 
 % Takes the distance between adjacent ticks as floating point number
 % and returns a normalized tick distance.
-% 
 %
+%
 % The idea is to get "nice" (human readable) distances instead of
 % strange fractions or real numbers.
 %
 % The result will be assigned to \pgfmathresult (in float).
-% 
+%
 % #1 the axis (x or y or z)
 % #2 the unnormalized tick distance computed so far
 %
@@ -2470,7 +2481,7 @@
 % -->
 %
 %  \pgfmathresult={1200}
-% or something like that. 
+% or something like that.
 \def\pgfplots at assign@default at tick@foraxis at normalizetickdist#1#2{%
 	\begingroup
 	\let\H=\pgf at xb
@@ -2503,11 +2514,11 @@
 	\endgroup
 }%
 
-% Helper method for 
+% Helper method for
 %  \pgfplots at apply@data at scale@trafo at to@options at for
 % #1: the ticks
 % #2: the trafo routine (not necessarily a single macro, but should
-% take one arg) 
+% take one arg)
 % #3: the output macro name
 \long\def\pgfplots at apply@data at scale@trafo at to@user at ticks#1#2\to#3{%
 	\let#3=\pgfutil at empty
@@ -2523,10 +2534,10 @@
 	%
 }%
 
-% Helper method for 
+% Helper method for
 %  \pgfplots at apply@data at scale@trafo at to@options at for
 % #1: the ticks ALREADY IN FLOAT FORMAT
-% #2: the trafo macro name 
+% #2: the trafo macro name
 % #3: the output macro name
 \long\def\pgfplots at apply@data at scale@trafo at to@user at ticks@isfloat#1#2\to#3{%
 	\let#3=\pgfutil at empty
@@ -2562,4 +2573,3 @@
 \def\pgfplotsdeclareborderanchorforticklabelaxis#1#2{%
 	\pgfplotsdeclareborderanchorforaxis{#1}{\pgfplotsticklabelaxisspec{#1}}{#2}%
 }
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def	2017-06-05 23:09:50 UTC (rev 44469)
@@ -4,7 +4,7 @@
 %
 % 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/2008 by Christian Feuersänger.
@@ -13,12 +13,12 @@
 % 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/>.
 %
@@ -37,7 +37,7 @@
 }%
 
 % The lowlevel call for surface shadings. It uses a pattern type 2
-% dictionary as fill color and has thus several things to do. 
+% dictionary as fill color and has thus several things to do.
 %
 % It appears the dvips implementation is simpler than the pdftex
 % implementation - I did not need to adjust the matrix (don't know
@@ -69,7 +69,7 @@
 %	\pgf at sys@bp at correct\pgf at x%
 %	\pgf at sys@bp at correct\pgf at y%
 	\pgfsys at invoke{%
-		<<	
+		<<
 			%/Type /Pattern
 			/PatternType 2
 			/Shading
@@ -87,8 +87,8 @@
 				\ifpgfplotslibrarysurf at usecolormap
 					/Function \pgfkeysvalueof{/pgfplots/surf shading/colormap}
 				\fi
-				/DataSource	
-					currentfile 
+				/DataSource
+					currentfile
 						% direct binary output not possible: DVI
 						% doesn't support it (?)
 						%<< /EODCount \pgfplotslibrarysurf at binarystream@len\space /EODString () >>  /SubFileDecode filter

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def	2017-06-05 23:09:50 UTC (rev 44469)
@@ -25,6 +25,13 @@
 %
 %--------------------------------------------
 
+\ifnum\luatexversion<95
+	\immediate\write-1{luatex driver of pgfplots: detected lua version \the\luatexversion; falling back to old pdftex driver^^J}%
+	\input pgflibrarypgfplots.surfshading.pgfsys-pdftex.def
+	\expandafter\endinput
+\fi
+
+
 % 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

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotscolormap.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotscolormap.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotscolormap.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -5,7 +5,7 @@
 %
 % 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-2013 by Christian Feuersänger.
@@ -14,12 +14,12 @@
 % 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/>.
 %
@@ -52,7 +52,7 @@
 % 	the last length+h for all others).
 % 	- the semicolons can be omitted.
 %
-% Example: 
+% Example:
 % \pgfplotscreatecolormap{my map}{rgb(0cm)=(1,0,0); rgb(1cm)=(0,1,0); rgb255(1.5cm)=(128,5,255); rgb(2cm)=(0,0,1); gray(3cm)=(3);  color(4cm)=(green); }
 % \pgfplotscreatecolormap{my map}{color=(green); color=(red); color=(blue); color=(yellow)}
 \def\pgfplotscreatecolormap#{\pgfplots at createcolormap}%
@@ -201,9 +201,9 @@
 					% compute the 'h'.
 					%
 					% Note that 's:=#2' is a fraction 0<x<1 of the RESULTING
-					% range, i.e. s * 1000 = H where 0<=H<=1000. 
+					% range, i.e. s * 1000 = H where 0<=H<=1000.
 					% but H = 1000/(1000+h) * 1000, and we need the 'h'.
-					% 
+					%
 					% -> h = 1000/s - 1000.
 					%  regarding the '1-#2': I did some mistake in my
 					%  computation and that fixed it :-/
@@ -218,6 +218,12 @@
 			\fi
 		}%
 	\fi
+	%
+	\ifpgfplots at LUA@supported
+		\pgfplotsutil at directlua{%
+			pgfplots.texColorMapSetScaleOrderZ("#1", "\csname pgfpl at cm@#1 at X@scale at order@z\endcsname")
+		}%
+	\fi
 }%
 
 % see \pgfplotscolormapsetadditionalintervalwidth
@@ -258,7 +264,7 @@
 		\pgfutil at ifnextchar;{\pgfplots at createcolormap@grabsemicolon}%
 		{%
 			\pgfutil at ifnextchar,{\pgfplots at createcolormap@grabcomma}%
-			{
+			{%
 				\expandafter\pgfutil at ifnextchar\pgfplots at activesemicolon{\pgfplots at createcolormap@grabsemicolon at active}%
 				{%
 					\pgfplots at createcolormap@grabnext
@@ -276,7 +282,7 @@
 		\pgfutil at ifnextchar;{\pgfplots at createcolormap@grabsemicolon at hasnext{#1}{#2}}%
 		{%
 			\pgfutil at ifnextchar,{\pgfplots at createcolormap@grabcomma at hasnext{#1}{#2}}%
-			{
+			{%
 				\expandafter\pgfutil at ifnextchar\pgfplots at activesemicolon{\pgfplots at createcolormap@grabsemicolon at active@hasnext{#1}{#2}}%
 				{%
 					#1% has more.
@@ -355,7 +361,7 @@
 
 % Splits '<argument> of <source name>*' into (\pgfplotsretval,
 % \pgfplotsretvalb).
-% 
+%
 % The 'of' part is optional. If it is missing, '\pgfplotsretval'
 % contains the entire argument and '\pgfplotsretvalb' is the current
 % colormap.
@@ -448,7 +454,7 @@
 	},
 	%
 	@define/.code={%
-		\pgfplots at error{Please write 'single color' or 'color list' such that pgfplots knows how to interprete values}
+		\pgfplots at error{Please write 'single color' or 'color list' such that pgfplots knows how to interprete values}%
 		\let\pgfplotsretval=\pgfutil at empty
 	},
 	single color/.style={%
@@ -542,7 +548,7 @@
 	%
 	/pgfplots/of colormap/.unknown/.code={%
 		\pgfplotsutilifstringequal{#1}{\pgfkeysnovalue}{%
-			% This here allows to write 'of colormap={initial}' 
+			% This here allows to write 'of colormap={initial}'
 			\pgfplotscolormapifdefined{\pgfkeyscurrentname}{%
 				\edef\pgfplots at loc@TMPa{%
 					\noexpand\pgfkeysalso{%
@@ -894,8 +900,8 @@
 	\let\pgfplotsretval=\pgfplots at glob@TMPa
 }
 
-% Defines 
-% * 'source range', 
+% Defines
+% * 'source range',
 % * 'source pos',
 % in a way such that it implements 'samples of colormap'
 % #1: 'S' if it _must_ satisfy the number of samples and 'P' if it
@@ -909,7 +915,7 @@
 	\if c\pgfplots at ofcolorbar@sample at for@choice%
 		% or colormap/sample for=const:
 		% sample one less and replicate the last color. This
-		% is to compensate for 'colormap access/extra interval width=0' 
+		% is to compensate for 'colormap access/extra interval width=0'
 		% (which is the default for colormaps with positions)
 		\ifnum\pgfplots at pos@size>1
 			% ah - we have at least 2 positions and 'extra interval width=0' applies!
@@ -1057,7 +1063,7 @@
 	\expandafter\pgfplots at createcolormap@\pgfplotsretval
 }%
 
-% INPUT: 
+% INPUT:
 %		\pgfplotscolormap at at
 %		\pgfplotscolormap at argument
 %		\pgfplotscolormap at key
@@ -1179,7 +1185,7 @@
 		\fi
 	\fi
 	%\message{found current H at cur  = \pgfplots at createcolormap@H at cur\space (\pgfplots at createcolormap@LAST) -> H=\pgfplots at createcolormap@H^^J}%
-	% 
+	%
 	% remember positions:
 	\expandafter\pgfplotsapplistXpushback\expandafter{\pgfplots at createcolormap@MAX,}\to\pgfplots at createcolormap@X
 	%
@@ -1256,12 +1262,12 @@
 				%
 				\pgfplotscolornormalizesequencezero
 				\pgfplotscolornormalizesequenceaddweighted
-					{\pgfplotsretval}
-					{\pgfplots at createcolormap@scale at current}
+					{\pgfplotsretval}%
+					{\pgfplots at createcolormap@scale at current}%
 					{#1}%
 				\pgfplotscolornormalizesequenceaddweighted
-					{\pgfplotsretval}
-					{\pgfplots at createcolormap@scale at last}
+					{\pgfplotsretval}%
+					{\pgfplots at createcolormap@scale at last}%
 					{\pgfplots at createcolormap@last}%
 				%
 %\message{interpolation step \c at pgfplots@createcolormap = \pgfplotsretval^^J}%
@@ -1321,7 +1327,8 @@
 					\csname pgfpl at cm@#1 at h\endcsname,^^J%
 					colorspace,^^J%
 					{ \pgfplots at values },^^J
-					{ \pgfplots at pos }^^J
+					{ \pgfplots at pos },^^J
+					"\csname pgfpl at cm@#1 at X@scale at order@z\endcsname"^^J
 				);^^J%
 			else^^J%
 				io.write("There is no LUA colorspace for '\csname pgfpl at cm@#1 at colspace\endcsname' - skipping LUA color map definition of #1\string\n");^^J%
@@ -1382,7 +1389,7 @@
 %		output format=csv,
 %	]{viridis}
 %	{viridis.dat}
-\def\pgfplotscolormaptodatafile at elem#1#2#3#4{
+\def\pgfplotscolormaptodatafile at elem#1#2#3#4{%
 	\let\pgfplotsretval=\pgfutil at empty
 }%
 
@@ -1689,9 +1696,9 @@
 \def\pgfplotscolormap at piecewiseconst@prepare at scale#1{%
 	% advance the number of intervals by 1.
 	\pgfplotscolormapifisuniform{#1}{%
-		% To this end, we have to compute 
+		% To this end, we have to compute
 		% N = n+1
-		% and 
+		% and
 		% H = 1000 / (N-1) = 1000/n.
 		% Store H in \pgf at x:
 		\expandafter\ifx\csname pgfpl at cm@#1 at X@scale at order@z\endcsname\pgfutil at empty%
@@ -1711,7 +1718,7 @@
 		% artificial interval at the rightmost end.
 		% The idea is to think of a temporary map in the range
 		% [0,1000+ h] where h is the current colormap's
-		% mesh width. 
+		% mesh width.
 		% Since the domain is [0,1000], we map [0,1000+h]
 		% linearly into [0,1000].
 		%
@@ -1784,10 +1791,10 @@
 	\pgfplotscolormapassertexists{#1}%
 	\pgfplotsapplistXnewempty\pgfplots at resultaccum
 	\pgfplotsapplistXpushback{
-		<< 
-			/FunctionType 3 
-			/Domain [0 \pgfplotscolormappdfmax] 
-			/Functions [ 
+		<<
+			/FunctionType 3
+			/Domain [0 \pgfplotscolormappdfmax]
+			/Functions [
 	}\to\pgfplots at resultaccum%
 	\c at pgf@counta=0
 	\c at pgf@countb=\pgfplotsarraysizeof{pgfpl at cm@#1} %
@@ -1810,7 +1817,7 @@
 		\if c\pgfplots at colormap@access
 			% colormap access=piecewise constant
 			% This has a dedicated special interval at the rightmost
-			% end. 
+			% end.
 			% See comments in pgfplotscolormapfindpiecewiseconst at precomputed@
 			\def\pgfplots at order{0}%
 			%
@@ -1817,7 +1824,7 @@
 			\pgfplotscolormap at piecewiseconst@prepare at scale{#1}%
 			%
 			% interchange the sequence in the PDF function as it is
-			% defined as 
+			% defined as
 			% y = C0 + x^0 * (C1 - C0) = C1
 			% -> we want the left interval boundary.
 			\def\pgfplots at C@left{C1}%
@@ -1844,8 +1851,8 @@
 			\edef\pgfplots at loc@TMPd{%
 				<<
 					/FunctionType 2
-					/Domain [0 \pgfplotscolormappdfmax] 
-					/\pgfplots at C@left\space [\pgfplots at loc@TMPa] /\pgfplots at C@right\space [\cdata] 
+					/Domain [0 \pgfplotscolormappdfmax]
+					/\pgfplots at C@left\space [\pgfplots at loc@TMPa] /\pgfplots at C@right\space [\cdata]
 					/N \pgfplots at order
 				>>
 			}%
@@ -1883,8 +1890,8 @@
 		\edef\pgfplots at loc@TMPd{%
 			<<
 				/FunctionType 2
-				/Domain [0 \pgfplotscolormappdfmax] 
-				/\pgfplots at C@left\space [\cdata] /\pgfplots at C@right\space [\cdata] 
+				/Domain [0 \pgfplotscolormappdfmax]
+				/\pgfplots at C@left\space [\cdata] /\pgfplots at C@right\space [\cdata]
 				/N \pgfplots at order
 			>>
 		}%
@@ -1947,7 +1954,7 @@
 % Example:
 % \pgfplotscolormaptoshadingspec{my colormap}{4cm}{\output}
 % \def\tempb{\pgfdeclarehorizontalshading{myshadingA}{1cm}}
-% \expandafter\tempb\expandafter{\temp}	
+% \expandafter\tempb\expandafter{\temp}
 %
 % \pgfuseshading{myshadingA}
 \def\pgfplotscolormaptoshadingspec#1#2#3{%
@@ -2034,10 +2041,10 @@
 % interpolated colors into \pgfmathresult. The result will be a triple
 % for an RGB colormap and it will contain four numbers for CMYK. The
 % components of the result will be in the range [0:1].
-% 
+%
 % [#1:#2]  the number range of the data source (i.e. of #4). This is required to
 %          map into the colormap.
-% [#3]     (optional) the quantity 
+% [#3]     (optional) the quantity
 % 			 s := \pgfplotscolormaprange / (#2-#1).
 % 		   Precomputing this quantity may save a lot of time because
 % 		   divisions are expensive in TeX. You can omit [#3] or
@@ -2144,10 +2151,10 @@
 		% interpolation on the identified interval.
 		\c at pgf@counta=\pgfplotscolormapfind at intervalno\relax
 		% color^m(x) = ( (x-x_i)/(x_{i+1} - x_i) ) * (c_{i+1}^m - c_i^m ) + c_i^m
-		%            = ( x/h - i ) * ( c_{i+1}^m - c_{i}^m ) + c_i^m 
+		%            = ( x/h - i ) * ( c_{i+1}^m - c_{i}^m ) + c_i^m
 		%            = s * c_{i+1}^m  + S * c_i^m
 		%
-		%  s= x_h / h -i 
+		%  s= x_h / h -i
 		\pgfmathsubtract@{\pgfplotscolormapfind at transformedx@divh}{\pgfplotscolormapfind at intervalno}%
 		\let\pgfplots at loc@factor=\pgfmathresult
 	}{%
@@ -2210,12 +2217,12 @@
 		%
 		\pgfplotscolorzero{\csname pgfpl at cm@#5 at col@comps\endcsname}%
 		\pgfplotscoloraddweighted
-			{\csname pgfpl at cm@#5 at col@comps\endcsname}
+			{\csname pgfpl at cm@#5 at col@comps\endcsname}%
 			{\pgfplotsretval}%
 			{\pgfplots at loc@factor at two}%
 			{\pgfplotscolormapfind at rgb@LEFT}%
 		\pgfplotscoloraddweighted
-			{\csname pgfpl at cm@#5 at col@comps\endcsname}
+			{\csname pgfpl at cm@#5 at col@comps\endcsname}%
 			{\pgfplotsretval}%
 			{\pgfplots at loc@factor}%
 			{\pgfplotscolormapfind at rgb@RIGHT}%
@@ -2234,10 +2241,10 @@
 % interpolation. It returns the interpolated colors into \pgfmathresult. The result will be a triple
 % for an RGB colormap and it will contain four numbers for CMYK. The
 % components of the result will be in the range [0:1].
-% 
+%
 % [#1:#2]  the number range of the data source (i.e. of #4). This is required to
 %          map into the colormap.
-% [#3]     (optional) the quantity 
+% [#3]     (optional) the quantity
 % 			 s := \pgfplotscolormaprange / (#2-#1).
 % 		   Precomputing this quantity may save a lot of time because
 % 		   divisions are expensive in TeX. You can omit [#3] or
@@ -2256,20 +2263,23 @@
 	}%
 }%
 \def\pgfplotscolormapfindpiecewiseconst at precomputed[#1:#2][#3]#4#5{%
-	%\ifpgfplots at LUA@supported
-	\iffalse
-		% FIXME : implement
-		\edef\pgfmathresult{%
-			\pgfplotsutil at directlua{%
-				pgfplots.texColorMapPrecomputed("#5", #1,#2,#4)
+	\ifpgfplots at LUA@supported
+		\pgfplotscolormapifisuniform{#5}{%
+			\edef\pgfmathresult{%
+				\pgfplotsutil at directlua{%
+					pgfplots.texColorMapFindPiecewiseConst("#5", #1,#2,#4)
+				}%
 			}%
+			\ifx\pgfmathresult\pgfutil at empty
+				\pgfplotscolormapfindpiecewiseconst at precomputed@warn at LUA{#5}%
+				\pgfplotscolormapfindpiecewiseconst at precomputed@[#1:#2][#3]{#4}{#5}%
+			\else
+				%\message{LUA colormapfindpiecewiseconst[#1:#2](#4)(#5) = \pgfmathresult^^J}%
+			\fi
+		}{%
+			% FIXME : implement LUA for non-uniform colormaps
+			\pgfplotscolormapfindpiecewiseconst at precomputed@[#1:#2][#3]{#4}{#5}%
 		}%
-		\ifx\pgfmathresult\pgfutil at empty
-			\pgfplotscolormapfindpiecewiseconst at precomputed@warn at LUA{#5}%
-			\pgfplotscolormapfindpiecewiseconst at precomputed@[#1:#2][#3]{#4}{#5}%
-		\else
-			%\message{LUA colormapfindpiecewiseconst[#1:#2](#4)(#5) = \pgfmathresult^^J}%
-		\fi
 	\else
 		\pgfplotscolormapfindpiecewiseconst at precomputed@[#1:#2][#3]{#4}{#5}%
 	\fi
@@ -2296,9 +2306,9 @@
 	%
 	% I decided to enlarge the colormap artificially such that the
 	% rightmost color receives its own interval.
-	% 
+	%
 	% To this end, I recompute the coordinates at which colors "live".
-	% The operations sounds more involved than it is: I simply need a NEW mesh width locally 
+	% The operations sounds more involved than it is: I simply need a NEW mesh width locally
 	% inside of this function. The new mesh width H can be computed as
 	% follows, assuming that the OLD colormap has mesh width h.
 	%
@@ -2334,8 +2344,8 @@
 		%
 		% My idea is that I add an extra interval of length 'h' at the right end of
 		% the domain, i.e. I enlarge the domain to [0,1000+h].
-		% 
-		% To this end, I map the input number linearly from 
+		%
+		% To this end, I map the input number linearly from
 		%  [0,1000] -> [0,1000+h]
 		% using k(t) = (1000+h)/1000 * t
 		%
@@ -2384,7 +2394,7 @@
 	%
 	\ifnum\c at pgf@counta=\pgfplotscolormapsizeof{#5}\relax
 		% we have artificially increased the "h" (see the comments
-		% above) -- meaning that this 'if' can happen. 
+		% above) -- meaning that this 'if' can happen.
 		% ->Map the rightmost point to the rightmost interval:
 		\advance\c at pgf@counta by-1
 	\fi
@@ -2394,7 +2404,7 @@
 	\let\pgfmathresult=\pgfplotscolormapfind at rgb@LEFT
 	\pgfmath at smuggleone\pgfmathresult
 	\endgroup
-}%
+}
 
 \def\pgfplotscolormap at floor#1.#2\relax{%
 	\ifdim0.#2pt>0.999pt
@@ -2480,12 +2490,11 @@
 % #1: is the value which should be mapped into the color map; it
 % is expected in the range [0,1000] (like point meta).
 \def\pgfplotscolormapdefinemappedcolor#1{%
-	\expandafter\pgfplotscolormapaccess\expandafter[\pgfplotspointmetatransformedrange]
-		[1.0]
-		{#1}
-		{\pgfkeysvalueof{/pgfplots/colormap name}}
+	\expandafter\pgfplotscolormapaccess\expandafter[\pgfplotspointmetatransformedrange]%
+		[1.0]%
+		{#1}%
+		{\pgfkeysvalueof{/pgfplots/colormap name}}%
 %\message{Color for current point is RGB '\pgfmathresult' (determined using meta 'phi(\pgfplotspointmeta) = \pgfplotspointmetatransformed')^^J}%
 	\def\pgfplots at loc@TMPb{\pgfutil at definecolor{mapped color}{\csname pgfpl at cm@\pgfkeysvalueof{/pgfplots/colormap name}@colspace\endcsname}}%
 	\expandafter\pgfplots at loc@TMPb\expandafter{\pgfmathresult}%
 }%
-

Modified: trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/generic/pgfplots/util/pgfplotsutil.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -937,6 +937,7 @@
 }
 
 % \pgfplotsforeachlogarithmicungrouped[<samples>] \x/\logx in {a:b} {#3}
+% \pgfplotsforeachlogarithmicungrouped[<samples>][<math id>] \x/\logx in {a:b} {#3}
 %
 % samples \x between a and b using a logarithmic scale.
 %
@@ -947,75 +948,82 @@
 % configured otherwise with \pgfplotsforeachlogarithmicsetoutput,
 % see above.
 %
-% Arithmethics will be carried out with the math class
-% '\pgfplotsforeachlogarithmicmathid'.
+% Arithmethics will be carried out with the math class '<math id>'
+% (defaults to '\pgfplotsforeachlogarithmicmathid').
 % This macro should expand to something which is usable inside of
-% \pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{....}
+% \pgfplotscoordmath{<math id>}{....}
 % the default is 'float'
 % 
 % FIXME : THIS CAN'T BE NESTED YET!
-\def\pgfplotsforeachlogarithmicungrouped[#1]#2/#3{\pgfplotsforeachlogarithmicungrouped@[#1]{#2}{#3}}%
-\long\def\pgfplotsforeachlogarithmicungrouped@[#1]#2#3in #4#5{%
+\def\pgfplotsforeachlogarithmicungrouped[#1]{%
+	\pgfutil at ifnextchar[{%
+		\pgfplotsforeachlogarithmicungrouped@[#1]%
+	}{%
+		\pgfplotsforeachlogarithmicungrouped@[#1][\pgfplotsforeachlogarithmicmathid]%
+	}%
+}%
+\def\pgfplotsforeachlogarithmicungrouped@[#1][#2]#3/#4{\pgfplotsforeachlogarithmicungrouped@@[#1][#2]{#3}{#4}}%
+\long\def\pgfplotsforeachlogarithmicungrouped@@[#1][#2]#3#4in #5#6{%
 	% define
-	% 	\pgfplots at foreach@loc at TMPd = N in fixed point
-	% 	\pgfplots at foreach@loc at TMPc = N-1 in float :
+	% 	\pgfplots at foreachlog@loc at TMPd = N in fixed point
+	% 	\pgfplots at foreachlog@loc at TMPc = N-1 in float :
 	\edef\pgfplots at plot@samples@@{#1}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{one}%
-	\let\pgfplots at foreach@loc at TMPa=\pgfmathresult
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{\pgfplots at plot@samples@@}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{subtract}{{\pgfmathresult}{\pgfplots at foreach@loc at TMPa}}%
-	\let\pgfplots at foreach@loc at TMPc=\pgfmathresult
+	\pgfplotscoordmath{#2}{one}%
+	\let\pgfplots at foreachlog@loc at TMPa=\pgfmathresult
+	\pgfplotscoordmath{#2}{parsenumber}{\pgfplots at plot@samples@@}%
+	\pgfplotscoordmath{#2}{op}{subtract}{{\pgfmathresult}{\pgfplots at foreachlog@loc at TMPa}}%
+	\let\pgfplots at foreachlog@loc at TMPc=\pgfmathresult
 	%
-	\edef\pgfplots at loc@TMPb{#4}%
-	\expandafter\pgfplotsforeachlogarithmicungrouped at readdomain\pgfplots at loc@TMPb\relax
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{if is bounded}{\pgfplots at foreach@loc at TMPb}{%
+	\edef\pgfplots at loc@TMPb{#5}%
+	\expandafter\pgfplotsforeachlogarithmicungrouped at readdomain\pgfplots at loc@TMPb\relax{#2}%
+	\pgfplotscoordmath{#2}{if is bounded}{\pgfplots at foreachlog@loc at TMPb}{%
 	}{%
-		\pgfplotsforeachlogarithmicmath at unbounded@domain{#4}%
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{-10000}%
-		\let\pgfplots at foreach@loc at TMPb=\pgfmathresult
+		\pgfplotsforeachlogarithmicmath at unbounded@domain{#5}%
+		\pgfplotscoordmath{#2}{parsenumber}{-10000}%
+		\let\pgfplots at foreachlog@loc at TMPb=\pgfmathresult
 	}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{if is bounded}{\pgfplots at foreach@loc at TMPa}{%
+	\pgfplotscoordmath{#2}{if is bounded}{\pgfplots at foreachlog@loc at TMPa}{%
 	}{%
-		\pgfplotsforeachlogarithmicmath at unbounded@domain{#4}%
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{-10000}%
-		\let\pgfplots at foreach@loc at TMPa=\pgfmathresult
+		\pgfplotsforeachlogarithmicmath at unbounded@domain{#5}%
+		\pgfplotscoordmath{#2}{parsenumber}{-10000}%
+		\let\pgfplots at foreachlog@loc at TMPa=\pgfmathresult
 	}%
-	% compute mesh width into \pgfplots at foreach@loc at TMPc:
-	%  \pgfplots at foreach@loc at TMPc := h := ( log(xmax) - log(xmin) ) / (N-1)
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{subtract}{{\pgfplots at foreach@loc at TMPb}{\pgfplots at foreach@loc at TMPa}}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{divide}{{\pgfmathresult}{\pgfplots at foreach@loc at TMPc}}%
-	\let\pgfplots at foreach@loc at TMPc=\pgfmathresult
+	% compute mesh width into \pgfplots at foreachlog@loc at TMPc:
+	%  \pgfplots at foreachlog@loc at TMPc := h := ( log(xmax) - log(xmin) ) / (N-1)
+	\pgfplotscoordmath{#2}{op}{subtract}{{\pgfplots at foreachlog@loc at TMPb}{\pgfplots at foreachlog@loc at TMPa}}%
+	\pgfplotscoordmath{#2}{op}{divide}{{\pgfmathresult}{\pgfplots at foreachlog@loc at TMPc}}%
+	\let\pgfplots at foreachlog@loc at TMPc=\pgfmathresult
 	%
 	% apply local scoping here:
-	\edef\pgfplots at foreach@loc at TMPd{%
+	\edef\pgfplots at foreachlog@loc at TMPd{%
 		\noexpand\c at pgf@counta=\the\c at pgf@counta\noexpand\relax
 	}%
-	\long\def\pgfplots at foreach@loc at TMPf{#5}%
+	\long\def\pgfplots at foreachlog@loc at TMPf{#6}%
 	\c at pgf@counta=0
 	\pgfutil at loop
 	\ifnum\c at pgf@counta<\pgfplots at plot@samples@@
 		% compute exp(log(min) + i * h)
 		\edef\pgfplots at loc@TMPa{\the\c at pgf@counta}%
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{parsenumber}{\pgfplots at loc@TMPa}%
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{multiply}{{\pgfmathresult}{\pgfplots at foreach@loc at TMPc}}%
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{op}{add}{{\pgfmathresult}{\pgfplots at foreach@loc at TMPa}}%
+		\pgfplotscoordmath{#2}{parsenumber}{\pgfplots at loc@TMPa}%
+		\pgfplotscoordmath{#2}{op}{multiply}{{\pgfmathresult}{\pgfplots at foreachlog@loc at TMPc}}%
+		\pgfplotscoordmath{#2}{op}{add}{{\pgfmathresult}{\pgfplots at foreachlog@loc at TMPa}}%
 		\let\pgfplots at loc@TMPa=\pgfmathresult
 		\pgfplotsforeachlogarithmicungrouped at finalizeresult%
+		\let#4=\pgfmathresult
+		\pgfplotscoordmath{#2}{exp}{\pgfplots at loc@TMPa}%
+		\pgfplotsforeachlogarithmicungrouped at finalizeresult%
 		\let#3=\pgfmathresult
-		\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{exp}{\pgfplots at loc@TMPa}%
-		\pgfplotsforeachlogarithmicungrouped at finalizeresult%
-		\let#2=\pgfmathresult
 		%
 		% ok, invoke it!
 		% -> store \c at pgf@counta before doing so. We need to scope
 		%  manually here.
-		\edef\pgfplots at foreach@loc at TMPe{\the\c at pgf@counta}%
-		\pgfplots at foreach@loc at TMPf\relax
-		\c at pgf@counta=\pgfplots at foreach@loc at TMPe\relax
+		\edef\pgfplots at foreachlog@loc at TMPe{\the\c at pgf@counta}%
+		\pgfplots at foreachlog@loc at TMPf\relax
+		\c at pgf@counta=\pgfplots at foreachlog@loc at TMPe\relax
 		\advance\c at pgf@counta by 1
 	\pgfutil at repeat
 	% restore scoped variables:
-	\pgfplots at foreach@loc at TMPd
+	\pgfplots at foreachlog@loc at TMPd
 }
 
 \def\pgfplotsforeachlogarithmicmath at unbounded@domain#1{%
@@ -1030,16 +1038,16 @@
 \def\pgfplotsforeachlogarithmicmathid{float}
 
 % defines 
-%  \pgfplots at foreach@loc at TMPa := log(firstintervalpt)
+%  \pgfplots at foreachlog@loc at TMPa := log(firstintervalpt)
 % and
-%  \pgfplots at foreach@loc at TMPb := log(secondintervalpt)
-\def\pgfplotsforeachlogarithmicungrouped at readdomain#1:#2\relax{%
+%  \pgfplots at foreachlog@loc at TMPb := log(secondintervalpt)
+\def\pgfplotsforeachlogarithmicungrouped at readdomain#1:#2\relax#3{%
 	\pgfplotscoordmath{default}{parse}{#1}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{log}{\pgfmathresult}%
-	\let\pgfplots at foreach@loc at TMPa=\pgfmathresult
+	\pgfplotscoordmath{#3}{log}{\pgfmathresult}%
+	\let\pgfplots at foreachlog@loc at TMPa=\pgfmathresult
 	\pgfplotscoordmath{default}{parse}{#2}%
-	\pgfplotscoordmath{\pgfplotsforeachlogarithmicmathid}{log}{\pgfmathresult}%
-	\let\pgfplots at foreach@loc at TMPb=\pgfmathresult
+	\pgfplotscoordmath{#3}{log}{\pgfmathresult}%
+	\let\pgfplots at foreachlog@loc at TMPb=\pgfmathresult
 }
 
 % invokes '#2' if #1 expands (\edef) to the empty string or '#3' if not.

Modified: trunk/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex	2017-06-05 23:09:50 UTC (rev 44469)
@@ -9,12 +9,12 @@
 % 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/>.
 %
@@ -115,7 +115,7 @@
 	annot/xaxis/.initial=,
 	annot/yaxis/.initial=,
 	annot/zaxis/.initial=,
-	% format: 
+	% format:
 	% 	[<plot1coords>, <plot2coords>,...,<plotncoords>]
 	% with <ploticoords> = [<coord>,<coord>,....,<coord>]
 	% and <coord> = [ <x>, <y>, "text" ]
@@ -173,7 +173,7 @@
 %     {\uccode`c=`\%\uppercase{\iwvo{\string\obeyspaces\string\obeylines\string\global\string\let\string^\string^M=\string\jsR c}}}
 %     {\escapechar=-1 \lccode`C=`\%\lowercase{\iwvo{\string\\catcode`\string\\"=12C}}}
 % }
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 % Bugfix to fix incompatibility when '<' and '>' are active (as for
 % \usepackage[spanish]{babel}:
@@ -225,14 +225,14 @@
 % only normal letters are allowed inside of the argument here.
 \begin{insDLJS}[processAnnotatedPlot]{pgfplotsJS}{pgfplots Clickable Plot Code}
 /*********************************************************************************
- * function sprintf() - written by Kevin van Zonneveld as part of the php to javascript 
+ * function sprintf() - written by Kevin van Zonneveld as part of the php to javascript
  * conversion project.
- * 
+ *
  * More info at: http://kevin.vanzonneveld.net/techblog/article/phpjs_licensing/
- * 
+ *
  * This is version: 1.33
  * php.js is copyright 2008 Kevin van Zonneveld.
- * 
+ *
  * Portions copyright Michael White (http://crestidg.com), _argos, Jonas
  * Raoni Soares Silva (http://www.jsfromhell.com), Legaev Andrey, Ates Goral
  * (http://magnetiq.com), Philip Peterson, Martijn Wieringa, Webtoolkit.info
@@ -259,10 +259,10 @@
  * Yannoo, baris ozdil, booeyOH, djmix, dptr1988, duncan, echo is bad, gabriel
  * paderni, ger, gorthaur, jakes, john (http://www.jd-tech.net), kenneth,
  * loonquawl, penutbutterjelly, stensi
- * 
+ *
  * Dual licensed under the MIT (MIT-LICENSE.txt)
  * and GPL (GPL-LICENSE.txt) licenses.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
@@ -270,10 +270,10 @@
  * distribute, sublicense, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -281,12 +281,12 @@
  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
- */ 
-// ATTENTION: this method has been masked such that special characters of TeX and javascript 
+ */
+// ATTENTION: this method has been masked such that special characters of TeX and javascript
 // don't produce problems.
 function sprintf( ) {
     // Return a formatted string
-    // 
+    //
     // +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_sprintf/
     // +       version: 804.1712
     // +   original by: Ash Searle (http://hexmen.com/blog/)
@@ -469,7 +469,7 @@
 	this.realy=realy;
 	this.text=text;
 }
-ClickableCoord.prototype = 
+ClickableCoord.prototype =
 {
 	dim : 0,
 	canvasx : 0,
@@ -515,7 +515,7 @@
 				"<body> " + % xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acrobat:9.3.2\" xfa:spec=\"2.0.2\">" +
 				%"<p>"+
 				"<span>"+ % style="font-size:9.0pt;text-align:left;color:#7E0000;font-weight:normal;font-style:normal;font-family:Helvetica,sans-serif;font-stretch:normal"
-					this.text + 
+					this.text +
 				"</span>"+
 				%"</p>"+
 				"</body>";
@@ -544,7 +544,7 @@
 			canvas.display = display.visible;
 		else
 			canvas.display = display.noPrint;
-		
+
 		var mark = docObject.getField( canvas.name + "mark");
 		if( mark ) {
 			R = mark.rect;
@@ -589,7 +589,7 @@
 		var collectedPlots = this.collectedPlots;
 		if( point.dim > 2 )
 			tmpPt = new ClickableCoord(0,0,0,0,"");
-			
+
 		if( startSearchAt != null && startSearchAt.isSnapToNearestCoord() ) {
 			startPlot = startSearchAt.sourcePlotIdx;
 			startCoord= startSearchAt.sourceCoordIdx;
@@ -639,13 +639,13 @@
 	 * @param this the axis in which we shall search.
 	 * @param x,y the input canvas coordinates
 	 * @param canvas a pointer to the Drawing object (TextField) whose 'rect' field is the drawing canvas.
-	 * @param startSearch either null or an instance of ClickableCoord for which isSnapToNearestCoord() returns true. 
+	 * @param startSearch either null or an instance of ClickableCoord for which isSnapToNearestCoord() returns true.
 	 *   If it is not null, the next matching point *after* it will be returned (or null if there is no matching snap--to--nearest coord after it).
 	 * @return an instance of ClickableCoord or null in case the startSearch!=null and there are no further matches.
 	 */
 	findClickableCoord : function( x,y, canvas, startSearch )
 	{
-		// Get and modify bounding box. The mouse movement is only accurate up to one point 
+		// Get and modify bounding box. The mouse movement is only accurate up to one point
 		// (mouseX and mouseY are integers), so the bounding box should be an integer as well.
 		var rect = canvas.rect; // rect = [ mincanvasx mincanvasy maxcanvasx maxcanvasy ]; relative to upper left corner
 		rect[0] = Math.round(rect[0]);
@@ -662,7 +662,7 @@
 			var minminminy = rect[3] + this.minminmin[1];
 			var vecx = x - minminminx;
 			var vecy = y - minminminy;
-			var A = [ 
+			var A = [
 				[this.xaxis[0], this.yaxis[0]],
 				[this.xaxis[1], this.yaxis[1]] ];
 			var b = [ vecx, vecy ];
@@ -689,7 +689,7 @@
 			console.println( "WARNING: startSearch().isSnapToNearestCoord() has been expected!" );
 			startSearch = null;
 		}
-		
+
 		var nearestClickableCoord = this.findNearest( point, rect, startSearch );
 		if( nearestClickableCoord ) {
 			if( getDist( point.canvasx,point.canvasy,  nearestClickableCoord.canvasx, nearestClickableCoord.canvasy ) < this.snapDist ) {
@@ -744,10 +744,10 @@
 		}
 		// dragging the mouse results in slope computation:
 		// placeClickableCoord shows the endpoint coords and returns the (transformed) coordinates into tmpArray1 and tmpArray2:
-		this.placeClickableCoord( 
+		this.placeClickableCoord(
 			this.findClickableCoord( posOnMouseDownX, posOnMouseDownY, a, null ),
 			result, displayOpts, tmpArray1 );
-		this.placeClickableCoord( 
+		this.placeClickableCoord(
 			this.findClickableCoord( mouseX, mouseY, a, null ),
 			result2, displayOpts, tmpArray2 );
 
@@ -805,7 +805,7 @@
 				lastPoint = null; // no search restriction.
 		}
 		if( bSearchPoint )
-			point = this.findClickableCoord( mouseX, mouseY, a, lastPoint ); 
+			point = this.findClickableCoord( mouseX, mouseY, a, lastPoint );
 
 		lastPoint = point;
 
@@ -816,7 +816,7 @@
 			return;
 		}
 
-		this.placeClickableCoord( 
+		this.placeClickableCoord(
 			point,
 			result, displayOpts, null );
 	},
@@ -874,8 +874,8 @@
 		// replace the text substring "(xy)" with the actual coordinates:
 		var coordOff = point.text.indexOf(clickablePatternForXY);
 		if( coordOff >= 0 ) {
-			point.text = 
-				point.text.substring( 0, coordOff ) + 
+			point.text =
+				point.text.substring( 0, coordOff ) +
 				sprintf( displayOpts.pointFormat, point.realx,point.realy,point.realz) +
 				point.text.substr( coordOff+clickablePatternForXY.length );
 		}
@@ -898,7 +898,7 @@
 PGFPlotsTernaryAxis.prototype = {
 	findClickableCoord : function( x,y, canvas, startSearch )
 	{
-		// Get and modify bounding box. The mouse movement is only accurate up to one point 
+		// Get and modify bounding box. The mouse movement is only accurate up to one point
 		// (mouseX and mouseY are integers), so the bounding box should be an integer as well.
 		var rect = canvas.rect; // rect = [ mincanvasx mincanvasy maxcanvasx maxcanvasy ]; relative to lower left corner
 		rect[0] = Math.round(rect[0]);
@@ -911,7 +911,7 @@
 		var X = ( x - rect[0] ) * ternaryScale;
 		var Y = ( y - rect[3] ) * ternaryScale;
 
-		var realx = 1.15470053837925 * Y; // 2/sqrt(3) 
+		var realx = 1.15470053837925 * Y; // 2/sqrt(3)
 		var realz = X - 0.5 * realx;
 		var realy = 1 - realx - realz;
 
@@ -926,7 +926,7 @@
 			console.println( "WARNING: startSearch().isSnapToNearestCoord() has been expected!" );
 			startSearch = null;
 		}
-		
+
 		var nearestClickableCoord = this.findNearest( point, rect, startSearch );
 		if( nearestClickableCoord ) {
 			if( getDist( point.canvasx,point.canvasy,  nearestClickableCoord.canvasx, nearestClickableCoord.canvasy ) < this.snapDist ) {
@@ -966,7 +966,7 @@
 	return getVecLen(t1,t2);
 }
 
-function axisMouseDown(formName ) 
+function axisMouseDown(formName )
 {
 	posOnMouseDownX = mouseX;
 	posOnMouseDownY = mouseY;
@@ -1016,7 +1016,7 @@
 % 	}
 % }
 % hideClickableTextfields();
-%-------------------------------------------------- 
+%--------------------------------------------------
 
 
 \pgfkeysdef{/pgfplots/annot/xy pattern}{\pgfplots at clickable@xypat at error}%
@@ -1150,7 +1150,7 @@
 		{{
 			axisType:	"\pgfkeysvalueof{/pgfplots/axis type}",
 			dim:	\pgfkeysvalueof{/pgfplots/annot/dim},
-			xmin:	\pgfkeysvalueof{/pgfplots/annot/xmin}, 
+			xmin:	\pgfkeysvalueof{/pgfplots/annot/xmin},
 			xmax:	\pgfkeysvalueof{/pgfplots/annot/xmax},
 			ymin:	\pgfkeysvalueof{/pgfplots/annot/ymin},
 			ymax:	\pgfkeysvalueof{/pgfplots/annot/ymax},
@@ -1204,7 +1204,7 @@
 
 % This thing is invoked from within pgfplots. It prepares and invokes
 % \pgfplotsclickablecreate.
-% 
+%
 \def\pgfplots at create@clickable at plotarea@hook{%
 	\ifpgfplots at clickable
 		\begingroup
@@ -1325,16 +1325,16 @@
 	% \PushButton[name=#3,borderwidth=0,bordersep=0,
 	%        onclick={processAnnotatedPlot("#3", #4, #5);}]{\vbox to #2{\hsize=#1\vfill\hfill}}%
 	% \TextField[name=#3-result,hidden=true]{}%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	%
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	% eforms.sty implementation:
 	% it allows more customization.
-	%-------------------------------------------------- 
+	%--------------------------------------------------
 	%
 	% Hier kommen Annotation Directories zum Zuge!
 	% -> siehe Annotations in pdf reference
-	\def\pushButtonDefaults{	
+	\def\pushButtonDefaults{
 		\W{0}% border width
 		\Border{0 0 0}%
 	}%
@@ -1352,8 +1352,8 @@
 		\AA{
 			% /U = "mouse UP"
 			% /D = "mouse DOWN"
-			/U << /S/JavaScript/JS(axisMouseUp("#3", #4, #5);) >> 
-			/D << /S/JavaScript/JS(axisMouseDown("#3");) >> 
+			/U << /S/JavaScript/JS(axisMouseUp("#3", #4, #5);) >>
+			/D << /S/JavaScript/JS(axisMouseDown("#3");) >>
 		}%
 		]
 		{#3}
@@ -1370,8 +1370,8 @@
 	% 		/Subtype	/Line
 	% 		/Open		/false
 	% 		/NM			(#3-line)
-	% 		/C			
-	% 		/CA			
+	% 		/C
+	% 		/CA
 	% 		/Subj		()
 	% 		/Contents	()
 	% 		/L			[0 0 0 0]
@@ -1378,9 +1378,9 @@
 	% 		/LE			[/None /OpenArrow] % PDF 1.4
 	% 	%	/Ff			194
 	% }}%
-	%-------------------------------------------------- 
-	%	
+	%--------------------------------------------------
 	%
+	%
 	%\setLinkBbox[%
 	%	\Border{}%
 	%	\A{/S/JavaScript/JS(processme("#3");)}%

Modified: trunk/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty	2017-06-05 23:09:24 UTC (rev 44468)
+++ trunk/Master/texmf-dist/tex/latex/pgfplots/pgfplots.sty	2017-06-05 23:09:50 UTC (rev 44469)
@@ -83,11 +83,20 @@
     \expandafter\pgfutil at secondoftwo
   \fi
 }
+
+\gdef\pgfplots at glob@TMPa{}%
 \pgfplotsutil at IfUndefined{directlua}{}{%
-	% I need \newcatcodetable
-	\RequirePackage{luatexbase}%
+	\pgfplotsutil at IfUndefined{newcatcodetable}{%
+		% I need \newcatcodetable
+		\gdef\pgfplots at glob@TMPa{\RequirePackage{luatexbase}}%
+	}
 }%
 
+\ifx\pgfplots at glob@TMPa\pgfutil at empty
+\else
+	\expandafter\pgfplots at glob@TMPa
+\fi
+
 \def\pgfplots at texdist@protect{\protect}%
 
 \input pgfplots.code.tex



More information about the tex-live-commits mailing list