Skip to content

Instantly share code, notes, and snippets.

@windstriver
Created August 29, 2015 02:44
Show Gist options
  • Save windstriver/7f69185798bba35ce39e to your computer and use it in GitHub Desktop.
Save windstriver/7f69185798bba35ce39e to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[scale=2]
\shade[top color=blue,bottom color=gray!50] (0,0) parabola (1.5,2.25) |- (0,0);
\draw (1.05cm,2pt) node[above] {$\displaystyle\int_0^{3/2}\!\!x^2\mathrm{d}x$};
\draw[help lines] (0,0) grid (3.9,3.9)
[step=0.25cm] (1,2) grid +(1,1);
\draw[-Stealth] (-0.2,0) -- (4,0) node[right] {$x$};
\draw[-Stealth] (0,-0.2) -- (0,4) node[above] {$f(x)$};
\draw (0,0) node [below left] {$O$};
\foreach \x/\xtext in {1/1, 1.5/1\frac{1}{2}, 2/2, 3/3}
\draw[shift={(\x,0)}] (0pt,2pt) -- (0pt, -2pt) node[below] {$\xtext$};
\foreach \y/\ytext in {1/1, 2/2, 2.25/2\frac{1}{4}, 3/3}
\draw[shift={(0,\y)}] (2pt,0) -- (-2pt, 0) node[left] {$\ytext$};
\draw (-0.5,0.25) parabola bend (0,0) (2,4) node[below right] {$f(x)=x^2$};
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment