[Tex/LaTex] Tikz functions and coordinate system: Adding points and labels

labelsplottikz-pgf

I managed to adjust some of the existing code a little bit to fit my needs. I can plot simple functions.

(1) I want to add labels to the coordinate system, for example e (~ 2.71) to the x-axes and 1/e.

(2) Furthermore I like to label special points on the function graphs. For example at the coordinate x=e and y=1.

\documentclass[13pt,a4paper,headlines=6,headinclude=true]{scrartcl}

\usepackage{amsmath,amssymb,stmaryrd}       
\usepackage{tikz,pgfplots}
\usetikzlibrary{datavisualization.formats.functions}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{tikzpicture}[yscale=.5, xscale=.5, scale=2]
\datavisualization
[school book axes,
legend={below,rows=1},
visualize as smooth line/.list={f1,f2,f3},
f1={style=blue, style=very thick,label in legend={text=$e^x$}},
f2={style=green, style=very thick,label in legend={text=$ln(x)$}},
f3={style=red, style=very thick,label in legend={text=$x$}}
]
data [set=f1, format=function] {
var x : interval[-5:2];
func y = e^(\value x);
}data [set=f2, format=function] {
var x : interval[0.1:5];
func y = ln(\value x);
}data [set=f3, format=function] {
var x : interval[-3:3];
func y = (\value x);
};
\end{tikzpicture}   


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Thank you 🙂

enter image description here

Best Answer

By adding these lines:

 \draw[shift={(e,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$e$};
 \path[draw=red, dashed] (e,0) -- (e,1);
 \path[draw=red, dashed] (0,1) -- (e,1);
 \node[outer sep=0pt,circle, fill=red,inner sep=1.5pt] (P) at (e,1) {};

I got this: enter image description here

Related Question