Drawing Rotated Surrounding RectangleRotate a node but not its content: the case of the ellipse decorationReuse of soft path in fading declaration? Transformation of fadings?How to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideAdjusting edge alignment and positioning of fitted nodeRelative transparency in TikZ?Line up nested tikz enviroments or how to get rid of themDrawing a Decision Diagram with Tikz and layout managerDrawing surrounding rectangle
What was the point of "Substance"?
Does NASA use any type of office/groupware software and which is that?
How can I download a file from a host I can only SSH to through another host?
How to determine algebraically whether an equation has an infinite solutions or not?
Shift lens vs move body?
Is a Centaur PC considered an animal when calculating carrying capacity for vehicles?
Why does this London Underground poster from 1924 have a Star of David atop a Christmas tree?
Is the Amazon rainforest the "world's lungs"?
Is the internet in Madagascar faster than in UK?
Why is explainability not one of the criteria for publication?
What is the name of this plot that has rows with two connected dots?
Dotted background on a flowchart
How many petaflops does it take to land on the moon? What does Artemis need with an Aitken?
Why does a sticker slowly peel off, but if it is pulled quickly it tears?
Recommended Breathing Exercises to Play Woodwinds
Force SQL Server to use fragmented indexes?
Fantasy Macro Economics: What would Merfolk Trade?
助けてくれて有難う meaning and usage
Count the number of triangles
What is Soda Fountain Etiquette?
If I said I had $100 when asked, but I actually had $200, would I be lying by omission?
Why did James Cameron decide to give Alita big eyes?
What to do about my 1-month-old boy peeing through diapers?
How to force GCC to assume that a floating-point expression is non-negative?
Drawing Rotated Surrounding Rectangle
Rotate a node but not its content: the case of the ellipse decorationReuse of soft path in fading declaration? Transformation of fadings?How to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideAdjusting edge alignment and positioning of fitted nodeRelative transparency in TikZ?Line up nested tikz enviroments or how to get rid of themDrawing a Decision Diagram with Tikz and layout managerDrawing surrounding rectangle
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like the rectangle surrounding the nodes C_32 and C_23 to just encompass these nodes like C_12 and C_22
My code is as follows: I have managed to rotate the rectangle but the rectangle overfits
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, fit=(v8)(v12), rotate fit=45, inner sep = 12pt] ;
endtikzpicture
enddocument
tikz-pgf
add a comment |
I would like the rectangle surrounding the nodes C_32 and C_23 to just encompass these nodes like C_12 and C_22
My code is as follows: I have managed to rotate the rectangle but the rectangle overfits
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, fit=(v8)(v12), rotate fit=45, inner sep = 12pt] ;
endtikzpicture
enddocument
tikz-pgf
add a comment |
I would like the rectangle surrounding the nodes C_32 and C_23 to just encompass these nodes like C_12 and C_22
My code is as follows: I have managed to rotate the rectangle but the rectangle overfits
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, fit=(v8)(v12), rotate fit=45, inner sep = 12pt] ;
endtikzpicture
enddocument
tikz-pgf
I would like the rectangle surrounding the nodes C_32 and C_23 to just encompass these nodes like C_12 and C_22
My code is as follows: I have managed to rotate the rectangle but the rectangle overfits
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, fit=(v8)(v12), rotate fit=45, inner sep = 12pt] ;
endtikzpicture
enddocument
tikz-pgf
tikz-pgf
edited Aug 15 at 8:30
Bernard
189k7 gold badges86 silver badges224 bronze badges
189k7 gold badges86 silver badges224 bronze badges
asked Aug 15 at 6:38
kauraykauray
1554 bronze badges
1554 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The order matters. You have to mention rotate fit=<angle>
before fit=<coordinates>
.
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
The complete code:
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
endtikzpicture
enddocument
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%2f504276%2fdrawing-rotated-surrounding-rectangle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The order matters. You have to mention rotate fit=<angle>
before fit=<coordinates>
.
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
The complete code:
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
endtikzpicture
enddocument
add a comment |
The order matters. You have to mention rotate fit=<angle>
before fit=<coordinates>
.
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
The complete code:
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
endtikzpicture
enddocument
add a comment |
The order matters. You have to mention rotate fit=<angle>
before fit=<coordinates>
.
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
The complete code:
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
endtikzpicture
enddocument
The order matters. You have to mention rotate fit=<angle>
before fit=<coordinates>
.
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
The complete code:
documentclassarticle
pagestyleempty
usepackagetikz
usetikzlibraryfit
usetikzlibrarypatterns
tikzset
vertex/.style=
fill,
shape=circle,
node distance=80pt,
edge/.style=
fill,
opacity=.2,
fill opacity=.5,
line cap=round,
line join=round,
line width=20pt,
elabel/.style=
fill,
shape=circle,
node distance=30pt,
opacity = .2
pgfdeclarelayerbackground
pgfsetlayersbackground,main
begindocument
begintikzpicture
beginpgfonlayerbackground
%Task T1
node[vertex,label=[font = Large]above:(C_11, $30)] (v1) ;
node[vertex,right of=v1,label=[font = Large]above:(C_12, $10)] (v2) ;
node[vertex,right of=v2,label=[font = Large]above:(C_13, $25)] (v3) ;
node[vertex,right of=v3,label=[font = Large]above:(C_14, $15)] (v4) ;
node[vertex,right of=v4,label=[font = Large]above:(C_15, $15)] (v5) ;
%Task T2
node[vertex,below of=v1,label=[font = Large]above:(C_21)] (v6) ;
node[vertex,right of=v6,label=[font = Large]above:(C_22, $10)] (v7) ;
node[vertex,right of=v7,label=[font = Large]above:(C_23, $15)] (v8) ;
node[vertex,right of=v8,label=[font = Large]above:(C_24, $20)] (v9) ;
node[vertex,right of=v9,label=[font = Large]above:(C_25, $15)] (v10) ;
%Task T3
node[vertex,below of=v6,label=[font = Large]above:(C_31)] (v11) ;
node[vertex,right of=v11,label=[font = Large]above:(C_32, $15)] (v12) ;
node[vertex,right of=v12,label=[font = Large]above:(C_33, $15)] (v13) ;
node[vertex,right of=v13,label=[font = Large]above:(C_34, $15)] (v14) ;
%Edges
draw[edge,color=green] (v6) -- (v11);
draw[edge,color=blue] (v2) -- (v7);
draw[edge,color=violet] (v8) -- (v12);
draw[edge,color=cyan] (v4) -- (v9) -- (v13);
draw[edge,color=orange] (v5) -- (v10) -- (v14);
endpgfonlayer
%Labels
node[elabel,color=green,label=right:($50)] (e1) at (0,-7) ;
node[elabel, color=blue,label=right:($15)] (e2) at (1.5, -7) ;
node[elabel,color=violet,label=right:($15)] (e3) at (3,-7) ;
node[elabel,color=cyan,label=right:($40)] (e4) at (4.5, -7) ;
node[elabel,color=orange, label=right:($30)] (e5) at (6.0,-7) ;
%Task nodes
node[left of=v1,label=[font = Large]above:Task ( T_1), rotate = 90] (t1) ;
node[left of=v6,label=[font = Large]above:Task (T_2), rotate = 90] (t2) ;
node[left of=v11,label=[font = Large]above:Task (T_3), rotate = 90] (t3) ;
%draw (-1,1.2) rectangle (1,-9.8);
node [draw, fit=(v1)(v5), inner sep=28pt] ;
node [draw, fit=(v6)(v10), inner sep=28pt] ;
node [draw, fit=(v11)(v14), inner sep=28pt] ;
%Edge Composition Constraint
node [draw, fit=(v2)(v7), inner sep=20pt] ;
node [draw, rotate fit=45, fit=(v8)(v12), inner sep = 12pt] ;
endtikzpicture
enddocument
answered Aug 15 at 7:04
nidhinnidhin
4,6221 gold badge10 silver badges27 bronze badges
4,6221 gold badge10 silver badges27 bronze badges
add a comment |
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%2f504276%2fdrawing-rotated-surrounding-rectangle%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