# Fill area in tikzpicture

Can somebody help? The fill area is not symmetric. The goal is to be symmetric.

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{zzttqq}{rgb}{0.6,0.2,0.0}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw[->,color=black] (-4.0,0.0) -- (4.0,0.0);
\foreach \x in {-4.0,-3.0,-2.0,-1.0,1.0,2.0,3.0}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.0,-0.5) -- (0.0,5.5);
\foreach \y in {,1.0,2.0,3.0,4.0,5.0}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\clip(-4.0,-0.5) rectangle (4.0,5.5);
\draw[color=zzttqq,fill=zzttqq,fill opacity=0.1, smooth,samples=50,domain=-2.0:2.0] plot(\x,{(\x/2.0)^(4.0)-\x^(2.0)+5.0}) -- (2.0,0.0) -- (-2.0,0.0) -- cycle;
\draw[smooth,samples=100,domain=-4.0:4.0] plot(\x,{((\x)/2.0)^(4.0)-(\x)^(2.0)+5.0});
\begin{scriptsize}
\draw[color=black] (-4.140000000000001,6.140000000000001) node {$f$};
\end{scriptsize}
\end{tikzpicture}
\end{document}


-
Welcome to TeX.SX! No need to sign with your name since it automatically appears in the lower right corner of your post. – Claudio Fiandrino Sep 4 '14 at 13:08
You need to use (\x)^(2.0) instead of \x^(2.0). See How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot? – Jake Sep 4 '14 at 13:11

Jake's comment should have solved your problem. This is to show you another method.

This can be done with pgfplots and it is very easy.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11,width=4in}
\definecolor{zzttqq}{rgb}{0.6,0.2,0.0}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin=-5,
xmax=5,
ymin=0,
ymax=6,
xlabel=$t$,
ylabel=$v$,
xtick={-4,...,4},
ytick={1,...,5},
]
\end{axis}
\end{tikzpicture}

\end{document}


This uses fillbetween library of pgfplots:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11,width=4in}
\definecolor{zzttqq}{rgb}{0.6,0.2,0.0}
\usepgfplotslibrary{fillbetween}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin=-5,
xmax=5,
ymin=0,
ymax=6,
xlabel=$t$,
ylabel=$v$,
xtick={-4,...,4},
ytick={1,...,5},
]