texlive[74987] Master: tikzfxgraph (20apr25)
commits+karl at tug.org
commits+karl at tug.org
Sun Apr 20 22:04:06 CEST 2025
Revision: 74987
https://tug.org/svn/texlive?view=revision&revision=74987
Author: karl
Date: 2025-04-20 22:04:06 +0200 (Sun, 20 Apr 2025)
Log Message:
-----------
tikzfxgraph (20apr25)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/tikzfxgraph/
trunk/Master/texmf-dist/doc/latex/tikzfxgraph/README.md
trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.bib
trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf
trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.tex
trunk/Master/texmf-dist/tex/latex/tikzfxgraph/
trunk/Master/texmf-dist/tex/latex/tikzfxgraph/tikzfxgraph.sty
trunk/Master/tlpkg/tlpsrc/tikzfxgraph.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikzfxgraph/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikzfxgraph/README.md 2025-04-20 20:04:06 UTC (rev 74987)
@@ -0,0 +1,76 @@
+tikzfxgraph
+==========
+
+
+Plotting functions in a simplified way.
+(using pgfplots and gnuplot)
+
+For more details, see the documentation,
+[tikzfxgraph.pdf](http://mirrors.ctan.org/graphics/pgf/contrib/tikzfxgraph/doc/tikzfxgraph.pdf)
+
+--------------
+
+## Requirements
+* a fairly recent LaTeX distribution as recent as 2022/06/01
+(with the new in kernel *\ProcessKeyOptions* and *\NewDocumentCommand*).
+* gnuplots version 5.4 recommended (version 6 works, but generate some character error messages, due to a UTF8/UTF16 mismatch)
+
+## Installation
+The stable version is available at [CTAN](https://ctan.org/pkg/tikzfxgraph).
+
+## Usage
+### Stable version
+Just place
+```latex
+ \usepackage{tikz}
+ \usepackage{pgfplots}
+ ...
+ \usepackage{tikzfxgraph}
+```
+
+in the preamble and compile away.
+
+## Contacting Author
+
+For bug reports and enhancement suggestions, the preferred way is to use
+[the project's issue page](https://github.com/alceu-frigeri/tikzfxgraph/issues).
+Please be ready to provide an example code showing the bug, if any.
+
+Please do not use the issue page for generic help on how to use the package.
+
+* git: https://github.com/alceu-frigeri/tikzfxgraph
+
+-------------
+Copyright 2025-present by Alceu Frigeri
+
+ This work may be distributed and/or modified under the
+ conditions of
+
+ * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt), version 1.3c (or later), and/or
+ * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html), version 3 (or later)
+
+This work has the LPPL maintenance status *maintained*.
+
+The Current Maintainer of this work is Alceu Frigeri
+
+-------------
+## This work consist of the files
+
+* tikzfxgraph.sty
+ - the package itself
+
+* README.md (this file)
+ - quick introduction
+
+* tikzfxgraph.tex
+ - package documentation
+* tikzfxgraph.pdf
+ - documentation in PDF format
+
+-------------
+
+## Change log
+
+* Version 1.0 (this)
+ - Initial setup.
+ - Initial CTAN release.
Property changes on: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.bib
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.bib (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.bib 2025-04-20 20:04:06 UTC (rev 74987)
@@ -0,0 +1,47 @@
+%%%==============================================================================
+%% Copyright 2025-present by Alceu Frigeri
+%%
+%% This work may be distributed and/or modified under the conditions of
+%%
+%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt) ,
+%% version 1.3c (or later) , and/or
+%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html) ,
+%% version 3 (or later)
+%%
+%% This work has the LPPL maintenance status *maintained*.
+%%
+%% The Current Maintainer of this work is Alceu Frigeri
+%%
+%% This is version {1.0a} {2025/03/10}
+%%
+%% The list of files that compose this work can be found in the README.md file at
+%% https://ctan.org/pkg/tikzcalendarnotes
+%%
+%%%==============================================================================
+ at manual{TIKZPGF:3.1,
+ organization="Institut für Theoretische Informatik / Universität zu Lübeck",
+ title="The TikZ and PGF Packages",
+ author="Till Tantau and Mark Wibrow and Christian Feuersänger",
+ year="2023",
+ pages="1321",
+ url="http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf",
+ urldate="2025-03-10"
+}
+
+ at manual{PGFPLOTS:1.18,
+ title="The PGFPLOTS Package",
+ author="Christian Feuersänger",
+ year="2021",
+ pages="573",
+ url="http://mirrors.ctan.org/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf",
+ urldate="2025-03-10"
+}
+
+ at manual{gnuplot:5.4,
+ title="gnuplot 5.4",
+ author="Thomas Williams and Colin Kelley",
+ year="2022",
+ pages="316",
+ url="https://gnuplot.sourceforge.net/docs_5.4/Gnuplot_5_4.pdf",
+ urldate="2025-03-10"
+}
Property changes on: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.bib
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf 2025-04-19 23:47:34 UTC (rev 74986)
+++ trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf 2025-04-20 20:04:06 UTC (rev 74987)
Property changes on: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.tex 2025-04-20 20:04:06 UTC (rev 74987)
@@ -0,0 +1,483 @@
+%%%==============================================================================
+% !Mode:: "TeX:EN"
+% Default Compile engines:
+% !TEX program = pdflatex
+% !PDFTeXify ext = --interaction=nonstopmode --enable-etex --enable-write18
+% !PDFLaTeX ext = --interaction=nonstopmode --enable-etex --enable-write18
+% !BIB program = biber
+%%%==============================================================================
+%% Copyright 2025-present by Alceu Frigeri
+%%
+%% This work may be distributed and/or modified under the conditions of
+%%
+%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
+%% version 1.3c (or later), and/or
+%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html),
+%% version 3 (or later)
+%%
+%% This work has the LPPL maintenance status *maintained*.
+%%
+%% The Current Maintainer of this work is Alceu Frigeri
+%%
+%% This is version {1.0} {2025/04/19}
+%%
+%% The list of files that compose this work can be found in the README.md file at
+%% https://ctan.org/pkg/tikzfxgraph
+%%
+%%%==============================================================================
+\documentclass[10pt]{article}
+\RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={40mm,20mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry}
+\usepackage{codedescribe}
+\RequirePackage[inline]{enumitem}
+\SetEnumitemKey{miditemsep}{parsep=0ex,itemsep=0.4ex}
+
+\RequirePackage[backend=biber]{biblatex}
+\addbibresource{tikzfxgraph.bib}
+
+\usepackage{tikz}
+\usetikzlibrary{matrix}
+\usepackage{pgfplots}
+\pgfplotsset{compat=1.18}
+\usetikzlibrary{pgfplots.units}
+
+\usepackage{tikzfxgraph}
+
+\RequirePackage[hidelinks,hypertexnames=false]{hyperref}
+
+\begin{document}
+\tstitle{
+ author={Alceu Frigeri\footnote{\tsverb{https://github.com/alceu-frigeri/tikzfxgraph}}},
+ date={\tsdate},
+ title={The tikzfxgraph Package\break simplified $f_i(x)$ graphics\break Version \PkgInfo{tikzfxgraph}{version}}
+ }
+
+
+\begin{typesetabstract}
+
+
+This package offers a set of streamlined commands to draw algebraic functions, atop of \tsobj[pkg]{pgfplots,gnuplot}. Some auxiliary commands are also defined allowing to create \emph{sets of functions} and \emph{user defined styles}.
+\end{typesetabstract}
+
+\tableofcontents
+
+\section{Introduction}
+
+The \tsobj[pkg]{pgfplots}\cite{PGFPLOTS:1.18} package together with \tsobj[pkg]{gnuplot}\cite{gnuplot:5.4} is extremely flexible, allowing the construction of very intricate graphics, but said flexibility comes at a cost: the sheer number of parameters to be set.
+This package is nothing more than a wrap around \tsobj[pkg]{pgfplots,gnuplot} offering a somewhat simplified interface.
+
+A command (\tsobj{\fxgraphdraw}) and an environment (\tsobj[env]{fxgraph}) are provided for drawing one or more $f_i(x)$ curves, as well some auxiliary commands (\tsobj{\fxsetnew,\fxsetappend}) to define sets of functions and one for user defined styles (\tsobj{\fxsetnewstyle}).
+
+
+\section{Requirements}
+
+One needs to load at least two packages: \tsobj{tikz,pgfplots} (it is advisable to set the \tsobj[pkg]{pgfplots} compatibility to, at least, 1.18 (\tsverb{\pgfplotsset{compat=1.18}}). Like
+\begin{codestore}[demo-pre]
+\usepackage{tikz}
+\usepackage{pgfplots}
+\pgfplotsset{compat=1.18}
+
+\usetikzlibrary{pgfplots.units} %this is optional
+\end{codestore}
+\tscode*{demo-pre}
+
+
+Besides that the \tsobj[pkg]{gnuplot} must be installed/present.
+
+\begin{tsremark}
+to be able to call \tsobj[pkg]{gnuplot} you will need to use the \tsobj[key]{--enable-write18} (or \tsobj[key]{--shell-scape}) option in your \LaTeX\ run. Keep in mind that \tsobj[pkg]{gnuplot} will create a set of files that can be used from one run to another, and, unless you change the domain/functions, \tsobj[key]{--enable-write18} (or \tsobj[key]{--shell-scape}) can be kept disable otherwise.
+\end{tsremark}
+
+\begin{tsremark}[\color{red}Warning:]
+As of now, there is a bug on version 6.0.*, under windows, of \tsobj[pkg]{gnuplot}. It will work, but a series of errors messages will be raised (invalid characters) that's due one of the returning files being written in UTF16 instead of UTF8.
+So, for now, use at most version 5.4.*
+\url{https://sourceforge.net/p/gnuplot/bugs/2747/}
+\end{tsremark}
+
+
+\section{Commands}
+
+\subsection{Defining Functions' sets}\label{function-set}
+
+\begin{codedescribe}{\fxsetnew}
+\begin{codesyntax}%
+\tsmacro{\fxsetnew}{new-fxset}
+\end{codesyntax}
+This defines/create a \tsobj[marg]{fxset} for later reference. A \tsobj[marg]{fxset} is just a ''repository'' of functions descriptions/specifications.
+\end{codedescribe}
+
+\begin{tsremark}
+About dataset's names: It can be almost anything, the name can contain strings normally not allowed in a macro name, like spaces, dots, two-dots and so on, including backslashes, meaning that if someone typesets \tsobj{\XYZ} as a dataset, \tsobj{\XYZ} will be it's name: a backslash isn't an active character anymore and one can't use macros when defining a fxset's name.
+\end{tsremark}
+
+
+\begin{codedescribe}{\fxsetappend}
+\begin{codesyntax}%
+\tsmacro{\fxsetappend}{fxset,keyval-list}
+\end{codesyntax}
+Adds a function description to a given fxset.
+\end{codedescribe}
+
+Valid Keys when describing a function:
+\begin{describelist*}{option}
+\describe{fx}{The function itself. It can be any \tsobj[pkg]{gnuplot} valid expression, in terms of $x$.}
+\describe{id}{(optional) An unique identifier. A set of auxiliary files are created by \tsobj[pkg]{gnuplot} using this as a name suffix. As per the \tsobj[pkg]{pgfplot} manual, they are used to determined if there is the need to re-run \tsobj[pkg]{gnuplot}. }
+\describe{legend}{(optional) The name of the function, to appears as a Legend.}
+\end{describelist*}
+Besides those, any other \tsobj[pkg]{pgfplots} valid key can be used. (e.g. red , thick : the specific curve will be in red, using a thick line). For example:
+\begin{codestore}[fxset-01]
+\fxsetnew{set-A} %creating a new 'set'
+
+\fxsetappend{set-A}{
+ id=f-A0 ,
+ fx=x^2-x+2 ,
+ thick %this key comes from tikz/pgf
+ }
+\fxsetappend{set-A}{
+ id=f-A1 ,
+ fx=x^2+x+3 ,
+ red %this key comes from tikz/pgf
+ }
+\end{codestore}
+\tscode*[
+ codeprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-01}
+
+
+\begin{tsremark}
+An error is raised if \tsobj[marg]{fxset} isn't defined.
+\end{tsremark}
+\begin{tsremark}
+Either set a legend for each and every function, or to none of them. Mixing styles (some with a legend, some without, will result in functions being wrongfully labelled).
+\end{tsremark}
+
+
+\subsection{User Defined Styles}\label{style-def}
+
+\begin{codedescribe}{\fxsetnewstyle}
+\begin{codesyntax}%
+\tsmacro{\fxsetnewstyle}{style-name,keyval-list}
+\end{codesyntax}
+Defines a new \tsobj[pkg]{pgfplot} style key. Which can be later used when drawing $f_i(x)$ function graphs (can be used, for instance, to assure all graphs follow the same style).
+\end{codedescribe}
+
+
+Valid Keys when describing a function:
+\begin{describelist*}{option}
+\describe{linear}{Both $x$ and $y$ axis are linear.}
+\describe{loglog}{Both $x$ and $y$ axis are logarithmic.}
+\describe{semilog x}{The $x$ axis is logarithmic, the $y$ is linear.}
+\describe{semilog y}{The $y$ axis is logarithmic, the $x$ is linear.}
+\describe{x ticks}{Describes the minor ticks to be drawn in the $x$ axis. See below.}
+\describe{y ticks}{Describes the minor ticks to be drawn in the $y$ axis. See below.}
+\end{describelist*}
+Besides those, any other \tsobj[pkg]{pgfplots} valid key can be used. (e.g. red , thick : the specific style will set the lines to be red and thick).
+
+
+Note that the keys \tsobj[key]{x ticks, y ticks} are themselves defined by a set of keyval values, as follow:
+\begin{describelist*}{option}
+\describe{min}{The minimal value (starting value) of the corresponding axis.}
+\describe{max}{It`s maximum value.}
+\describe{delta}{(optional) the $delta$ to be used between \emph{ticks}. Note that, it depends on the kind of the axis. In case of a linear axis, this is just the delta between ticks. If logarithmic, it is the geometric distantce between ticks.}
+\describe{N}{(optional) Sets de number of ticks to be calculated. If case of a linear axis it will set the linear distance to $({max - min})/{N}$. In case of a logarithmic axis it will set the geometric distance to $(\ln(max) - \ln(min))/{N}$. \tsobj[key]{N} has precedence over \tsobj[key]{delta}.}
+\describe{units}{(optional) The units of the corresponding axis.}
+\end{describelist*}
+
+The following example will define a style ''my style A'', to be used in a ''semilog x'' graph. The $x$ domain will go from $0.001$ up to $100$ with ticks at $0.001 ,\, 0.01 ,\, 0.1 ,\, 1.0 ,\, 10 \,\textrm{and}\, 100$. Conversely, the $y$ domain will go from $-\pi$ up to $+\pi$, with linearly spaced ticks. The ticks will be inside the graph.
+\begin{codestore}[fxset-02]
+\fxsetnewstyle{my style A}{
+ semilog x ,
+ x ticks = {
+ min = 0.001 ,
+ max = 100 ,
+ N = 6 ,
+ units = rad/s ,
+ } ,
+ y ticks = {
+ min = -3.14159265 ,
+ max = 3.14159265 ,
+ N = 8 ,
+ units = rad ,
+ } ,
+ % the following key comes from pgfplot
+ tick align=inside , %this package's default is outside.
+ }
+\end{codestore}
+\tscode*[
+ codeprefix={} ,
+ codeprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-02}
+
+
+\begin{tsremark}
+The \tsobj[key]{linear,loglog, semilog x, semilog y} keys are only used when setting the ticks (linear or logarithmic). If none is given, it is assumed that both $x$ and $y$ axis are linear.
+\end{tsremark}
+\begin{tsremark}
+If either \tsobj[key,sep=or]{min,max} are missing, no tick list will be generated.
+\end{tsremark}
+
+\begin{tsremark}
+In case of a logarithmic axis, both \tsobj[key]{min,max} must greater than zero, otherwise an error will be raised.
+\end{tsremark}
+
+
+
+\subsection{Drawing a $f_i(x)$ Graph}
+There is a single drawing command \tsobj{\fxgraphdraw} and a companion environment \tsobj[env]{fxgraph}, both share the same interface. The graph will be constructed as follow: \begin{enumerate*}
+ \item An outer \tsobj[env]{tikzpicture} environment
+ \item An inner \tsobj[env]{axis} environment
+ \item The function's graphs themself
+ \item (in case of the \tsobj[env]{fxgraph} environment) futher \tsobj[pkg]{pgfplot} commands.
+ \end{enumerate*}
+The \tsobj[env]{axis} environment will first be ''styled'' (as per \tsobj[key,sep=or]{linear,loglog,semilog x, semilog y}, see \ref{style-default}) then the \tsobj[key]{ticks}, if defined, will be applied, lastly any further \tsobj[pkg]{pgfplot} key used when calling those commands.
+\begin{tsremark}
+Given the above construct, generic \tsobj[pkg]{pgfplot} keys used will always have a precedence over the default styles, regardless of they order of appearance.
+\end{tsremark}
+
+\begin{codedescribe}{\fxgraphdraw}
+\begin{codesyntax}%
+\tsmacro{\fxgraphdraw}{keyval-list}
+\end{codesyntax}
+Creates a graph, and draw one or more functions/sets of functions as describer by \tsobj[marg]{keval-list} (see below).
+\end{codedescribe}
+
+\begin{codedescribe}[env]{fxgraph}
+\begin{codesyntax}%
+\tsmacro{\begin{fxgraph}}{keyval-list}
+\tsobj[oarg]{further commands}
+\tsmacro{\end{fxgraph}}{}
+\end{codesyntax}
+Same as \tsobj{\fxgraphdraw}, allowing to add further \tsobj[pkg]{pgfplot,tikz} commands.
+\end{codedescribe}
+
+Valid Keys when describing a graph:
+\begin{describelist*}{option}
+\describe{linear}{Both $x$ and $y$ axis are linear.}
+\describe{loglog}{Both $x$ and $y$ axis are logarithmic.}
+\describe{semilog x}{The $x$ axis is logarithmic, the $y$ is linear.}
+\describe{semilog y}{The $y$ axis is logarithmic, the $x$ is linear.}
+
+\describe{x ticks}{Describes the minor ticks to be drawn in the $x$ axis. See below.}
+\describe{y ticks}{Describes the minor ticks to be drawn in the $y$ axis. See below.}
+
+\describe{sans tikzpicture}{Suppress the outer \tsobj[env]{tikpicture} environment.}
+\describe{without tikzpicture}{Suppress the outer \tsobj[env]{tikpicture} environment.}
+
+\describe{function}{Adds a function specification, see \ref{function-set}.}
+\describe{fx set}{A command separated list of \tsobj[key]{fxsets}.}
+\end{describelist*}
+Besides those, any other \tsobj[pkg]{pgfplots} valid key can be used. (e.g. red , thick : the specific style will set the lines to be red and thick).
+
+The \tsobj[key]{x ticks,y ticks} are set the same way as in \ref{style-def} (\tsobj[key]{x tick}=\tsobj[marg]{keyval-list}).
+
+The \tsobj[key]{function} key defines (as in \ref{function-set}) a function to be draw, it can be used multiple times. Note that those functions will be drawn before any \tsobj[key]{fx set}.
+%\fxgraphdraw{semilog x={red},x ticks={min=0.1,max=1000,N=8},y ticks={min=1,max=100,N=10},function={{fX,red,x^2+3}}}
+
+\tsobj[key]{fx set} is a comma separated list of \tsobj[marg]{fxset} (as defined in \ref{function-set}). All functions $f_i(x)$ associated with each \tsobj[marg]{fxset} will be drawn.
+
+Normally, the \tsobj{\fxgraphdraw} command (viz-à-viz \tsobj[env]{fxgraph} environment) will insert an axis environment inside a \tsobj[env]{tizpicture} environment. The \tsobj[key]{sans tikzpicture,without tikzpicture} keys will suppress that external \tsobj[env]{tizpicture} environment.
+
+\section{Style's Default}\label{style-default}
+
+For each kind of graph (linear, loglog, semilog) there is a corresponding predefined style:
+
+\begin{describelist*}{key}
+\describe{linear axis}{This is the ``base'' style. Both axis will be gridded (lines at the corresponding ticks), with an axis line at the bottom (for $x$) and the left (for $y$). Ticks marks will be outside the graph. The legend (if present) will be at the top right of the graph. The $f_i(x)$ curves will be styled according to two lists: \tsobj[key]{fxgraph color list, fxgraph line list} (see below). The graph width is set to 80\% of \tsobj{\textwidth} and it's height to 35\% of \tsobj{\textwidth}.}
+\describe{loglog axis}{It applies the current \tsobj[key]{linear axis} style and the log basis is set to 10.}
+\describe{semilog x axis}{It applies the current \tsobj[key]{linear axis} style and the log basis is set to 10.}
+\describe{semilog y axis}{It applies the current \tsobj[key]{linear axis} style and the log basis is set to 10.}
+\end{describelist*}
+
+Those styles can be modified with \tsobj[code,sep=or]{\pgfplotsset,\pgfkeys} (using \tsobj[key]{.style append} sub-key, for instance. See \cite{TIKZPGF:3.1} and \cite{PGFPLOTS:1.18}). If using the \tsobj{\pgfkeys} remember to switch first to the \tsobj[key]{pgfplots} `family'.
+
+When styling a set of functions, two lists are used (\tsobj[key]{cycle multiindex* list} from \tsobj[pkg]{pgfplots}):
+
+\begin{describelist*}{key}
+\describe{fxgraph color list}{Function's color will cycle through \tsobj[key]{red!80!black,
+ green!80!black,
+ blue!80!black,
+ black,
+ brown!70!black,
+ teal!80!black,
+ orange!80!black,
+ violet!80!black,
+ cyan!80!black,
+ magenta!80!black,
+ yellow!75!black,
+ black!60!white}. }
+\describe{fxgraph line list}{Function's line style will cycle through \tsobj[key]{ solid,
+ solid,
+ solid,
+ dashed,
+ dashed,
+ dashed,
+ dashdotdotted,
+ dashdotdotted,
+ dashdotdotted}.}
+\end{describelist*}
+
+Both can be redefined with \tsobj{\pgfplotscreateplotcyclelist} from \tsobj[pkg]{pgfplots}.
+
+
+
+
+\section{Examples}\label{Examples}
+
+\subsection{Drawing a Bode Diagram}
+%
+\begin{codestore}[fxset-03]
+\fxsetnewstyle{db style}{
+ semilog x ,
+ y ticks = { min = -20 , max = 80 , N = 5 , units = db } ,
+ }
+
+\fxsetnewstyle{phi style}{
+ semilog x ,
+ y ticks = { min = -3.14159265 , max = 3.14159265 , N = 8 , units = rad } ,
+ }
+
+\fxsetnewstyle{freq range A}{
+ semilog x ,
+ x ticks = { min = 0.01 , max = 100000 , N = 7 , units = rad/s } ,
+ }
+%
+%%% This is optional, just defining an auxiliary macro with f(x) core expression
+%%% Note that this is a valid gnuplot's expression (not LaTeX/TeX/...)
+\def\Hs{(x*{0,1}+1)*(x*{0,1}+40000)/((-x^2+0.01*2*400*x*{0,1}+400^2))}
+
+\fxgraphdraw{
+ semilog x ,
+ db style ,
+ freq range A ,
+ function={fx=20*log10(abs(\Hs))}
+ }
+
+\fxgraphdraw{
+ semilog x ,
+ phi style ,
+ freq range A ,
+ function={fx={atan2( imag(\Hs) , real(\Hs) )}}
+ }
+
+\end{codestore}
+\tsdemo*[
+ codeprefix={} ,
+ resultprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-03}
+
+
+\subsection{A Few Curves at Once}
+In the example below note that the \tsobj[key]{fx set} functions are drawn after the 'Dx'. And that defines the legend order.
+\begin{codestore}[fxset-04]
+\fxsetnew{set-B}
+\fxsetappend{set-B}{id=B0,fx=2*cos(x)+1,legend=B0}
+\fxsetappend{set-B}{id=B1,fx=2*sin(2*x)-1,legend=B1,thick}
+ %the thick (line) keyword comes from tikz
+\fxsetnew{set-C}
+\fxsetappend{set-C}{id=C0,fx=1.5*cos(x+2)+1,legend=C0}
+\fxsetappend{set-C}{id=C1,fx=2*sin(x-2)-1,legend=C1}
+
+\fxgraphdraw{
+ linear ,
+ y ticks = {min = -3 , max = 3 , N = 6} ,
+ x ticks = {min = 0 , max = 3*3.14159265 , N = 6 , units = rad} ,
+ fx set = {set-B , set-C} ,
+ function = {id=Dx,fx=x-2,legend=Dx} ,
+ xlabel = some radians , % from pgfplots
+ ylabel = This y , % from pgfplots
+ title = Graph A % from pgfplots
+}
+
+\fxgraphdraw{
+ linear ,
+ y ticks = {min = -3 , max = 3 , N = 6} ,
+ x ticks = {min = 0 , max = 3*3.14159265 , N = 6 , units = rad} ,
+ fx set = {set-C} ,
+ xlabel = some more , % from pgfplots
+ ylabel = This y , % from pgfplots
+ title = Graph B % from pgfplots
+}
+
+\end{codestore}
+\tsdemo*[
+ codeprefix={} ,
+ resultprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-04}
+
+\newpage
+\subsection{Further Customization}
+There are many ways, for instance, to have side by side graphs. One could use, for example, a \tsobj[env]{tabular} environment. In the following the \tsobj[pkg]{tikz} library \tsobj[pkg]{matrix} will be used, in which case the option \tsobj[key]{sans tikzpicture} is needed. Furthermore, it is needed to customize the width and height of each graph. Note: \tsobj[pkg]{tikz} matrix cannot be nested, and since \tsobj[pkg]{pgfplots} legend are created as a \tsobj[pkg]{tikz} matrix, one can't have a legend in this case.
+
+\begin{codestore}[fxset-05]
+\fxsetnew{set-D}
+\fxsetappend{set-D}{id=B0,fx=2*cos(x)+1}
+\fxsetappend{set-D}{id=B1,fx=2*sin(2*x)-1,thick}
+ %the thick (line) keyword comes from tikz
+\fxsetnew{set-E}
+\fxsetappend{set-E}{id=C0,fx=1.5*cos(x+2)+1}
+\fxsetappend{set-E}{id=C1,fx=2*sin(x-2)-1}
+
+\begin{tikzpicture}
+\matrix{
+\fxgraphdraw{
+ linear ,
+ y ticks = {min = -3 , max = 3 , N = 6} ,
+ x ticks = {min = 0 , max = 3*3.14159265 , N = 6} ,
+ fx set = {set-D} ,
+ function = {id=Fx,fx=x-2} ,
+ sans tikzpicture ,
+ width=0.47\textwidth, % from pgfplots
+ height=0.30\textwidth , % from pgfplots
+} &
+\fxgraphdraw{
+ linear ,
+ y ticks = {min = -3 , max = 3 , N = 6} ,
+ x ticks = {min = 0 , max = 3*3.14159265 , N = 6} ,
+ fx set = {set-E} ,
+ function = {id=Gx,fx=x-2} ,
+ sans tikzpicture ,
+ width=0.47\textwidth, % from pgfplots
+ height=0.30\textwidth , % from pgfplots
+} \\
+};
+\end{tikzpicture}
+
+\end{codestore}
+\tscode*[
+ codeprefix={} ,
+ resultprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-05}
+
+\tsresult*[
+ codeprefix={} ,
+ resultprefix={} ,
+ texcs2={fxsetnew,fxsetappend,fxsetnewstyle,fxgraphdraw,fxgraph} ,
+ emph={id,fx,legend,set} ,
+ emph={linear,loglog,semilog,ticks,function} ,
+ emph3={min,max,N,delta,units} ,
+ ]{fxset-05}
+
+
+
+\printbibliography
+
+\end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/tikzfxgraph/tikzfxgraph.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/tikzfxgraph/tikzfxgraph.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikzfxgraph/tikzfxgraph.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/tikzfxgraph/tikzfxgraph.sty 2025-04-20 20:04:06 UTC (rev 74987)
@@ -0,0 +1,834 @@
+%%%==============================================================================
+%% Copyright 2025-present by Alceu Frigeri
+%%
+%% This work may be distributed and/or modified under the conditions of
+%%
+%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
+%% version 1.3c (or later), and/or
+%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html),
+%% version 3 (or later)
+%%
+%% This work has the LPPL maintenance status *maintained*.
+%%
+%% The Current Maintainer of this work is Alceu Frigeri
+%%
+%% This is version {1.0} {2025/04/19}
+%%
+%% The list of files that compose this work can be found in the README.md file at
+%% https://ctan.org/pkg/tikzfxgraph
+%%
+%%%==============================================================================
+\NeedsTeXFormat{LaTeX2e}[2022/06/01]
+
+\ProvidesExplPackage
+ {tikzfxgraph}
+ {2025/04/19}
+ {1.0}
+ {tikzfxgraph Plotting functions in a simplified way.}
+
+%%%%%%%
+%%%
+%%% Just an attempt of having my packages info in a regular way
+%%% Idea being: { <pck-name> / pkg info } for each and all.
+%%%
+%%%%%%%
+\keys_define:nn { tikzfxgraph / pkg info}
+ {
+ name .code:n = {tikzfxgraph} ,
+ prefix .code:n = {tikzfxgraph} ,
+ date .code:n = {2025/04/19},
+ version .code:n = {1.0} ,
+ description .code:n = {tikzfxgraph Plotting functions in a simplified way.}
+ }
+\cs_if_exist:NF \PkgInfo
+ {
+ \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} }
+ \NewDocumentCommand \PkgDescription {m}
+ { \noindent Package~ \textbf{\PkgInfo{#1}{name}}~Version:~\PkgInfo{#1}{version}~ -~ \PkgInfo{#1}{date}\par \emph{\PkgInfo{#1}{description}}~\par }
+ }
+%%%%%%%
+%%% End of cut-n-paste
+%%%%%%%
+
+
+\msg_new:nnnn {tikzfxgraph} { no explicit domain}
+ {
+ (ID:#1)~You~ didn't~ explicitily~ define~ a~ range/domain~ for~ the~ x~ axis.
+ }
+ {
+ You~ didn't~ explicitily~ define~ a~ range/domain~ for~ the~ x~ axis.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+\msg_new:nnnn {tikzfxgraph} { ticks min max}
+ {
+ (ID:#1)~Missing~ min~ and~ max~ values.~Got~#2
+ }
+ {
+ You~ need~ to~ supply~ both~ min~ and~ max~ values.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+\msg_new:nnnn {tikzfxgraph} { ticks N delta}
+ {
+ (ID:#1)~Missing~ N~ or~ delta.~ ticks~ not~ generated.
+ }
+ {
+ You~ need~ to~ supply~ at~ least~ N~ or~ delta.~ ticks~ not~ generated.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+
+\msg_new:nnnn {tikzfxgraph} { log min max}
+ {
+ (ID:#1)~For~ a~ log~ axis~ both~ min~ max~ values~ must~ be~ positive.~Got~#2
+ }
+ {
+ For~ a~ log~ axis~ both~ min~ max~ values~ must~ be~ positive.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+\msg_new:nnnn {tikzfxgraph} { x domain}
+ {
+ (ID:#1)~X~ min/max~ weren't~ explicitly~ defined.~ This~ might~ be~ an~ error.
+ }
+ {
+ X~ min/max~ weren't~ explicitly~ defined.~ This~ might~ be~ an~ error.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+\msg_new:nnnn {tikzfxgraph} {fxset already defined}
+ {
+ (ID:#1)~fxset~ #2~ already~ defined.
+ }
+ {
+ The~ fxset~ #2~ is~ already~ defined.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+\msg_new:nnnn {tikzfxgraph} {fxset undefined}
+ {
+ (ID:#1)~invalid/undefined~ fxset~ #2.
+ }
+ {
+ The~ fxset~ #1~ doesn't~ exist,~ isn't~ defined.
+ ~Error~ Code~ ID:<#1>.
+ }
+
+
+
+\pgfplotscreateplotcyclelist{fxgraph~ color~ list}
+ {
+ red!80!black,
+ green!80!black,
+ blue!80!black,
+ black,
+ brown!70!black,
+ teal!80!black,
+ orange!80!black,
+ violet!80!black,
+ cyan!80!black,
+ magenta!80!black,
+ yellow!75!black,
+ black!60!white
+ }
+\pgfplotscreateplotcyclelist{fxgraph~ line~ list}
+ {
+ solid,
+ solid,
+ solid,
+ dashed,
+ dashed,
+ dashed,
+ dashdotdotted,
+ dashdotdotted,
+ dashdotdotted
+ }
+
+\pgfkeys{
+ pgfplots,
+ linear~ axis/.style =
+ {
+ grid=both,
+ tick~ align=outside,
+ width=0.8\textwidth,
+ height=0.35\textwidth,
+ axis~ line~ style={color=black!85!white,very~ thick},
+ axis~ x~ line=bottom,
+ axis~ y~ line=left,
+ cycle~ multiindex*~ list =
+ {
+ fxgraph~ color~ list\nextlist fxgraph~ line~ list
+ } ,
+ legend~ style =
+ {
+ font=\footnotesize,
+ legend~ pos = outer~ north~ east,
+ draw = none ,
+ inner~ xsep=0pt,
+ inner~ ysep=0pt,
+ anchor = west ,
+ } ,
+ } ,
+ semilog~ x~ axis/.style =
+ {
+ linear~ axis,
+ log~ identify~ minor~ tick~ positions=true,
+% log~ basis~ x = 10,
+ } ,
+ semilog~ y~ axis/.style =
+ {
+ linear~ axis,
+ log~ identify~ minor~ tick~ positions=true,
+% log~ basis~ y = 10,
+ } ,
+ loglog~ axis/.style =
+ {
+ linear~ axis,
+ log~ identify~ minor~ tick~ positions=true,
+% log~ basis~ x = 10,
+% log~ basis~ y = 10,
+ }
+ }
+
+
+
+\int_new:N \l__tikzfxgraph_tmpi_int
+\seq_new:N \l__tikzfxgraph_tick_tmpi_seq
+\fp_new:N \l__tikzfxgraph_tmpi_fp
+\fp_new:N \l__tikzfxgraph_delta_tmpi_fp
+\tl_new:N \l__tikzfxgraph_nill_tl
+\tl_new:N \l__tikzfxgraph_tmpi_tl
+
+\cs_generate_variant:Nn \fp_set:Nn {Ne}
+\cs_generate_variant:Nn \fp_add:Nn {Ne}
+\cs_generate_variant:Nn \seq_put_right:Nn {Ne}
+
+
+\tl_new:N \l__tikzfxgraph_axis_kind_key_tl
+\tl_new:N \l__tikzfxgraph_axis_style_key_tl
+\tl_new:N \l__tikzfxgraph_Xaxis_type_key_tl
+\tl_new:N \l__tikzfxgraph_Yaxis_type_key_tl
+
+\tl_new:N \l__tikzfxgraph_Xticks_key_tl
+\tl_new:N \l__tikzfxgraph_Xmin_key_tl
+\tl_new:N \l__tikzfxgraph_Xmax_key_tl
+\tl_new:N \l__tikzfxgraph_Xunits_key_tl
+
+\tl_new:N \l__tikzfxgraph_Yticks_key_tl
+\tl_new:N \l__tikzfxgraph_Ymin_key_tl
+\tl_new:N \l__tikzfxgraph_Ymax_key_tl
+\tl_new:N \l__tikzfxgraph_Yunits_key_tl
+
+\tl_new:N \l__tikzfxgraph_functions_tl
+
+\tl_new:N \l__tikzfxgraph_fxstyles_key_tl
+
+\clist_new:N \l__tikzfxgraph_fxset_key_clist
+
+
+\keys_define:nn {tikzfxgraph / axis kind}
+ {
+ linear .usage:n = general ,
+ linear .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_axis_kind_key_tl {axis}
+ \tl_set:Nn \l__tikzfxgraph_axis_basestyle_key_tl {linear~ axis}
+ \tl_set:Nn \l__tikzfxgraph_Xaxis_type_key_tl {linear}
+ \tl_set:Nn \l__tikzfxgraph_Yaxis_type_key_tl {linear}
+ } ,
+ linear .value_forbidden:n = true ,
+
+ loglog .usage:n = general ,
+ loglog .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_axis_kind_key_tl {loglogaxis}
+ \tl_set:Nn \l__tikzfxgraph_axis_basestyle_key_tl {loglog~ axis}
+ \tl_set:Nn \l__tikzfxgraph_Xaxis_type_key_tl {log}
+ \tl_set:Nn \l__tikzfxgraph_Yaxis_type_key_tl {log}
+ } ,
+ loglog .value_forbidden:n = true ,
+
+ semilog~ x .usage:n = general ,
+ semilog~ x .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_axis_kind_key_tl {semilogxaxis}
+ \tl_set:Nn \l__tikzfxgraph_axis_basestyle_key_tl {semilog~ x~ axis}
+ \tl_set:Nn \l__tikzfxgraph_Xaxis_type_key_tl {log}
+ \tl_set:Nn \l__tikzfxgraph_Yaxis_type_key_tl {linear}
+ } ,
+ semilog~ x .value_forbidden:n = true ,
+
+ semilog~ y .usage:n = general ,
+ semilog~ y .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_axis_kind_key_tl {semilogyaxis}
+ \tl_set:Nn \l__tikzfxgraph_axis_basestyle_key_tl {semilog~ y~ axis}
+ \tl_set:Nn \l__tikzfxgraph_Xaxis_type_key_tl {linear}
+ \tl_set:Nn \l__tikzfxgraph_Yaxis_type_key_tl {log}
+ } ,
+ semilog~ y .value_forbidden:n = true ,
+ }
+
+\cs_new_protected:Npn \__tikzfxgraph_axiskind_init:n #1
+ {
+ \keys_set:nn {tikzfxgraph / axis kind} {#1}
+ }
+
+
+\keys_define:nn {tikzfxgraph / axis ticks}
+ {
+ x~ ticks .usage:n = general ,
+ x~ ticks .code:n =
+ {
+ \__tikzfxgraph_ticks_set:NVn \l__tikzfxgraph_Xticks_key_tl \l__tikzfxgraph_Xaxis_type_key_tl {#1}
+
+ \tl_set:NV \l__tikzfxgraph_Xmin_key_tl \l__tikzfxgraph_min_key_tl
+ \tl_set:NV \l__tikzfxgraph_Xmax_key_tl \l__tikzfxgraph_max_key_tl
+ \tl_set:NV \l__tikzfxgraph_Xunits_key_tl \l__tikzfxgraph_units_key_tl
+ } ,
+ x~ ticks .value_required:n = true ,
+
+ y~ ticks .usage:n = general ,
+ y~ ticks .code:n =
+ {
+ \__tikzfxgraph_ticks_set:NVn \l__tikzfxgraph_Yticks_key_tl \l__tikzfxgraph_Yaxis_type_key_tl {#1}
+
+ \tl_set:NV \l__tikzfxgraph_Ymin_key_tl \l__tikzfxgraph_min_key_tl
+ \tl_set:NV \l__tikzfxgraph_Ymax_key_tl \l__tikzfxgraph_max_key_tl
+ \tl_set:NV \l__tikzfxgraph_Yunits_key_tl \l__tikzfxgraph_units_key_tl
+ } ,
+ y~ ticks .value_required:n = true ,
+ }
+
+\cs_new_protected:Npn \__tikzfxgraph_axisticks_init:
+ {
+ \tl_clear:N \l__tikzfxgraph_Xticks_key_tl
+ \tl_clear:N \l__tikzfxgraph_Xmin_key_tl
+ \tl_clear:N \l__tikzfxgraph_Xmax_key_tl
+ \tl_clear:N \l__tikzfxgraph_Xunits_key_tl
+ \tl_clear:N \l__tikzfxgraph_Yticks_key_tl
+ \tl_clear:N \l__tikzfxgraph_Ymin_key_tl
+ \tl_clear:N \l__tikzfxgraph_Ymax_key_tl
+ \tl_clear:N \l__tikzfxgraph_Yunits_key_tl
+ }
+
+
+
+\keys_define:nn {}
+ {
+ tikzfxgraph / graph desc .inherit:n =
+ {
+ tikzfxgraph / axis kind ,
+ tikzfxgraph / axis ticks ,
+ }
+ }
+
+\keys_define:nn {tikzfxgraph / graph desc}
+ {
+ sans~ tikz picture .usage:n = general ,
+ sans~ tikz picture .bool_set:N = \l__tikzfxgraph_sanstikz_key_bool ,
+
+ without~ tikz picture .usage:n = general ,
+ without~ tikz picture .bool_set:N = \l__tikzfxgraph_sanstikz_key_bool ,
+
+ function .usage:n = general ,
+ function .code:n =
+ {
+ \__tikzfxgraph_fxset_append:nn {default _ set}{#1}
+ } ,
+ function .value_required:n = true ,
+
+ fx~ set .usage:n = general ,
+ fx~ set .clist_set:N = \l__tikzfxgraph_fxset_key_clist ,
+ fx~ set .value_required:n = true ,
+
+ unknown .code:n =
+ {
+ \__tikzfxgraph_fxstyles_setkey:NVn
+ \l__tikzfxgraph_axis_style_key_tl
+ \l_keys_key_str
+ {#1}
+ } ,
+ }
+
+\cs_new_protected:Npn \__tikzfxgraph_graphdesc_init:
+ {
+ \__tikzfxgraph_fxset_clear:n {default _ set}
+ \clist_clear:N \l__tikzfxgraph_fxset_key_clist
+ \bool_set_false:N \l__tikzfxgraph_sanstikz_key_bool
+ \tl_clear:N \l__tikzfxgraph_axis_style_key_tl
+
+ \__tikzfxgraph_axisticks_init:
+ \__tikzfxgraph_axiskind_init:n {linear}
+ }
+
+
+\keys_define:nn {}
+ {
+ tikzfxgraph / keys desc .inherit:n =
+ {
+ tikzfxgraph / axis kind ,
+ tikzfxgraph / axis ticks ,
+ }
+ }
+
+\keys_define:nn {tikzfxgraph / keys desc}
+ {
+ unknown .code:n =
+ {
+ \__tikzfxgraph_fxstyles_setkey:NVn
+ \l__tikzfxgraph_axis_style_key_tl
+ \l_keys_key_str
+ {#1}
+ } ,
+ }
+
+
+\cs_new_protected:Npn \__tikzfxgraph_keysdesc_init:
+ {
+ \tl_clear:N \l__tikzfxgraph_axis_style_key_tl
+
+ \__tikzfxgraph_axisticks_init:
+ \__tikzfxgraph_axiskind_init:n {linear}
+ }
+
+
+\keys_define:nn {tikzfxgraph / ticks}
+ {
+ min .usage:n = general ,
+ min .tl_set:N = \l__tikzfxgraph_min_key_tl ,
+ min .value_required:n = true ,
+
+ max .usage:n = general ,
+ max .tl_set:N = \l__tikzfxgraph_max_key_tl ,
+ max .value_required:n = true ,
+
+ delta .usage:n = general ,
+ delta .tl_set:N = \l__tikzfxgraph_delta_key_tl ,
+ delta .value_required:n = true ,
+
+ N .usage:n = general ,
+ N .tl_set:N = \l__tikzfxgraph_N_key_tl ,
+ N .value_required:n = true ,
+
+ units .usage:n = general ,
+ units .tl_set:N = \l__tikzfxgraph_units_key_tl ,
+ units .value_required:n = true ,
+
+ phi .usage:n = general ,
+ phi .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_min_key_tl {-3.14159265}
+ \tl_set:Nn \l__tikzfxgraph_max_key_tl { 3.14159265}
+ \tl_set:Nn \l__tikzfxgraph_N_key_tl { 8 }
+ \tl_set:Nn \l__tikzfxgraph_units_key_tl { rad }
+ } ,
+ phi .value_forbidden:n = true ,
+
+ db .usage:n = general ,
+ db .code:n =
+ {
+ \tl_set:Nn \l__tikzfxgraph_min_key_tl {-20}
+ \tl_set:Nn \l__tikzfxgraph_max_key_tl { 80}
+ \tl_set:Nn \l__tikzfxgraph_N_key_tl { 5 }
+ \tl_set:Nn \l__tikzfxgraph_units_key_tl { db }
+ } ,
+ db .value_forbidden:n = true ,
+ }
+
+\cs_new_protected:Npn \__tikzfxgraph_ticks_init:
+ {
+ \tl_clear:N \l__tikzfxgraph_min_key_tl
+ \tl_clear:N \l__tikzfxgraph_max_key_tl
+ \tl_clear:N \l__tikzfxgraph_delta_key_tl
+ \tl_clear:N \l__tikzfxgraph_N_key_tl
+ \tl_clear:N \l__tikzfxgraph_units_key_tl
+ }
+
+
+\keys_define:nn {tikzfxgraph / fx set}
+ {
+ fx .usage:n = general ,
+ fx .tl_set:N = \l__tikzfxgraph_fx_key_tl ,
+ fx .value_required:n = true ,
+
+ id .usage:n = general ,
+ id .tl_set:N = \l__tikzfxgraph_fxid_key_tl ,
+ id .value_required:n = true ,
+
+ legend .usage:n = general ,
+ legend .tl_set:N = \l__tikzfxgraph_fxlegend_key_tl ,
+ legend .value_required:n = true ,
+
+ unknown .code:n =
+ {
+ \__tikzfxgraph_fxstyles_setkey:NVn
+ \l__tikzfxgraph_fxstyles_key_tl
+ \l_keys_key_str
+ {#1}
+ } ,
+ }
+
+
+\cs_new_protected:Npn \__tikzfxgraph_fxset_init:
+ {
+ \tl_clear:N \l__tikzfxgraph_fxstyles_key_tl
+ \tl_clear:N \l__tikzfxgraph_fx_key_tl
+ \tl_clear:N \l__tikzfxgraph_fxid_key_tl
+ \tl_clear:N \l__tikzfxgraph_fxlegend_key_tl
+ }
+
+
+\prg_generate_conditional_variant:Nnn \fp_compare:nNn {eNn} {p , T , F , TF}
+
+
+\cs_new_protected:Npn \__tikzfxgraph_fxstyles_setkey:Nnn #1#2#3
+ {
+ \tl_if_blank:VF #1
+ {
+ \tl_put_right:Nn #1 ,
+ }
+ \tl_if_blank:nTF {#3}
+ {
+ \tl_put_right:Nn #1 {#2}
+ }
+ {
+ \tl_put_right:Nn #1 {#2={#3}}
+ }
+ }
+
+\cs_generate_variant:Nn \__tikzfxgraph_fxstyles_setkey:Nnn {NVn}
+
+
+\cs_new_protected:Npn \__tikzfxgraph_ticks_set:Nnn #1#2#3
+ {
+ \__tikzfxgraph_ticks_init:
+
+ \keys_set:nn {tikzfxgraph / ticks}
+ {#3}
+ \bool_lazy_or:nnTF
+ {\tl_if_blank_p:V \l__tikzfxgraph_min_key_tl} {\tl_if_blank_p:V \l__tikzfxgraph_max_key_tl}
+ {
+ \msg_error:nnne {tikzfxgraph} {ticks min max}{ticks-01}
+ {min:<\l__tikzfxgraph_min_key_tl> ~-~ max:<\l__tikzfxgraph_max_key_tl>}
+ }
+ {
+ \tl_if_blank:VTF \l__tikzfxgraph_N_key_tl
+ {
+ \tl_if_blank:VTF \l__tikzfxgraph_delta_key_tl
+ {
+ \msg_warning:nnn {tikzfxgraph} {ticks N delta}{ticks-02}
+ \tl_clear:N #1
+ }
+ {
+ \int_zero:N \l__tikzfxgraph_tmpi_int
+ \seq_clear:N \l__tikzfxgraph_tick_tmpi_seq
+ \str_if_eq:nnTF {#2}{linear}
+ {
+ \fp_set:Ne \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_min_key_tl}
+ \fp_set:Ne \l__tikzfxgraph_delta_tmpi_fp { \l__tikzfxgraph_delta_key_tl }
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_use:N \l__tikzfxgraph_tmpi_fp}
+ \fp_while_do:nNnn
+ {\l__tikzfxgraph_tmpi_fp} < {\l__tikzfxgraph_max_key_tl}
+ {
+ \fp_add:Nn \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_delta_tmpi_fp}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_use:N \l__tikzfxgraph_tmpi_fp}
+ }
+ \tl_set:Ne #1 {\seq_use:Nn \l__tikzfxgraph_tick_tmpi_seq {~,~}}
+ }
+ { %log
+ \bool_lazy_and:nnTF
+ { \fp_compare_p:eNn {\l__tikzfxgraph_max_key_tl} > {0} } { \fp_compare_p:eNn {\l__tikzfxgraph_min_key_tl} > {0} }
+ {
+ \fp_set:Ne \l__tikzfxgraph_tmpi_fp {ln(\l__tikzfxgraph_min_key_tl)}
+ \fp_set:Ne \l__tikzfxgraph_tmpii_fp {ln(\l__tikzfxgraph_max_key_tl)}
+ \fp_set:Ne \l__tikzfxgraph_delta_tmpi_fp { ln(\l__tikzfxgraph_delta_key_tl) }
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_eval:n {exp(\l__tikzfxgraph_tmpi_fp)}}
+ \fp_while_do:nNnn
+ {\l__tikzfxgraph_tmpi_fp} < {\l__tikzfxgraph_tmpii_fp}
+ {
+ \fp_add:Nn \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_delta_tmpi_fp}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_eval:n {exp(\l__tikzfxgraph_tmpi_fp)}}
+ }
+ \tl_set:Ne #1 {\seq_use:Nn \l__tikzfxgraph_tick_tmpi_seq {~,~}}
+ }
+ {
+ \msg_error:nnne {tikzfxgraph}{log min max}{ticks-03}
+ {min:<\l__tikzfxgraph_min_key_tl> ~-~ max:<\l__tikzfxgraph_max_key_tl>} % both must be positive
+ }
+ }
+ }
+ }
+ {
+ \int_zero:N \l__tikzfxgraph_tmpi_int
+ \seq_clear:N \l__tikzfxgraph_tick_tmpi_seq
+ \str_if_eq:nnTF {#2}{linear}
+ {
+ \fp_set:Ne \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_min_key_tl}
+ \fp_set:Ne \l__tikzfxgraph_delta_tmpi_fp { (\l__tikzfxgraph_max_key_tl - \l__tikzfxgraph_min_key_tl) / \l__tikzfxgraph_N_key_tl}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_use:N \l__tikzfxgraph_tmpi_fp}
+ \int_while_do:nNnn
+ {\l__tikzfxgraph_tmpi_int} < {\l__tikzfxgraph_N_key_tl}
+ {
+ \fp_add:Nn \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_delta_tmpi_fp}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_use:N \l__tikzfxgraph_tmpi_fp}
+ \int_incr:N \l__tikzfxgraph_tmpi_int
+ }
+ \tl_set:Ne #1 {\seq_use:Nn \l__tikzfxgraph_tick_tmpi_seq {~,~}}
+ }
+ { %log
+ \bool_lazy_and:nnTF
+ { \fp_compare_p:eNn {\l__tikzfxgraph_max_key_tl} > {0} } { \fp_compare_p:eNn {\l__tikzfxgraph_min_key_tl} > {0} }
+ {
+ \fp_set:Ne \l__tikzfxgraph_tmpi_fp {ln(\l__tikzfxgraph_min_key_tl)}
+ \fp_set:Ne \l__tikzfxgraph_delta_tmpi_fp { (ln(\l__tikzfxgraph_max_key_tl) - ln(\l__tikzfxgraph_min_key_tl)) / \l__tikzfxgraph_N_key_tl}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_eval:n {exp(\l__tikzfxgraph_tmpi_fp)}}
+ \int_while_do:nNnn
+ {\l__tikzfxgraph_tmpi_int} < {\l__tikzfxgraph_N_key_tl}
+ {
+ \fp_add:Nn \l__tikzfxgraph_tmpi_fp {\l__tikzfxgraph_delta_tmpi_fp}
+ \seq_put_right:Ne \l__tikzfxgraph_tick_tmpi_seq {\fp_eval:n {exp(\l__tikzfxgraph_tmpi_fp)}}
+ \int_incr:N \l__tikzfxgraph_tmpi_int
+ }
+ \tl_set:Ne #1 {\seq_use:Nn \l__tikzfxgraph_tick_tmpi_seq {~,~}}
+ }
+ {
+ \msg_error:nnn {tikzfxgraph}{log min max}{ticks-04}
+ {min:<\l__tikzfxgraph_min_key_tl> ~-~ max:<\l__tikzfxgraph_max_key_tl>} % both must be positive
+ }
+ }
+ }
+ }
+ }
+\cs_generate_variant:Nn \__tikzfxgraph_ticks_set:Nnn { NVn }
+
+
+\cs_new_protected:Npn \__tikzfxgraph_fxset_addplot:nn #1#2
+ {
+ \__tikzfxgraph_fxset_init:
+
+ \keys_set:nn {tikzfxgraph / fx set}
+ {#2}
+
+ \tl_set:Nn \l_tmpa_tl {samples=2000}
+ \tl_if_blank:VF \l__tikzfxgraph_fxid_key_tl
+ {
+ \tl_put_right:Ne \l_tmpa_tl {,id=\l__tikzfxgraph_fxid_key_tl}
+ }
+ \tl_put_right:ce {l__tikzfxgraph_fxset_ #1 _tl}
+ {
+ \exp_not:N\addplot+ gnuplot
+ [ \l_tmpa_tl , \l__tikzfxgraph_fxstyles_key_tl ]
+ {\l__tikzfxgraph_fx_key_tl};
+ }
+ \tl_if_blank:VF \l__tikzfxgraph_fxlegend_key_tl
+ {
+ \tl_put_right:ce {l__tikzfxgraph_fxset_ #1 _tl}
+ {
+ \exp_not:N\addlegendentry {\l__tikzfxgraph_fxlegend_key_tl}
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__tikzfxgraph_fxset_new:n #1
+ {
+ \tl_if_exist:cTF {l__tikzfxgraph_fxset_ #1 _tl}
+ {
+ \msg_error:nnnn {tikzfxgraph}{fxset already defined}{fxset-01}{#1}
+ }
+ {
+ \tl_new:c {l__tikzfxgraph_fxset_ #1 _tl}
+ }
+ }
+
+
+\__tikzfxgraph_fxset_new:n {default _ set}
+
+\cs_new_protected:Npn \__tikzfxgraph_fxset_clear:n #1
+ {
+ \tl_if_exist:cTF {l__tikzfxgraph_fxset_ #1 _tl}
+ {
+ \tl_clear:c {l__tikzfxgraph_fxset_ #1 _tl}
+ }
+ {
+ \msg_error:nnnn {tikzfxgraph}{fxset undefined}{fxset-02}{#1}
+ }
+ }
+
+
+
+\cs_new_protected:Npn \__tikzfxgraph_fxset_append:nn #1#2
+ {
+ \tl_if_exist:cTF {l__tikzfxgraph_fxset_ #1 _tl}
+ {
+ \__tikzfxgraph_fxset_addplot:nn {#1}{#2}
+ }
+ {
+ \msg_error:nnnn {tikzfxgraph}{fxset undefined}{fxset-03}{#1}
+ }
+ }
+
+\NewDocumentCommand{\fxsetnew}{m}
+ { \__tikzfxgraph_fxset_new:n {#1} }
+
+
+\NewDocumentCommand{\fxsetappend}{mm}
+ { \__tikzfxgraph_fxset_append:nn {#1}{#2} }
+
+
+\NewDocumentCommand{\fxsetnewstyle}{mm}
+ {
+ \__tikzfxgraph_keysdesc_init:
+
+ \keys_set:nn {tikzfxgraph / keys desc}
+ {#2}
+ \__tikzfxgraph_set_keys:N \l__tikzfxgraph_stylekeys_set_tl
+ \use:e
+ {
+ \exp_not:N\pgfkeys{pgfplots,
+ #1/.style =
+ { \l__tikzfxgraph_stylekeys_set_tl }
+ }
+ }
+% \tl_show:n {key~ being~ defined:<#1>}
+% \pgfkeys{pgfplots,#1/.show~ code}
+ }
+
+
+\cs_new_protected:Npn \__tikzfxgraph_axisdraw:nnnn #1#2#3#4
+ {
+ \bool_if:NTF \l__tikzfxgraph_sanstikz_key_bool
+ {
+ \tl_set:Nn \l_tmpa_tl
+ {
+ \begin{#1}[#2]
+ #3
+ #4
+ \end{#1}
+ }
+ }
+ {
+ \tl_set:Nn \l_tmpa_tl
+ {
+ \begin{tikzpicture}
+ \begin{#1}[#2]
+ #3
+ #4
+ \end{#1}
+ \end{tikzpicture}
+ }
+ }
+% \tl_show:N \l_tmpa_tl
+ \l_tmpa_tl
+ }
+
+\cs_generate_variant:Nn \__tikzfxgraph_axisdraw:nnnn {VVVn}
+
+\cs_new_protected:Npn \__tikzfxgraph_set_keys:Nnnn #1#2#3#4
+ {
+ \tl_if_blank:nTF {#2}
+ { \tl_clear:N #1 }
+ { \tl_set:Nn #1 {#2} }
+ \tl_if_blank:nF {#3}
+ { \tl_put_right:Nn #1 {xtick={#3},} }
+ \tl_if_blank:nF {#4}
+ { \tl_put_right:Nn #1 {ytick={#4}} }
+ }
+
+\cs_generate_variant:Nn \__tikzfxgraph_set_keys:Nnnn {NVVV}
+
+\tl_new:N \l__tikzfxgraph_stylekeys_set_tl
+
+\cs_new_protected:Npn \__tikzfxgraph_set_keys:N #1
+ {
+ \tl_clear:N \l_tmpa_tl
+ \tl_if_blank:VF \l__tikzfxgraph_axis_style_key_tl
+ {
+ \tl_set:NV \l_tmpa_tl \l__tikzfxgraph_axis_style_key_tl
+ \tl_put_right:Nn \l_tmpa_tl {,}
+ }
+
+ \bool_lazy_or:nnTF {\tl_if_blank_p:V \l__tikzfxgraph_Xmin_key_tl } {\tl_if_blank_p:V \l__tikzfxgraph_Xmax_key_tl}
+ {
+ \msg_warning:nnn {tikzfxgraph}{x domain}{keys-01}
+ }
+ {
+ \tl_put_right:Ne \l_tmpa_tl
+ {
+ xmin=\l__tikzfxgraph_Xmin_key_tl,
+ xmax=\l__tikzfxgraph_Xmax_key_tl,
+ domain=\l__tikzfxgraph_Xmin_key_tl : \l__tikzfxgraph_Xmax_key_tl,
+ }
+ }
+ \tl_if_blank:VF \l__tikzfxgraph_Xunits_key_tl
+ {
+ \tl_put_right:Ne \l_tmpa_tl
+ { x~ unit=\l__tikzfxgraph_Xunits_key_tl, }
+ }
+ \bool_lazy_or:nnF {\tl_if_blank_p:V \l__tikzfxgraph_Ymin_key_tl} {\tl_if_blank_p:V \l__tikzfxgraph_Ymax_key_tl}
+ {
+ \tl_put_right:Ne \l_tmpa_tl
+ {
+ ymin=\l__tikzfxgraph_Ymin_key_tl,
+ ymax=\l__tikzfxgraph_Ymax_key_tl,
+ }
+ }
+ \tl_if_blank:VF \l__tikzfxgraph_Yunits_key_tl
+ {
+ \tl_put_right:Ne \l_tmpa_tl
+ { y~ unit=\l__tikzfxgraph_Yunits_key_tl, }
+ }
+
+ \__tikzfxgraph_set_keys:NVVV
+ #1
+ \l_tmpa_tl
+ \l__tikzfxgraph_Xticks_key_tl
+ \l__tikzfxgraph_Yticks_key_tl
+
+ }
+
+
+\NewDocumentCommand{\fxgraphdraw}{m}
+ {
+ \begin{fxgraph}{#1}
+ \end{fxgraph}
+ }
+
+\NewDocumentEnvironment{fxgraph}{m +b}
+ {
+ \__tikzfxgraph_graphdesc_init:
+
+ \keys_set:nn {tikzfxgraph / graph desc}
+ {#1}
+
+ \__tikzfxgraph_set_keys:N \l__tikzfxgraph_stylekeys_set_tl
+
+ \clist_map_inline:Nn \l__tikzfxgraph_fxset_key_clist
+ {
+ \tl_if_exist:cTF {l__tikzfxgraph_fxset_ ##1 _tl}
+ {
+ \tl_put_right:Nv
+ \l__tikzfxgraph_fxset_default_set_tl
+ { l__tikzfxgraph_fxset_ ##1 _tl }
+ }
+ {
+ \msg_error:nnnn {tikzfxgraph} {fxset undefined}{set-02}{##1}
+ }
+ }
+
+ \tl_set:NV \l_tmpa_tl \l__tikzfxgraph_axis_basestyle_key_tl
+ \tl_put_right:Nn \l_tmpa_tl {,}
+ \tl_put_right:NV \l_tmpa_tl \l__tikzfxgraph_stylekeys_set_tl
+
+% \tl_show:N \l__tikzfxgraph_stylekeys_set_tl
+% \tl_show:N \l_tmpa_tl
+
+
+ \__tikzfxgraph_axisdraw:VVVn
+ \l__tikzfxgraph_axis_kind_key_tl
+ \l_tmpa_tl
+ \l__tikzfxgraph_fxset_default_set_tl
+ {#2}
+ }
+ {}
Property changes on: trunk/Master/texmf-dist/tex/latex/tikzfxgraph/tikzfxgraph.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2025-04-19 23:47:34 UTC (rev 74986)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2025-04-20 20:04:06 UTC (rev 74987)
@@ -879,7 +879,7 @@
tikz-relay tikz-sfc tikz-swigs
tikz-timing tikz-trackschematic tikz-triminos tikz-truchet
tikzbricks tikzcalendarnotes tikzcodeblocks tikzdotncross tikzducks
- tikzfill tikzinclude tikzlings
+ tikzfill tikzfxgraph tikzinclude tikzlings
tikzmark tikzmarmots tikzorbital
tikzpackets tikzpagenodes tikzpeople tikzpfeile tikzpingus tikzposter
tikzquads tikzquests tikzscale tikzsymbols
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2025-04-19 23:47:34 UTC (rev 74986)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2025-04-20 20:04:06 UTC (rev 74987)
@@ -1947,6 +1947,7 @@
'tikz3d-fr' => '&POST_onelevel',
'tikzcalendarnotes' => '&POST_onelevel',
'tikzdotncross' => '&POST_onelevel',
+ 'tikzfxgraph' => '&POST_onelevel',
'tikzquads' => '&POST_onelevel',
'tikzquests' => '&POST_onelevel',
'timeop' => '&POST_onelevel',
Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2025-04-19 23:47:34 UTC (rev 74986)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2025-04-20 20:04:06 UTC (rev 74987)
@@ -224,6 +224,7 @@
depend tikzdotncross
depend tikzducks
depend tikzfill
+depend tikzfxgraph
depend tikzinclude
depend tikzlings
depend tikzmark
Added: trunk/Master/tlpkg/tlpsrc/tikzfxgraph.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list.