diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-08 21:05:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-08 21:05:43 +0000 |
commit | 1d11e46a7579f881de8027eed0eecfb5aaf8691a (patch) | |
tree | bbd57ba52182392a6780ae3a2158f2fcc495ecb6 /Master/texmf-dist/tex/generic/pgfplots/libs | |
parent | 178b1e77aba7d5ba4b47cc6e19c1e8a99316d70d (diff) |
pgfplots (8may21)
git-svn-id: svn://tug.org/texlive/trunk@59132 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/libs')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.contourlua.code.tex | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.contourlua.code.tex b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.contourlua.code.tex new file mode 100644 index 00000000000..f7821013eb5 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgfplots/libs/tikzlibrarypgfplots.contourlua.code.tex @@ -0,0 +1,91 @@ +%-------------------------------------------- +% +% Package pgfplots +% +% Provides a user-friendly interface to create function plots (normal +% plots, semi-logplots and double-logplots). +% +% It is based on Till Tantau's PGF package. +% +% Copyright 2007-2021 by Christian Feuersänger. +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. + + +\ifpgfplots@LUA@supported + \pgfplotsutil@directlua{require("prepcontour");} + \pgfplotsset{ + contour lua/.style={ + contour external={% + % we decided to NOT precompute contour/levels: + % @before cmd=\pgfplotscontourpopulateallkeys, + scanline marks=required, + script type=lua, + % + % this library consumes FOUR coordinates... + script input format=x y z meta, + % ... and it also generates FOUR. Always read the last one + % as it is never subject to rounding issues within the + % same contour line: + output point meta=explicit, + % + script={ + copylines = 0; + nblocks = \if 0\ordering \pgfkeysvalueof{/pgfplots/mesh/rows}\else \pgfkeysvalueof{/pgfplots/mesh/cols}\fi; + nlines = \if 0\ordering \pgfkeysvalueof{/pgfplots/mesh/cols}\else \pgfkeysvalueof{/pgfplots/mesh/rows}\fi; + if copylines == nil or nblocks == nil or nlines == nil then + io.stderr:write("failed to parse arguments"); + os.exit(2); + end; + yvaries = \if 0\ordering 'x'\else 'y'\fi; + yvaries = (yvaries == 'y'); + infile = io.open(\"\infile\", \"r\"); + outfile = io.open(\"\outfile\", \"w\"); + mesh = PrepcMesh.new(yvaries, nblocks, nlines, copylines, infile, outfile); + \ifpgfplotsplothandlercontour@corners + corners = true; + \else + corners = false; + \fi + \ifx\thecontourlevels\pgfutil@empty + mesh:autocontour(\thecontournumber, \pgfplotsmetamin, \pgfplotsmetamax, corners); + \else + levels = {\thecontourlevels}; + for n = 1, \#levels do + level = tonumber(levels[n]); + if level then + mesh:contour(level, corners); + end; + end; + \fi + io.close(infile); + mesh:printcontours(); + io.close(outfile); + },% + #1,% + }, + } + } +\else + % do not throw the exception at load time ... this library is + % included as default + \pgfplotsset{ + contour lua/.code={ + \pgfplots@error{Library 'contour lua' requires you to run in LUA mode (i.e. lualatex instead of pdflatex)}% + } + } +\fi + + + |