TeX - LaTeX Asked by G. Fougeron on April 9, 2021
I am using the package hobby for the first time, and it seems to me that using named nodes instead of coordinates is not supported. In particular, why do the following MWEs produce two different pictures ?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{hobby}
begin{document}
begin{tikzpicture}
draw[help lines] (0,0) grid[step=0.25] (1,1);
draw
(0,0) to [curve through={
(0.15,0.35) ..
(0.5,0.5) ..
(0.8,0.6) } ]
(1,1);
end{tikzpicture}
begin{tikzpicture}
node (n1) at (0,0) {};
node (n2) at (0.15,0.35){};
node (n3) at (0.5,0.5){};
node (n4) at (0.8,0.6){};
node (n5) at (1,1){};
draw[help lines] (0,0) grid[step=0.25] (1,1);
draw
(n1) to [curve through={
(n2) ..
(n3) ..
(n4) } ]
(n5);
end{tikzpicture}
end{document}
nodes are not coordinates! they have non zero size, so the lines between them is discontinued. as work around you have two possibilities:
draw
(n1.center) to [curve through={
(n2.center) ..
(n3.center) ..
(n4.center) } ]
(n5.center);
coordinate (n1) at (0,0);
coordinate (n2) at (0.15,0.35);
coordinate (n3) at (0.5,0.5);
coordinate (n4) at (0.8,0.6);
coordinate (n5) at (1,1);
in both cases you will get the same result:
Correct answer by Zarko on April 9, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP