Im drawing a temperature profile for a given body of water:
\begin{tikzpicture}[scale=0.3]
\draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]};
\draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]};
\foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};}
\foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};}
\draw (6,-20) .. controls (6,-4) and (17,-6) .. (17.5,0);
\end{tikzpicture}
From here I would like to copy the profile i.e. the curved line where the temperature at depth is increased as +2 degC and -2degC but where the surface of the water remains the same. For example:
\begin{tikzpicture}[scale=0.3]
\draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]};
\draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]};
\foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};}
\foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};}
\draw (6,-20) .. controls (6,-4) and (17,-6) .. (17.5,0);
\draw[dashed,red](8,-20) .. controls (8,-4) and (17,-6) .. (17.5,0);
\draw[dashed,blue] (4,-20) .. controls (4,-4) and (17,-6) .. (17.5,0);
\end{tikzpicture}
This will generate two additional curved lines, the problem here is that the temperatures do not differ by the amount specified all the way down the profile i.e. the difference between the lines are 2degC at the bottom but up to a depth of 10 m they linearly increase to 2degC. I realise this problem is probably due to the number of control points used, but I can't seem to solve the problem.
amended: working example
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc,shapes,arrows,snakes,shapes.geometric,patterns}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[scale=0.3]
\draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]}; % draw xaxis for the diagram
\draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]}; % draw yaxis
\foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};} % temperatures for graph
\foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};} % depth for graph
\draw (6,-20) .. controls (6,-4) and (17,-6) .. (17.5,0); % draw temperature profile i.e. curved line
\draw[dashed,red](8,-20) .. controls (8,-4) and (17,-6) .. (17.5,0); % temp profile = 1degC
\draw[dashed,blue] (4,-20) .. controls (4,-4) and (17,-6) .. (17.5,0); % draw new temperature profile
\end{tikzpicture}
\end{figure}
\end{document}
producing:

From here, you can see that at the lowe depths the difference between the curves lines is not as specified. I would like to generate the graph where the three lines are the same at depth = 0m but thereafter they vary by 2degC. How could I do this?




\documentclass. Also, it would help if you posted a screenshot indicating what is wrong as it's not completely clear to me from your description. Are the17and17.5s at the ends of your curves typos? Should the red dashed curve end at15.5and the blue one at19.5? If so, your lines are always separated by 2 degrees horizontally so I'm not sure what you're looking for. – Andrew Stacey Feb 26 at 13:53