I 'm trying to draw the plot of f(x)=sin(1/x) with pgfplot, but I get an error message:
! TeX capacity exceeded, sorry [main memory size=3000000].
I realized that when I delete one of the packages marked with %!!! in my code, everything is all right. This is the log-file.
What is going wrong?
\documentclass[a4paper,11pt,twoside]{book}
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage[english,greek]{babel}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}%!!!
\usepackage{mathtools}%!!!
\usepackage{subcaption}%!!!
\usepackage[most]{tcolorbox}%!!!
\usepackage{fancybox}%!!!
\usepackage{wasysym}%!!!
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}%!!!
\usetikzlibrary{shadows.blur}%!!!
\usetikzlibrary{decorations.text}%!!!
\usetikzlibrary{calc,patterns,angles,quotes,decorations.pathreplacing}%!!!
\usetikzlibrary{spy}%!!!
\usetikzlibrary{positioning,shapes,fit,arrows}%!!!
\begin{document}
\begin{center}
\begin{tikzpicture}[>=latex]
\begin{axis}[
axis x line=center,
axis y line=center,
xlabel={$x$},
ylabel={$y$},
xlabel style={below right},
ylabel style={above left},
xmin=-1.5,
xmax=1.5,
ymin=-1.2,
ymax=1.2,
ticks=none,
height=0.3\textwidth,
width=0.6\textwidth,]
\addplot[domain=0.01:1.5, thin,samples=5000] {sin(deg(1/(x)))};
\addplot[domain=-1.5:-0.01, thin,samples=5000] {sin(deg(1/(x)))};
\node at (axis cs:1.4,0.8) {$C_f$} ;
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
Thanks in advanced!!!
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6880 64-bit) (preloaded format=pdflatex 2018.12.6) 14 MAR 2019 11:55. Please add yourTeXdistribution. Please see here: https://imgur.com/a/2PioUke – Raaja_is_at_topanswers.xyz Mar 14 '19 at 10:57This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.6960 64-bit) (preloaded format=pdflatex 2019.2.10) 14 MAR 2019 11:30– Kώστας Κούδας Mar 14 '19 at 11:01miktex console, so there wasn't any option for admin or user) and the code is OK. But, when 1) I change0.6\textwidthto0.8\textwidthor 2) I use this code to the book that I write, I have the same problem... – Kώστας Κούδας Mar 14 '19 at 11:25samplesvalue:5000is a lot. – moewe Mar 14 '19 at 11:30miktex consoleis also writing "you have installed miktex for your private use". – Kώστας Κούδας Mar 14 '19 at 22:46samplesmake the plot clearly not correct. 3) I have no idea how to externalising the picture, and I didn't manage to understand frompgfplot-manual. Have you got a link with a simple example? – Kώστας Κούδας Mar 14 '19 at 22:56