How do I set intervals or integration with TikZ PGFlots? Something similar to the figure below, but I want to define the function, the intervals of integration and the partitions.
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage[usenames,dvipsnames,svgnames]{xcolor}
\usepackage{amsmath,tkz-fct}
\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}
\begin{document}
\begin{tikzpicture}[scale=1]
\tkzInit[xmin=-3,xmax=6,ymin=-2,ymax=14,ystep=2]
\tkzDrawX \tkzDrawY
\tkzFct[line width=2pt,color = red, domain =-3:6]{(-\x-2)*(\x-5)}
\tkzDrawRiemannSumSup[fill=blue!40,opacity=.5,interval=-1:5,number=10]
\tkzDrawRiemannSumInf[fill=green!40,opacity=.5,interval=-1:5,number=10]
\end{tikzpicture}
\end{document}
\documentclass
so that those trying to help don't have to recreate it. Basically show us what you have tried...pgfplots
package, that draws a variety of types of Riemann sums of either fixed width rectangles of any number or of any number of varying width rectangles in conjunction with a defined function. It also has routines for combining them on one graph with appropriate order of overlap. See my answer to Placing Coloured Rectangles on a Plot Using Points From the Plot Riemann Sums