What is the meaning of option 'by' in TikZ Intersections

Multi tool use
Pg 65 of the PGF Manual, shows different operations with the intersections
library in TikZ. But I am not able to understand the code. What is the meaning of the option by
here.
The explanation given is:
The name intersections takes an optional argument
by, which lets you specify names for the coordinates and options for them. This creates more compact code.
This is not clear.
tikz-pgf intersections
|
show 2 more comments
Pg 65 of the PGF Manual, shows different operations with the intersections
library in TikZ. But I am not able to understand the code. What is the meaning of the option by
here.
The explanation given is:
The name intersections takes an optional argument
by, which lets you specify names for the coordinates and options for them. This creates more compact code.
This is not clear.
tikz-pgf intersections
1
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
1
If you do not use theby
option, then name of the intersection will be(intersection-1)
etc.by=...
lets you name the intersection in a more convenient manner.
– daleif
1 hour ago
@koleygr do you have any examples of theand options for them
part?
– daleif
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
3
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, orfill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).
– Zarko
1 hour ago
|
show 2 more comments
Pg 65 of the PGF Manual, shows different operations with the intersections
library in TikZ. But I am not able to understand the code. What is the meaning of the option by
here.
The explanation given is:
The name intersections takes an optional argument
by, which lets you specify names for the coordinates and options for them. This creates more compact code.
This is not clear.
tikz-pgf intersections
Pg 65 of the PGF Manual, shows different operations with the intersections
library in TikZ. But I am not able to understand the code. What is the meaning of the option by
here.
The explanation given is:
The name intersections takes an optional argument
by, which lets you specify names for the coordinates and options for them. This creates more compact code.
This is not clear.
tikz-pgf intersections
tikz-pgf intersections
edited 1 hour ago
subham soni
asked 1 hour ago
subham sonisubham soni
4,09882981
4,09882981
1
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
1
If you do not use theby
option, then name of the intersection will be(intersection-1)
etc.by=...
lets you name the intersection in a more convenient manner.
– daleif
1 hour ago
@koleygr do you have any examples of theand options for them
part?
– daleif
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
3
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, orfill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).
– Zarko
1 hour ago
|
show 2 more comments
1
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
1
If you do not use theby
option, then name of the intersection will be(intersection-1)
etc.by=...
lets you name the intersection in a more convenient manner.
– daleif
1 hour ago
@koleygr do you have any examples of theand options for them
part?
– daleif
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
3
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, orfill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).
– Zarko
1 hour ago
1
1
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
1
1
If you do not use the
by
option, then name of the intersection will be (intersection-1)
etc. by=...
lets you name the intersection in a more convenient manner.– daleif
1 hour ago
If you do not use the
by
option, then name of the intersection will be (intersection-1)
etc. by=...
lets you name the intersection in a more convenient manner.– daleif
1 hour ago
@koleygr do you have any examples of the
and options for them
part?– daleif
1 hour ago
@koleygr do you have any examples of the
and options for them
part?– daleif
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
3
3
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, or fill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).– Zarko
1 hour ago
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, or fill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).– Zarko
1 hour ago
|
show 2 more comments
3 Answers
3
active
oldest
votes
The relevant line is
path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
Compare with this simpler version:
path [name intersections={of=D and E, by={C, C’}}];
Here the intersection points are computed and named C and C' ("name the intersection points of D and E by the names C and C'").
It is shortcut for
coordinate (C) at ...;
coordinate (C') at ...;
for some computed coordinates.
Adding the optional styling [label=above:$C$]C
is equivalent to
coordinate[label=above:$C$] (C) at ...;
and allows you to style the intersection point directly. It would be equivalent, though longer, to write
path [name intersections={of=D and E, by={C, C’}}];
node[above] at (C) {$C$};
node[below] at (C') {$C'$};
add a comment |
By default, intersections are named (intersection-1)
, (intersection-2)
, etc.
When you write by={a,b}
the first two intersections will be called (a)
and (b)
.
Let's look at the example on page 142, slightly modified. It displays the 9 intersections of two curves.
The total number of intersections is given by total
.
By writing by={a,b}
, the first 2 intersections now have two names:
(a)
or(intersection-1)
(b)
or(intersection-2)
(a)
is an alias of (intersection-1)
, the others do not have aliases and remain accessibles.
documentclass[border=5mm,tikz]{standalone}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
clip (-2,-2) rectangle (2,2);
draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
foreach s in {1,...,t}{(intersection-s) circle (2pt) node {footnotesizes}};
draw[fill=blue!50,opacity=.5] (a) circle (4pt);
end{tikzpicture}
end{document}
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
|
show 10 more comments
Just for completeness. You can name the intersections by C-1
etc. by just using name=C
. What is perhaps also worth pointing out is that, if you want so sort the intersections along a straight line, then you have to draw the straight line pretending it is a curve.
documentclass{standalone}
usepackage{tikz}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
draw[->, name path=line] (2,1) to[bend left=0] (7,7);
draw[name intersections={of=grid and line, sort by=line, name=C, total=t}]
foreach s in {1,...,t}{(C-s) node {s}};
end{tikzpicture}
end{document}
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478222%2fwhat-is-the-meaning-of-option-by-in-tikz-intersections%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The relevant line is
path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
Compare with this simpler version:
path [name intersections={of=D and E, by={C, C’}}];
Here the intersection points are computed and named C and C' ("name the intersection points of D and E by the names C and C'").
It is shortcut for
coordinate (C) at ...;
coordinate (C') at ...;
for some computed coordinates.
Adding the optional styling [label=above:$C$]C
is equivalent to
coordinate[label=above:$C$] (C) at ...;
and allows you to style the intersection point directly. It would be equivalent, though longer, to write
path [name intersections={of=D and E, by={C, C’}}];
node[above] at (C) {$C$};
node[below] at (C') {$C'$};
add a comment |
The relevant line is
path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
Compare with this simpler version:
path [name intersections={of=D and E, by={C, C’}}];
Here the intersection points are computed and named C and C' ("name the intersection points of D and E by the names C and C'").
It is shortcut for
coordinate (C) at ...;
coordinate (C') at ...;
for some computed coordinates.
Adding the optional styling [label=above:$C$]C
is equivalent to
coordinate[label=above:$C$] (C) at ...;
and allows you to style the intersection point directly. It would be equivalent, though longer, to write
path [name intersections={of=D and E, by={C, C’}}];
node[above] at (C) {$C$};
node[below] at (C') {$C'$};
add a comment |
The relevant line is
path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
Compare with this simpler version:
path [name intersections={of=D and E, by={C, C’}}];
Here the intersection points are computed and named C and C' ("name the intersection points of D and E by the names C and C'").
It is shortcut for
coordinate (C) at ...;
coordinate (C') at ...;
for some computed coordinates.
Adding the optional styling [label=above:$C$]C
is equivalent to
coordinate[label=above:$C$] (C) at ...;
and allows you to style the intersection point directly. It would be equivalent, though longer, to write
path [name intersections={of=D and E, by={C, C’}}];
node[above] at (C) {$C$};
node[below] at (C') {$C'$};
The relevant line is
path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
Compare with this simpler version:
path [name intersections={of=D and E, by={C, C’}}];
Here the intersection points are computed and named C and C' ("name the intersection points of D and E by the names C and C'").
It is shortcut for
coordinate (C) at ...;
coordinate (C') at ...;
for some computed coordinates.
Adding the optional styling [label=above:$C$]C
is equivalent to
coordinate[label=above:$C$] (C) at ...;
and allows you to style the intersection point directly. It would be equivalent, though longer, to write
path [name intersections={of=D and E, by={C, C’}}];
node[above] at (C) {$C$};
node[below] at (C') {$C'$};
answered 1 hour ago
Christoph FringsChristoph Frings
901211
901211
add a comment |
add a comment |
By default, intersections are named (intersection-1)
, (intersection-2)
, etc.
When you write by={a,b}
the first two intersections will be called (a)
and (b)
.
Let's look at the example on page 142, slightly modified. It displays the 9 intersections of two curves.
The total number of intersections is given by total
.
By writing by={a,b}
, the first 2 intersections now have two names:
(a)
or(intersection-1)
(b)
or(intersection-2)
(a)
is an alias of (intersection-1)
, the others do not have aliases and remain accessibles.
documentclass[border=5mm,tikz]{standalone}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
clip (-2,-2) rectangle (2,2);
draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
foreach s in {1,...,t}{(intersection-s) circle (2pt) node {footnotesizes}};
draw[fill=blue!50,opacity=.5] (a) circle (4pt);
end{tikzpicture}
end{document}
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
|
show 10 more comments
By default, intersections are named (intersection-1)
, (intersection-2)
, etc.
When you write by={a,b}
the first two intersections will be called (a)
and (b)
.
Let's look at the example on page 142, slightly modified. It displays the 9 intersections of two curves.
The total number of intersections is given by total
.
By writing by={a,b}
, the first 2 intersections now have two names:
(a)
or(intersection-1)
(b)
or(intersection-2)
(a)
is an alias of (intersection-1)
, the others do not have aliases and remain accessibles.
documentclass[border=5mm,tikz]{standalone}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
clip (-2,-2) rectangle (2,2);
draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
foreach s in {1,...,t}{(intersection-s) circle (2pt) node {footnotesizes}};
draw[fill=blue!50,opacity=.5] (a) circle (4pt);
end{tikzpicture}
end{document}
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
|
show 10 more comments
By default, intersections are named (intersection-1)
, (intersection-2)
, etc.
When you write by={a,b}
the first two intersections will be called (a)
and (b)
.
Let's look at the example on page 142, slightly modified. It displays the 9 intersections of two curves.
The total number of intersections is given by total
.
By writing by={a,b}
, the first 2 intersections now have two names:
(a)
or(intersection-1)
(b)
or(intersection-2)
(a)
is an alias of (intersection-1)
, the others do not have aliases and remain accessibles.
documentclass[border=5mm,tikz]{standalone}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
clip (-2,-2) rectangle (2,2);
draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
foreach s in {1,...,t}{(intersection-s) circle (2pt) node {footnotesizes}};
draw[fill=blue!50,opacity=.5] (a) circle (4pt);
end{tikzpicture}
end{document}
By default, intersections are named (intersection-1)
, (intersection-2)
, etc.
When you write by={a,b}
the first two intersections will be called (a)
and (b)
.
Let's look at the example on page 142, slightly modified. It displays the 9 intersections of two curves.
The total number of intersections is given by total
.
By writing by={a,b}
, the first 2 intersections now have two names:
(a)
or(intersection-1)
(b)
or(intersection-2)
(a)
is an alias of (intersection-1)
, the others do not have aliases and remain accessibles.
documentclass[border=5mm,tikz]{standalone}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
clip (-2,-2) rectangle (2,2);
draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
foreach s in {1,...,t}{(intersection-s) circle (2pt) node {footnotesizes}};
draw[fill=blue!50,opacity=.5] (a) circle (4pt);
end{tikzpicture}
end{document}
answered 1 hour ago
AndréCAndréC
9,98311547
9,98311547
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
|
show 10 more comments
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I was looking for a way to name them like "Ai, total=t" (by using the answer here: tex.stackexchange.com/a/31399/120578) but I couldn't find a way about that "i" counter (This would improve your answer very much)
– koleygr
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I didn't quite understand what you meant. Can you be more explicit?
– AndréC
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
I mean that it would be more useful if we could name all the intersections by using the internal counter of the tikz when finding them: the 1 of (intersection-1), the 2 of (intersection-2) and so on. This way if we could name that counter "i" and could use it while giving name with "by={Ci}" (instead of "by={C1,C2,...,Ct}" where many times t is unknown) we could then use the points as C1, C2, ... Ct... And this would be much better...
– koleygr
1 hour ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
This is a request for code improvement to TikZ developers, at our TikZ user level the only thing we can do is follow the syntax ...
– AndréC
58 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
I said I was looking for something like this and I am not sure (yet) if this can't be done with the existing TikZ code... this is why I was looking to find some similar syntax like this request... But if not I would also agree that this would be a useful feature request.... Anyway you already have my +1...
– koleygr
51 mins ago
|
show 10 more comments
Just for completeness. You can name the intersections by C-1
etc. by just using name=C
. What is perhaps also worth pointing out is that, if you want so sort the intersections along a straight line, then you have to draw the straight line pretending it is a curve.
documentclass{standalone}
usepackage{tikz}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
draw[->, name path=line] (2,1) to[bend left=0] (7,7);
draw[name intersections={of=grid and line, sort by=line, name=C, total=t}]
foreach s in {1,...,t}{(C-s) node {s}};
end{tikzpicture}
end{document}
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
add a comment |
Just for completeness. You can name the intersections by C-1
etc. by just using name=C
. What is perhaps also worth pointing out is that, if you want so sort the intersections along a straight line, then you have to draw the straight line pretending it is a curve.
documentclass{standalone}
usepackage{tikz}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
draw[->, name path=line] (2,1) to[bend left=0] (7,7);
draw[name intersections={of=grid and line, sort by=line, name=C, total=t}]
foreach s in {1,...,t}{(C-s) node {s}};
end{tikzpicture}
end{document}
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
add a comment |
Just for completeness. You can name the intersections by C-1
etc. by just using name=C
. What is perhaps also worth pointing out is that, if you want so sort the intersections along a straight line, then you have to draw the straight line pretending it is a curve.
documentclass{standalone}
usepackage{tikz}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
draw[->, name path=line] (2,1) to[bend left=0] (7,7);
draw[name intersections={of=grid and line, sort by=line, name=C, total=t}]
foreach s in {1,...,t}{(C-s) node {s}};
end{tikzpicture}
end{document}
Just for completeness. You can name the intersections by C-1
etc. by just using name=C
. What is perhaps also worth pointing out is that, if you want so sort the intersections along a straight line, then you have to draw the straight line pretending it is a curve.
documentclass{standalone}
usepackage{tikz}
usetikzlibrary{intersections}
begin{document}
begin{tikzpicture}
draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
draw[->, name path=line] (2,1) to[bend left=0] (7,7);
draw[name intersections={of=grid and line, sort by=line, name=C, total=t}]
foreach s in {1,...,t}{(C-s) node {s}};
end{tikzpicture}
end{document}
answered 30 mins ago


marmotmarmot
106k5129242
106k5129242
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
add a comment |
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
1
1
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
Wow! Thanks! Didn't knew that this works like this! Thanks (+1).
– koleygr
12 mins ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478222%2fwhat-is-the-meaning-of-option-by-in-tikz-intersections%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
yi,AYijw 7TDeV4orcEMJuafgVRga3KSx29 6tKy4u1EYV 6yhMR zE16ztBo
1
forget the label and read as "name intersection of D and E by C"... So, C is the name of the intersection of D and E paths.
– koleygr
1 hour ago
1
If you do not use the
by
option, then name of the intersection will be(intersection-1)
etc.by=...
lets you name the intersection in a more convenient manner.– daleif
1 hour ago
@koleygr do you have any examples of the
and options for them
part?– daleif
1 hour ago
@daleif I don't... just tried to give a basic answer to the question but I don't use it often... Do you think that I should delete my comment? Seems somehow clear to me but I am not sure about that
– koleygr
1 hour ago
3
fill [name intersections={of=curve 1 and curve 2, by={a,b,c,d}}]
if exist four intersections, orfill [name intersections={of=curve 1 and curve 2, name=i, total=t}]
. see tikz & pgf manual, page 142 (version 3.1).– Zarko
1 hour ago