3D Data with ggplot
<p>I have data in the following form:</p>

<pre><code>x &lt;- seq(from = 0.01,to = 1, by = 0.01)
y &lt;- seq(from = 0.01,to = 1, by = 0.01)

xAxis &lt;- x/(1+x*y)
yAxis &lt;- x/(1+x*y)

z &lt;- (0.9-xAxis)^2 + (0.5-yAxis)^2

df &lt;- expand.grid(x,y)
xAxis &lt;- df$Var1/(1+df$Var1*df$Var2)
yAxis &lt;- df$Var2/(1+df$Var1*df$Var2)

df$x &lt;- xAxis
df$y &lt;- yAxis
df$z &lt;- z
</code></pre>

<p>I would like to plot te (x,y,z) data as a surface and contour plots, possibily interpolating data to obtain as smooth a figure as possible.</p>

<p>Searching I reached the <code>akima</code> package which does the interpolation:</p>

<pre><code>im &lt;- with(df,interp(x,y,z))
</code></pre>

<p>I am having trouble plotting the data with this output. Ideally I would like to use ggplot2 since I want to add stuff to the original plot.</p>

<p>Thanks!</p>