Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\begin{tikzpicture} 
    \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$};
\end{tikzpicture}

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

1 Answer 1

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.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture} 
\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};
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Please see the pgfplots manual for a lot more.

share|improve this answer

Your Answer

 
discard

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.