Inside the environment axis
I can specify some points with axis cs
. Up to now I am only able to use specific coordinates like 1,1
. But I want to know how to use a mathematical expression like ln(3),2
.
Here is an example:
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{compat=1.4}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis equal image,
width=10cm,
axis lines=middle,
axis line style={-latex},
xtick=\empty,
ytick=\empty,
ymin=-2.5, ymax=2.5,
xmin=-3.4,xmax=3.3,
clip =false,
xlabel={$x$},ylabel={$y$},
every axis x label/.append style={anchor=north},
every axis y label/.append style={anchor=east},
]
\foreach \c in {-2,-1,-0.5,0.5,1,2}
\addplot[domain=-3:3,samples=200,restrict y to domain=-2:2]{ln(\c*x)};
%ln(1*3)1,098612289
\node[anchor=west] at (axis cs:3,1.099) {$c=1$};
%\node[anchor=west] at (axis cs:3,ln(3)) {$c=1$};
\end{axis}
\end{tikzpicture}
\end{document}
At the moment I am using:
%ln(1*3)1,098612289
\node[anchor=west] at (axis cs:3,1.099) {$c=1$};
but I would prefer a more automatic way
\node[anchor=west] at (axis cs:3,ln(3)) {$c=1$};
Best Answer
You can say
Not exactly the same, but I guess that performing complex calculations when looking for coordinates is not easy.