diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua | 45 |
1 files changed, 40 insertions, 5 deletions
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 e3fc089e25d..ba719753dad 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua +++ b/Master/texmf-dist/tex/generic/pgfplots/lua/pgfplots/plothandler.lua @@ -148,6 +148,7 @@ function Plothandler:constructor(name, axis, pointmetainputhandler) self.pointmetamap = nil -- will be set later self.filteredCoordsAway = false self.plotHasJumps = false + self.hasUnboundedPointMeta = false -- will be set before the visualization phase starts. At least. self.plotIs3d = false return self @@ -173,6 +174,7 @@ function Plothandler:addSurveyedPoint(pt) -- log("addSurveyedPoint(" .. tostring(pt) .. ") ...\n") end + -- PRIVATE -- -- assigns the point meta value by means of the PointMetaHandler @@ -186,7 +188,7 @@ end -- -- updates point meta limits function Plothandler:setperpointmetalimits(pt) - if pt.meta ~= nil then + if self.pointmetainputhandler ~= nil and self.pointmetainputhandler:isPointMetaBounded(pt.meta) then if not type(pt.meta) == 'number' then error("got unparsed input "..tostring(pt)) end if self.autocomputeMetaMin then self.metamin = math.min(self.metamin, pt.meta ) @@ -195,6 +197,9 @@ function Plothandler:setperpointmetalimits(pt) if self.autocomputeMetaMax then self.metamax = math.max(self.metamax, pt.meta ) end + else + -- FIXME : the TeX code also checks for 'bounded point meta' if there is no point meta input!? + self.hasUnboundedPointMeta = true end end @@ -490,6 +495,25 @@ function PointMetaHandler.assign(pt) error("This instance of PointMetaHandler is not implemented") end +-- see \pgfplotsifpointmetaisbounded +function PointMetaHandler:isPointMetaBounded(meta) + if meta == nil then + return false + end + + if self.isSymbolic then + if meta == "" then + return false + else + return true + end + + else + -- check the number: + return pgfplotsmath.isfinite(meta) + end +end + -- A PointMetaHandler which merely acquires values of either x,y, or z. CoordAssignmentPointMetaHandler = newClassExtends( PointMetaHandler ) @@ -853,10 +877,7 @@ function Axis:datapointsurveyed(pt, plothandler) log("NOTE: coordinate " .. tostring(pt) .. " has been dropped because " .. reason .. "\n") end else - plothandler.plotHasJumps = true - - local serialized = self:addVisualizationDependencies(pt) - plothandler:addSurveyedPoint(serialized) + self:addSurveyedJump(plothandler, pt) end end end @@ -865,6 +886,13 @@ function Axis:datapointsurveyed(pt, plothandler) -- We do it it surveypoint. end +function Axis:addSurveyedJump(plothandler, pt) + plothandler.plotHasJumps = true + + local serialized = self:addVisualizationDependencies(pt) + plothandler:addSurveyedPoint(serialized) +end + local function axisLimitToTeXString(name, value) if value == math.huge or value == -math.huge then return "" @@ -937,6 +965,13 @@ function Axis:surveyToPgfplots(plothandler) result = result .. "\\def\\pgfplotsaxisplothasjumps{0}" end + if plothandler.hasUnboundedPointMeta then + result = result .. + "\\def\\pgfplotsaxisplothasunboundedpointmeta{1}" + else + result = result .. + "\\def\\pgfplotsaxisplothasunboundedpointmeta{0}" + end if plothandler.filteredCoordsAway then result = result .. "\\def\\pgfplotsaxisfilteredcoordsaway{1}" |