TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope, someone can help me. I've the following problem:

I want to draw a Graph like this exp Problem

The picture shows the following graphs: exp(x), ln(x), x

my code is:

    \draw[ultra thin,color=gray] (-0.1,-0.1) grid (5,5);
    \draw[->] (-0.2,0) -- (5.2,0) node[below] {$x$}; 
    \draw[->] (0,-0.2) -- (0,5.2) node[above] {$y$};

    \draw (0,0)--(5,5);

    \draw[color=blue, samples=150, thick, domain=0:1.6095]   
            plot (\x,{exp(\x r)}) node[right] {$f(x) = exp x$};
    \draw[color=cyan, samples=150, thick, domain=1:5]
            plot (\x,{ln(\x r)}) node[right] {$f(x) = ln x$};

My LaTeX Compliler throws me the follwoing message:

plot (\x,{exp(\x r)})

node[right] {$f(x) = exp x$}; I can't work with sizes bigger than about 19 feet. Continue and I'll use the

largest value I can.

The Domain Value for exp(x) is 1.6095 because exp(1.6095) = 5

I hope, you can help me.

share|improve this question

migrated from stackoverflow.com May 5 '12 at 12:57

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner May 5 '12 at 14:25
up vote 2 down vote accepted

In your question title it mentions pgfplots but you don't use it. And if you don't use r(radian) indicator everything runs smoothly. I'll take the easy way out by just giving a simple pgfplots example.

\begin{axis}[xmin=-0.5,xmax=5,ymin=-0.5,ymax=5,no markers,samples=50,grid=both]
\addplot {exp(x)};
\addplot {ln(x)};
\addplot {x};

enter image description here

Please see the pgfplots manual for a lot more.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.