# Creating a circular shade with an intermediate color

I need to draw a circle that represents a density that's constant up to a certain value of radius, then begins to descend. What I mean, is something like this:

\documentclass[12pt]{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\draw [fill=lightgray] (0,4) circle (1cm);

\draw[->] [very thick] (0,0) -> (0,2);
\draw[->] [very thick] (0,0) -> (3,0);

\draw [dotted] (0,2) -> (0,4);
\draw [dotted] (1,0) -> (1,4);
\draw [dotted] (2,0) -> (2,4);

\draw [thick] (0,.25) -- (1,.25) -- (1,1.35) --
(1.25,1.35) .. controls (1.625,1.35)
and (1.625,0) .. (2,0);

\draw (-.2,1.7) node {$\rho$};
\draw (1,-.2) node {$R_{in}$};
\draw (2,-.2) node {$R_{out}$};
\draw (3.1,-.2) node {$R$};

\end{tikzpicture}

\end{document}


Which produces this:

What I want is this:

Notice how the line of the circle matches the shade's starting color. I though I could do this by setting an "intermediate color" for the shade, but this option doesn't seem to exist.

Ideally the shade should follow closely the plot in the bottom of the first figure, but I consider that as a bonus.

-
See these answers tex.stackexchange.com/questions/82425/… –  percusse Dec 2 '12 at 15:23

\documentclass[12pt]{article}

\usepackage{tikz}

%Code from Paul Gabroit -- http://tex.stackexchange.com/a/82503/11232
%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzset{
ring shading/.code args={from #1 at #2 to #3 at #4}{
\def\colin{#1}
\def\colout{#3}
\pgfmathsetmacro{\outer}{.8818cm}
\pgfmathsetmacro{\inner}{.8818cm*\proportion}
\pgfmathsetmacro{\innerlow}{\inner-0.01pt}
{
color(0pt)=(white);
color(\innerlow)=(white);
color(\inner)=(#1);
color(\outer)=(#3)
}
},
}
%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{tikzpicture}
(0,4) circle (2) ;
\draw [fill=lightgray] (0,4) circle (1cm);

\draw[->] [very thick] (0,0) -> (0,2);
\draw[->] [very thick] (0,0) -> (3,0);

\draw [dotted] (0,2) -> (0,4);
\draw [dotted] (1,0) -> (1,4);
\draw [dotted] (2,0) -> (2,4);

\draw [thick] (0,.25) -- (1,.25) -- (1,1.35) --
(1.25,1.35) .. controls (1.625,1.35)
and (1.625,0) .. (2,0);

\draw (-.2,1.7) node {$\rho$};
\draw (1,-.2) node {$R_{in}$};
\draw (2,-.2) node {$R_{out}$};
\draw (3.1,-.2) node {$R$};

\end{tikzpicture}

\end{document}


-
Precisely what I needed, thank you. –  Francisco Dec 2 '12 at 16:28