I know from the pstricks-add
manual, that I can get a vizualization of upper and lower sums for the Riemannian integral like this:
\documentclass{standalone}
\usepackage{auto-pst-pdf}
\usepackage{pst-func}
\psset{xunit=0.7cm,yunit=0.7cm}
\psset{algebraic,plotpoints=100}
\begin{document}
\def\f(x){-1*(-x-1)*(x-5)*x/30*(x-7)}
\begin{pspicture}(0,-2.5)(7.7,4) \psStep[StepType=infimum,linewidth=1.5pt](0,7){15}{\f(x)}
\psplot[linewidth=1.5pt]{0}{7.7}{\f(x)}
\psaxes[Dy=2]{->}(0,0)(0,-2)(7.7,4.7)[$x$,0][$y$,90]
\end{pspicture}
\begin{pspicture}(0,-2.5)(7.7,4) \psStep[StepType=supremum,linewidth=1.5pt](0,7){15}{\f(x)}
\psplot[linewidth=1.5pt]{0}{7.7}{\f(x)}
\psaxes[Dy=2]{->}(0,0)(0,-2)(7.7,4.7)[$x$,0][$y$,90]
\end{pspicture}
\end{document}
with the following output:
But how can I get the picture without the vertical lines. I.e. how can I get automatically just a plot of the approximating step-function?
The solution should be compatible with the picture above since I also want to be able to add the vertical lines in a different color in a second picture.
\def\f(x){-1*(-x-1)*(x-5)*x/30*(x-7)}
seems to have a useless(x)
. It should be\def\f(#1){-1*(-#1-1)*(#1-5)*#1/30*(#1-7)}
to be useful.