Im asked to draw/plot the graph for the modulus function f(m) = m^7 modulo 137. I tried to do that in LaTeX with the package „pgfplots“ following the instructions from the official overleaf tutorial: https://de.overleaf.com/learn/latex/Pgfplots_package#Reference_guide However this doesnt work at all. My whole document crashes as soon as I compile while using the function from above. I used the same code as I did for plotting a „normal“ function: If I leave out the „mod 137“ then it plots perfectly.
\documentclass{article}
\usepackage[margin=0.25in]{geometry}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = left,
xlabel = \(m\),
ylabel = {\(f(m)\)},
xmin=0, xmax=5,
ymin=0, ymax=100,
]
\addplot [
domain=0:10,
samples=100,
color=black,
]
{x^7 \mod 137};
\addlegendentry{(f(m))}.
\end{axis}
\end{tikzpicture}
\end{document}
Help of any kind is very much appreciated!
! Undefined control sequence.
\pgfplots@addplotimpl@expression@yEXPR ->x^7 \mod
137
l.20 {x^7 \mod 137};

mod(x^7,137)(no backslash) – gernot Oct 17 '21 at 11:42