You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to provide a way to "export" a function defined in sage such that you can use it with pgfplots directly. There is already a suggestion on stackexchange (http://tex.stackexchange.com/questions/220491/how-to-pass-a-function-defined-in-sagetex-to-pgfplots), where I proposed to have something like a sageraw command which you could use to pass the function as in the example below. Another idea would be to provide a command \expfct(funktion,texcommand) which "saves" the function under the name texcommand such that it is available from the main document for pgfplots.
\documentclass{article}
\usepackage{pgfplots}
\usepackage{sagetex}
\begin{document}
\begin{sagesilent}
f(x) = 2*sin(x^2)
\end{sagesilent}
$f(x) = \sage{f(x)}$
\begin{center}
\begin{tikzpicture}
\begin{axis}[no markers, samples=100]
% \addplot gnuplot {\sageraw{f(x)}};
%should be the same as
\addplot gnuplot {2*sin(x^2)};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
The text was updated successfully, but these errors were encountered:
It would be useful to provide a way to "export" a function defined in sage such that you can use it with pgfplots directly. There is already a suggestion on stackexchange (http://tex.stackexchange.com/questions/220491/how-to-pass-a-function-defined-in-sagetex-to-pgfplots), where I proposed to have something like a sageraw command which you could use to pass the function as in the example below. Another idea would be to provide a command \expfct(funktion,texcommand) which "saves" the function under the name texcommand such that it is available from the main document for pgfplots.
The text was updated successfully, but these errors were encountered: