Just a quick question. I'm trying to fill in a parabola shape in tikz. I've managed to make it work horizontally. However, when I do the same method vertically. There's a weird deformity that I can't solve. The image is below!
This is the code to create this image:
\documentclass{article}
\usepackage{hyperref}
\usepackage[usenames,dvipsnames,x11names]{xcolor}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows,snakes,shapes}
\begin{document}
\begin{figure}[h] \label{Interesting_Pic}
\begin{tikzpicture}
\begin{scope}
%Grid and outer layers
\draw[black, very thick] (4,-0.5) rectangle (9,4.5);
\draw[black, very thick] (4.5,0) rectangle (8.5,4);
\draw[step=5mm,black] (4.5,0) grid (8.5,4);
%diagonal lines in corner
\draw[fill=lime] (4,-0.5) -- (4.5,0);
\draw[fill=lime] (4,4.5) -- (4.5,4);
\draw[fill=lime] (9,-0.5) -- (8.5,0);
\draw[fill=lime] (8.5,4) -- (9,4.5);
%Labels lines in corners
\fill[font=\footnotesize]
(4,-0.5) node [left] {$A_{4}$}
(4,4.5) node [left] {$A_{1}$}
(9,-0.5) node [right] {$A_{3}$}
(9,4.5) node [right] {$A_{2}$};
%Draw parabola bends
\draw[bend left,->] (4.5,0) to node [auto] {} (8.5,0);
\draw[bend right,->] (4.5,0) to node [auto] {} (4.5,4);
\draw[bend left,->] (8.5,0) to node [auto] {} (8.5,4);
\draw[bend left,->] (8.5,4) to node [auto] {} (4.5,4);
%Colour in parabola areas
\draw[fill=white] (8.5,0) -- (4.5,0) parabola bend (6.5,0.6) (8.5,0);
\draw[fill=white] (8.5,0) -- (8.5,4) to node (7.1,2) {} (8.5,0);
\draw[fill=white] (4.5,0) parabola bend (5.1,2) (4.5,4) -- (4.5,0);
\draw[fill=white] (4.5,4) -- (8.5,4) parabola bend (6.5,3.4) (4.5,4);
\end{scope}
\end{tikzpicture}
\caption{An interesting diagram...}
\end{figure}
\end{document}
I tried two different methods for the left and right sides, (as seen by the %right side and %left side lines at the bottom) but neither worked correctly.
I am trying to do the same thing that I did with the curves at the top and bottom, but doing the same method inverts the parabola bend (as seen on the left hand side). Does anyone know of a way to make the left and right side the same as the top and bottom?
Cheers! :)
edit: Added entire code, so it will create the image above!
\label
after (or within) the\caption
, otherwise cross references wont work. See e.g. tex.stackexchange.com/questions/32325