TeX - LaTeX Asked on May 19, 2021
When trying to answer How to delete a part of a curve in Tikz? , I ran into problems with intersection segments
from PGFPlots fillbetween
.
I tried to change the curve from to[out=280,in=175]
to control points, and several other thing. I always get the same result:
What am I doing wrong?
documentclass[tikz, border=1cm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=newest}
usepgfplotslibrary{fillbetween}
begin{document}
begin{tikzpicture}
draw[name path=curve] (0.3,5) to[out=280,in=175, looseness=0.92] (5.5,0.5); %a curve
%draw[name path=curve] (0.3,5) .. controls (1,1) and (2,0) .. (5.5,0.5); %alternative curve
draw[name path=line] (0,4.1) -- (4.1,0);
draw[red, ultra thick, opacity=0.5, smooth, intersection segments={of=curve and line, sequence={L1}}];
pgfgetlastxy{XCoord}{YCoord}
draw (XCoord,YCoord) circle (1pt);
draw[green, ultra thick, opacity=0.5, smooth, intersection segments={of=curve and line, sequence={L2}}];
pgfgetlastxy{XCoord}{YCoord}
draw (XCoord,YCoord) circle (1pt);
draw[blue, ultra thick, opacity=0.5, smooth, intersection segments={of=curve and line, sequence={L3}}];
pgfgetlastxy{XCoord}{YCoord}
draw (XCoord,YCoord) circle (1pt);
end{tikzpicture}
end{document}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP