diff options
author | Karl Berry <karl@freefriends.org> | 2016-08-11 21:43:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-08-11 21:43:18 +0000 |
commit | 331998aa63cb82e63c8b2d1e0152a454d7cd027e (patch) | |
tree | 24d0935e3537ed8201d0c8ff67d1121804a57848 /Master/texmf-dist/tex/generic/pgfplots/lua | |
parent | 08ddf2612db3c8882d81fa31045b11c4daba10b1 (diff) |
pgfplots (11aug16)
git-svn-id: svn://tug.org/texlive/trunk@41838 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua | 25 |
2 files changed, 17 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua index 28fd6ddd56b..e0df003e724 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua +++ b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/colormap.lua @@ -32,14 +32,16 @@ ColorMap.range =1000 -- h: mesh width between adjacent values -- 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 -function ColorMap:constructor( h, colorspace, values) - if not h or not colorspace or not values then error("arguments must not be nil")end +-- 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) + if not h or not colorspace or not positions or not values then error("arguments must not be nil")end self.name = name self.h = h self.invh = 1/h self.colorspace = colorspace self.values = values + self.pos = positions local numComponents = self.colorspace.numComponents for i = 1,#self.values do diff --git a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua index ba719753dad..218b08c5dd3 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua +++ b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua @@ -15,7 +15,6 @@ local type=type local tostring=tostring local error=error local table=table -local pgfmathparse = pgfplots.pgfluamathparser.pgfmathparse do -- all globals will be read from/defined in pgfplots: @@ -55,8 +54,6 @@ function Coord:__tostring() return result end -local stringToFunctionMap = pgfluamathfunctions.stringToFunctionMap - -- a reference to a Coord which is returned by math expressions involving 'x', 'y', or 'z' -- see surveystart() local pseudoconstant_pt = nil @@ -151,6 +148,10 @@ function Plothandler:constructor(name, axis, pointmetainputhandler) self.hasUnboundedPointMeta = false -- will be set before the visualization phase starts. At least. self.plotIs3d = false + + -- do not use the global one. It may be outdated. + self.stringToFunctionMap = pgfluamathfunctions.stringToFunctionMap + return self end @@ -205,13 +206,13 @@ end -- @see \pgfplotsplothandlersurveystart function Plothandler:surveystart() - stringToFunctionMap["x"] = pseudoconstant_x - stringToFunctionMap["y"] = pseudoconstant_y - stringToFunctionMap["z"] = pseudoconstant_z - stringToFunctionMap["rawx"] = pseudoconstant_rawx - stringToFunctionMap["rawy"] = pseudoconstant_rawy - stringToFunctionMap["rawz"] = pseudoconstant_rawz - stringToFunctionMap["meta"] = pseudoconstant_meta + self.stringToFunctionMap["x"] = pseudoconstant_x + self.stringToFunctionMap["y"] = pseudoconstant_y + self.stringToFunctionMap["z"] = pseudoconstant_z + self.stringToFunctionMap["rawx"] = pseudoconstant_rawx + self.stringToFunctionMap["rawy"] = pseudoconstant_rawy + self.stringToFunctionMap["rawz"] = pseudoconstant_rawz + self.stringToFunctionMap["meta"] = pseudoconstant_meta end -- @see \pgfplotsplothandlersurveyend @@ -555,7 +556,7 @@ function ExpressionPointMetaHandler:constructor(expression) end function ExpressionPointMetaHandler:assign(pt) - pt.meta = pgfmathparse(self.expression) + pt.meta = pgfluamathparser.pgfmathparse(self.expression) if not pt.meta then error("point meta=" .. self.expression .. ": expression has been rejected.") end @@ -684,7 +685,7 @@ function Axis:filtercoord(dir, ptCoords, filterExpressionByDir) end local old = updatePseudoConstants(ptCoords) - result = pgfmathparse(filterExpressionByDir[dir]) + result = pgfluamathparser.pgfmathparse(filterExpressionByDir[dir]) updatePseudoConstants(old) end |