I have a file of data, data.dat. I am using filecontents to import the data and make plots. Consider the following very small snippet:
n m data1 data2
2 2 900.00 981.00
2 3 600.40 675.00
2 4 450.12 428.01
2 5 360.50 534.98
3 2 225.00 219.80
3 3 150.00 140.00
3 4 112.50 111.00
3 5 90.00 98.00
This is a snippet of the actual length of the data. I would like to make a contour plot of data1 which is easily done using this example from PGFPlots.net. However, similar to this example, I would like to add a projection of the surf plots onto the xz-plane and yz-planes.
Unlike the example, there is not an equation to define the distribution onto these axes. How could this be done? The MWE is shown below. I want to change this to a contour plot similar to this.
MWE
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{colorbrewer}
\usepackage{colorbrewer}
\usepackage{sfmath}
\usepackage{filecontents}
\begin{document}
\pgfplotsset{
colormap={whitered}{color(0cm)=(white); color(1cm)=(orange!75!red)}}
\pgfplotstableread{StretchingResultsQCRB.dat}{\stretch}
\begin{tikzpicture}
\begin{axis}[width=\columnwidth,
height=0.618\columnwidth,
xmin=2,
xlabel={$x$},
ylabel={$y$},
zlabel={$P(x,y)$},
xlabel style = {font=\Large, yshift=1ex},
ylabel style = {font=\Large, yshift=1ex},
zlabel style = {font=\Large, yshift=-1ex},
zmode=log,
ymin=1,
view={20}{50},
axis line style={line width=1pt},
colormap name=whitered,
colorbar,
colorbar style={
at={(1,0)},
anchor=south west,
height=0.25*\pgfkeysvalueof{/pgfplots/parent axis height},
%title={$P(x_1,x_2)$}
}
]
\addplot3[surf, line width=0.8pt] table [x={n}, y={m}, z={QCRBa0.5}] {\stretch};
\end{axis}
\end{tikzpicture}
\end{document}