[Tex/LaTex] Mexican hat in TikZ


How would we typeset a “mexican hat” like the following

mexican hat

in TikZ?

Best Answer

Well the top of the hat looks like a statistical normal distribution. So I would plot that function. Furthermore you could use an arc for the upper part of the hat. And at last you could use a curve for the lower part of the hat. I have tried producing the hat with the following code:

\draw[very thick,domain=-1.5:1.5,xscale=0.5,smooth,variable=\x] plot ({\x},{(1.3*2.718281828^(-0.5*\x*\x))});
\draw[very thick] (0,-0 cm) arc (-90:70:1.5 cm and 0.4 cm);
\draw[very thick] (0,-0 cm) arc (270:110:1.5 cm and 0.4 cm);
\begin{scope}[yshift=0.4 cm]
\draw[very thick] (-10 : -1.5 cm and 0.4 cm) .. controls (-1.25,-0.8) and (1.25,-0.8) .. (-170 : -1.5 cm and 0.4 cm);

I agree it's not perfect, but feel free to improve. :D