I know that my effort below can be improved upon considerably. In particular, there must be a way of shading the region in a single scope, as opposed to subdividing as I have done (thus necessitating a hidden gray boundary). Neither am I fond of sample points, but this is where my research has led me. Your constructive criticism is appreciated.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%graph
\draw[draw=gray!50!white,fill=gray!50!white]
plot[smooth,samples=100,domain=0:1] (\x,{0}) --
plot[smooth,samples=100,domain=1:0] (\x,{1});
\draw[fill=gray!50!white] plot[smooth,samples=100,domain=1:2.71828] (\x,{ln(\x)}) --
plot[smooth,samples=100,domain=2.71828:1] (\x,{1});
\draw[domain=0:4] plot (\x,{1});
\draw[samples=100,domain=.25:4] plot (\x,{ln(\x)}) node[above left]{$y=\ln x$};
%coordinate grid
\draw (-.5,0)--(4.5,0) node[right]{$x$};
\draw (0,-1.5)--(0,2.5) node[above]{$y$};
\foreach \x in {1,2,3,4}
\draw (\x,2pt)--(\x,-2pt) node[below] {$\x$};
\foreach \y/\ytext in {1,2}
\draw (2pt,\y)--(-2pt,\y) node[left] {$\y$};
%labels
\node at (.75,.5) {$\mathcal{D}$};
\end{tikzpicture}
\end{document}






\pstVerb{realtime srand}. – kiss my armpit Nov 11 '13 at 16:30\time * \yearso you can do the same:\pgfmathsetseed{\time*\year}. Of course, you can use any real-time stuff there is. Here I used a fixed one so that the randomized path is in both cases the same (I haven’t saved it as a soft-path), to retrieve the current seed, see\pgfmathstoreseed. – Qrrbrbirlbel Nov 11 '13 at 19:02\path[fill=gray!50] …;.\drawis basically\path[draw=black]. – Qrrbrbirlbel Jun 21 '18 at 22:29