TikZ doesn't find all intersections between plot and a line
Why doesn't TikZ find all intersections. They are obviously there …
\documentclass[border=10mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[point/.style={fill=blue,minimum size=1mm,inner
sep=0pt,circle}]
% Variablen
%% Zoom
\def\yzoom{100}
% Achsen
\draw [<->] (0,0.085*\yzoom) node [right] {$P$} |- (10.3,0) node
[above] {$v$};
% Graphen
\foreach \T/\xmin/\a in {%
0.27/1.538/a,
0.28/1.590/b,
0.29/1.649/c
} {
\draw [thin,name path global/.expanded={kurve \a}]
plot [raw gnuplot] function {%
set xrange [\xmin:10];
set yrange [0:0.08*\yzoom];
set samples 1000;
f(x) = \yzoom*(\T/(x-1) - 1/(x**2));
plot f(x);
};
}
% Linien
\foreach \pI/\pII/\a in {%
%% T = 0.27
0.0184/0.0278/a,
%% T = 0.28
0.0263/0.0308/b,
%% T = 0.29
0.0333/0.0343/c
}{
\pgfmathsetmacro\p{\pI+(\pII-\pI)/2}
\draw [red,thin,name path global/.expanded={linie \a}]
(0,\p*\yzoom) -- (10,\p*\yzoom) node [fill=white,pos=0.1] {\a};
}
\path [name intersections={of=kurve a and linie a,by={P1,P2}}]
(P1) node [point] {} (P2) node [point] {};
\path [name intersections={of=kurve b and linie b,by={P1,P2}}]
(P1) node [point] {} (P2) node [point] {};
\path [name intersections={of=kurve c and linie c,by={P1,P2}}]
(P1) node [point] {} (P2) node [point] {};
\end{tikzpicture}
\end{document}
There seems to be no problem with the names of the paths but TikZ is
missing four intersection points.
Bonus question: Is it possible to solve the last part (adding blue points)
with the second \foreach? I tried it but I get the error File ended while
scanning use of \tikz@intersect@path@names@parse..
No comments:
Post a Comment