Set outline first and fill colors laterTikZ scaling graphic and adjust node position and keep font sizeTikZ/ERD: node (=Entity) label on the insideTikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Line up nested tikz enviroments or how to get rid of themBeamer tikz uncovering with different fill colorshow to first draw and subsequently fill a given pathTikZ: Rectangle with diagonal fill (two colors)Fill all four quadrants of a circle with different colorsDefining main colors and sub colors
Movie where a boy is transported into the future by an alien spaceship
Does Lightning Network has concept of continuous stream of value?
What happened to all the nuclear material being smuggled after the fall of the USSR?
siunitx error: Invalid numerical input
Does the "6 seconds per round" rule apply to speaking/roleplaying during combat situations?
Etymology of 'calcit(r)are'?
Did thousands of women die every year due to illegal abortions before Roe v. Wade?
Why does VirtualBox crash macOS?
How is it possible that Gollum speaks Westron?
Cause of continuous spectral lines
What LISP compilers and interpreters were available for 8-bit machines?
Through what methods and mechanisms can a multi-material FDM printer operate?
Select items in a list that contain criteria #2
Turing patterns
How do photons get into the eyes?
What do we gain with higher order logics?
Why does Kathryn say this in 12 Monkeys?
Why is the relationship between frequency and pitch exponential?
Implement Homestuck's Catenative Doomsday Dice Cascader
Should I "tell" my exposition or give it through dialogue?
Color text inside lstlisting
When writing an error prompt, should we end the sentence with a exclamation mark or a dot?
When conversion from Integer to Single may lose precision
How do I write "Show, Don't Tell" as an Asperger?
Set outline first and fill colors later
TikZ scaling graphic and adjust node position and keep font sizeTikZ/ERD: node (=Entity) label on the insideTikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Line up nested tikz enviroments or how to get rid of themBeamer tikz uncovering with different fill colorshow to first draw and subsequently fill a given pathTikZ: Rectangle with diagonal fill (two colors)Fill all four quadrants of a circle with different colorsDefining main colors and sub colors
I have the following code
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= (2, 1) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument
The code defines the outline of a tile in the line starting with tikzset{
I want to put this tile at various places and I want to use different colors to fill the tile. The above code is one of the attempts to get this done, which however does not work.
The output I get is the following:

I very recently learnt about the tikzset command (thanks to TeXstackexchange) and have no understanding of it. Can somebody please help me here and also, if possible, suggest a reference.
tikz-pgf
add a comment |
I have the following code
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= (2, 1) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument
The code defines the outline of a tile in the line starting with tikzset{
I want to put this tile at various places and I want to use different colors to fill the tile. The above code is one of the attempts to get this done, which however does not work.
The output I get is the following:

I very recently learnt about the tikzset command (thanks to TeXstackexchange) and have no understanding of it. Can somebody please help me here and also, if possible, suggest a reference.
tikz-pgf
add a comment |
I have the following code
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= (2, 1) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument
The code defines the outline of a tile in the line starting with tikzset{
I want to put this tile at various places and I want to use different colors to fill the tile. The above code is one of the attempts to get this done, which however does not work.
The output I get is the following:

I very recently learnt about the tikzset command (thanks to TeXstackexchange) and have no understanding of it. Can somebody please help me here and also, if possible, suggest a reference.
tikz-pgf
I have the following code
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= (2, 1) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument
The code defines the outline of a tile in the line starting with tikzset{
I want to put this tile at various places and I want to use different colors to fill the tile. The above code is one of the attempts to get this done, which however does not work.
The output I get is the following:

I very recently learnt about the tikzset command (thanks to TeXstackexchange) and have no understanding of it. Can somebody please help me here and also, if possible, suggest a reference.
tikz-pgf
tikz-pgf
asked May 20 at 12:39
caffeinemachinecaffeinemachine
25917
25917
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Just use pic actions.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic=
draw[line width=2mm,pic actions] (0, 0) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument

2
@caffeinemachine I personally preferpic actionsover an argument in the pic in this case because you can then adddashedand/ordraw=redand so on which you cannot do in the same simple way if you use arguments of thepics.
– marmot
May 20 at 12:54
add a comment |
Your pic can have arguments.
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= cycle;
path (0,0) pic myc=red (1,3) pic myc=green (2,6) pic myc=blue;
endtikzpicture
enddocument

Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define newpics. Reading about the key handler and the example on page 264, you will know thatpicis, literally, a kind of style. So you read about.stylekey handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to apic.
– The old JouleV
May 20 at 12:54
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%2f491746%2fset-outline-first-and-fill-colors-later%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just use pic actions.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic=
draw[line width=2mm,pic actions] (0, 0) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument

2
@caffeinemachine I personally preferpic actionsover an argument in the pic in this case because you can then adddashedand/ordraw=redand so on which you cannot do in the same simple way if you use arguments of thepics.
– marmot
May 20 at 12:54
add a comment |
Just use pic actions.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic=
draw[line width=2mm,pic actions] (0, 0) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument

2
@caffeinemachine I personally preferpic actionsover an argument in the pic in this case because you can then adddashedand/ordraw=redand so on which you cannot do in the same simple way if you use arguments of thepics.
– marmot
May 20 at 12:54
add a comment |
Just use pic actions.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic=
draw[line width=2mm,pic actions] (0, 0) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument

Just use pic actions.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic=
draw[line width=2mm,pic actions] (0, 0) -
path (0,0) pic[fill=green] myc (1,3) pic[fill=blue] myc (2,6) pic[fill=blue] myc;
endtikzpicture
enddocument

answered May 20 at 12:47
marmotmarmot
132k6166317
132k6166317
2
@caffeinemachine I personally preferpic actionsover an argument in the pic in this case because you can then adddashedand/ordraw=redand so on which you cannot do in the same simple way if you use arguments of thepics.
– marmot
May 20 at 12:54
add a comment |
2
@caffeinemachine I personally preferpic actionsover an argument in the pic in this case because you can then adddashedand/ordraw=redand so on which you cannot do in the same simple way if you use arguments of thepics.
– marmot
May 20 at 12:54
2
2
@caffeinemachine I personally prefer
pic actions over an argument in the pic in this case because you can then add dashed and/or draw=red and so on which you cannot do in the same simple way if you use arguments of the pics.– marmot
May 20 at 12:54
@caffeinemachine I personally prefer
pic actions over an argument in the pic in this case because you can then add dashed and/or draw=red and so on which you cannot do in the same simple way if you use arguments of the pics.– marmot
May 20 at 12:54
add a comment |
Your pic can have arguments.
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= cycle;
path (0,0) pic myc=red (1,3) pic myc=green (2,6) pic myc=blue;
endtikzpicture
enddocument

Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define newpics. Reading about the key handler and the example on page 264, you will know thatpicis, literally, a kind of style. So you read about.stylekey handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to apic.
– The old JouleV
May 20 at 12:54
add a comment |
Your pic can have arguments.
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= cycle;
path (0,0) pic myc=red (1,3) pic myc=green (2,6) pic myc=blue;
endtikzpicture
enddocument

Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define newpics. Reading about the key handler and the example on page 264, you will know thatpicis, literally, a kind of style. So you read about.stylekey handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to apic.
– The old JouleV
May 20 at 12:54
add a comment |
Your pic can have arguments.
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= cycle;
path (0,0) pic myc=red (1,3) pic myc=green (2,6) pic myc=blue;
endtikzpicture
enddocument

Your pic can have arguments.
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.10,
ticks=none
usepgfplotslibraryfillbetween
usetikzlibrarybackgrounds,
calc,
patterns
begindocument
begintikzpicture[scale=4, transform shape]
tikzset
myc/.pic= cycle;
path (0,0) pic myc=red (1,3) pic myc=green (2,6) pic myc=blue;
endtikzpicture
enddocument

edited May 20 at 12:50
answered May 20 at 12:49
The old JouleVThe old JouleV
19.5k43175
19.5k43175
Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define newpics. Reading about the key handler and the example on page 264, you will know thatpicis, literally, a kind of style. So you read about.stylekey handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to apic.
– The old JouleV
May 20 at 12:54
add a comment |
Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define newpics. Reading about the key handler and the example on page 264, you will know thatpicis, literally, a kind of style. So you read about.stylekey handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to apic.
– The old JouleV
May 20 at 12:54
Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
Yeah I looked at the manual. But it's big. Can you tell me under what heading should I look? Thanks.
– caffeinemachine
May 20 at 12:51
2
2
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define new
pics. Reading about the key handler and the example on page 264, you will know that pic is, literally, a kind of style. So you read about .style key handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to a pic.– The old JouleV
May 20 at 12:54
@caffeinemachine Alright, it is in section 18, especially 18.3. It tells you how to define new
pics. Reading about the key handler and the example on page 264, you will know that pic is, literally, a kind of style. So you read about .style key handler in section 87.4.4, page 966, and boom, you know how to add one, or two, or even nine arguments to a pic.– The old JouleV
May 20 at 12:54
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%2f491746%2fset-outline-first-and-fill-colors-later%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