Here is my MWE. Why doesn't it reaches the x-axis?
\documentclass{standalone}
\usepackage[miktex]{gnuplottex}
\begin{document}
\begin{gnuplot}
set terminal epslatex color
set xzeroaxis lt -1
set yzeroaxis lt -1
set grid xtics lc rgb '#555555' lw 1 lt 0
set grid ytics lc rgb '#555555' lw 1 lt 0
set yrange [-2:2]
set xrange [-2*pi:2*pi]
plot abs(sin(x))
\end{gnuplot}
\end{document}
Best Answer
What happens is that gnuplot is sampling the x-axis. It means that it does not compute the function for all the possible points in the interval
[-2*pi:2*pi]
but only a finite number of points. The corresponding y-values are then linked together with a line to complete the plot. If the number of samples is too low you obtain a behaviour similar to yours. The best course of action is then to increase the number of samples considered by adding something likeset sample 1000
(tested with gnuplot but not with gnuplottex).In gnuplot with![When sample is set to 100](https://i.stack.imgur.com/iH0xM.png)
set sample 100
:In gnuplot with![enter image description here](https://i.stack.imgur.com/MFjM8.png)
set sample 1000
: