I am working on recreating an image of an heat equation as shown below
I have mostly been successful, however I am still not sure how to add the squiggly lines. Is there also an easier way to make sure the labels 1
,0
,and 1
, are properly aligned? In the figure they have the same baseline, but in my graph they vary.
Any other improvements or ways to create the displayed image are appreciated as always
Code
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\definecolor{UiT-main}{HTML}{003349}
\definecolor{UiT-blue}{HTML}{007396}
\definecolor{UiT-red}{HTML}{CB333B}
\begin{document}
\begin{tikzpicture}
\def\xmax{2}\def\ymax{2}
% Shade the box
\shade[top color=white,bottom color=UiT-blue] (0,0) rectangle (\xmax,\ymax);
% Draw the border of the box and add labels
\draw [color=UiT-blue]
(0,0) -- (\xmax,0) node [pos=0.5,label=below:{\color{UiT-red}$u=g$}]{}
(\xmax,0) -- (\xmax,\ymax) node [pos=0.5,label=right:{\color{UiT-red}$u=0$}]{}
(\xmax,\ymax) -- (0,\ymax) node [pos=0.5,label=above:{\color{UiT-red}$u=0$}]{}
(0,\ymax) -- (0,0) node [pos=0.5,label= left:{\color{UiT-red}$u=0$}]{};
% Add the S in the centre
\path (0,\ymax) -- (\xmax,0) node [pos=0.5]{$S$};
% Draw the axis
\draw[thick,-stealth] (-1,0) -- (.5+\xmax,0) node[anchor= west] {$x$};
\draw[thick,-stealth] (0,-0.5) -- (0,.5+\ymax) node[anchor=south east] {$y$};
% Label the axis
\node[below left] (0,0) {$0$};
\node[label=left:{$1$}] (s2) at (0,\ymax) {};
\node[label=below:{$1$}] (s4) at (\xmax,0) {};
\end{tikzpicture}
\end{document}
\draw (0,0) to[out=90, in=-90] (1,1);
. – Skillmon Aug 12 at 12:38pin
and redefine pin on way as is described in 17.10.3 The Pin Option in TikZ & PGFmanula, pp 249 (v 3.1.4b) – Zarko Aug 12 at 12:48