# How to plot just part of the function with pgfplots, gnuplot

I have the following code.

\begin{tikzpicture}
\begin{axis}[domain = -2:2
,y domain = -2:2,view={0}{90}]

{0.5*exp(-0.2*abs(x)-0.2*abs(y))};
\end{axis}
\end{tikzpicture}


But I'd like it to plot just the area inside a circle x^2+y^2 < 1 Any Idea?

-
Why not a simple circle filled? –  percusse Feb 10 '13 at 2:19
@percuße I want it to be filled by the mentioned contour. How? –  batista cori Feb 10 '13 at 2:21
Do you mean clipping with a circle or a circle under these countours? –  percusse Feb 10 '13 at 2:23
@percuße clipping with a circle. –  batista cori Feb 10 '13 at 2:24

I can't see where that extra 3.5 scaling factor comes from but this should be robust to scaling and other shifts etc.

Edit : the clipping path can be much simplified thanks to Christian's correction.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain = -2:2,y domain = -2:2,view={0}{90},grid=both]
\pgfplotsextra{%
\clip (axis cs:0,0) circle (1 and 1);
}

If you omit units after the circle path, the radii will be interpreted as (pgfplots!) axis units: \clip ... circle (1 and 1); . Note furthermore that \pgfplotsextra is the correct choice, but is is inserted automatically if you omit it. –  Christian Feuersänger Feb 10 '13 at 16:15