Color each edge separately in TikZMultiple color edges in TikZRotate a node but not its content: the case of the ellipse decorationHow to draw arcs linking two points in TikZ?Drawing a square with colored hatched little subsquaresNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionRelative transparency in TikZ?Line up nested tikz enviroments or how to get rid of themDrawing C. elegans germline in TikzHow to scale an angle's label with TikZ?Single-pixel black line along color overlap in TikZ

Why does Central Limit Theorem break down in my simulation?

What is Earthy controling in the ISS cupola?

Why couldn't the separatists legally leave the Republic?

What's the 'present simple' form of the word "нашла́" in 3rd person singular female?

Recommendation letter by significant other if you worked with them professionally?

Is it possible that a question has only two answers?

Why aren't there more Gauls like Obelix?

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

Signed and unsigned numbers

How to draw dashed arc of a circle behind pyramid?

Why does liquid water form when we exhale on a mirror?

Confusion about Complex Continued Fraction

Can I negotiate a patent idea for a raise, under French law?

Plausibility of Mushroom Buildings

Whose blood did Carol Danver's receive, Mar-vell's or Yon-Rogg's in the movie?

Street obstacles in New Zealand

Did Amazon pay $0 in taxes last year?

What is better: yes / no radio, or simple checkbox?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

Why does cron require MTA for logging?

What do you call someone who likes to pick fights?

Why is a very small peak with larger m/z not considered to be the molecular ion?

What problems would a superhuman have who's skin is constantly hot?



Color each edge separately in TikZ


Multiple color edges in TikZRotate a node but not its content: the case of the ellipse decorationHow to draw arcs linking two points in TikZ?Drawing a square with colored hatched little subsquaresNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionRelative transparency in TikZ?Line up nested tikz enviroments or how to get rid of themDrawing C. elegans germline in TikzHow to scale an angle's label with TikZ?Single-pixel black line along color overlap in TikZ













1















I want to color the edge AB with thick blue color and edges AC and BC with thick red color.



Referring to the answer in Multiple color edges in TikZ, one way is to use the clip[draw] command. But, I am not sure how to use in my context, as my shape is a triangle and the triangle is filled with orange color as well.



Expected Result:



enter image description here



Current Result:



enter image description here



The triangle should still have the orange color filled and the edges with the above mentioned color.



Note: This example is from the PGF manual only. Providing the code in the manual is not recommended/appreciated without explanation.



Is there an alternate way to fill a shape instead of using filldraw or draw[fill] command.



MWE:



documentclassarticle
usepackagetikz
usetikzlibrarycalc
usetikzlibrarythrough
usetikzlibraryintersections
begindocument
begintikzpicture[help lines/.style=thin,draw=black!50]
coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
draw[name path=A--B] (A) -- (B);
% draw let p1 = ($(B) - (A)$),
% n2 = veclen(x1,y1)
% in
% (A) circle (n2)
% (B) circle (n2);
node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

%coordinate[label=above:$C$] (C) at (intersection-1); using by instead

draw [name path=C--C',red] (C) -- (C');

path [name intersections=of=A--B and C--C', by=F];
node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

draw[fill=orange!80] (A) -- (B) -- (C) -- cycle;
foreach point in A,B,C
fill [black,opacity=0.5] (point) circle (2pt);
endtikzpicture
enddocument









share|improve this question

















  • 2





    What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

    – leandriis
    yesterday












  • @leandriis then how do I use fill draw. You are splitting the draw statements

    – subham soni
    yesterday











  • In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

    – leandriis
    yesterday















1















I want to color the edge AB with thick blue color and edges AC and BC with thick red color.



Referring to the answer in Multiple color edges in TikZ, one way is to use the clip[draw] command. But, I am not sure how to use in my context, as my shape is a triangle and the triangle is filled with orange color as well.



Expected Result:



enter image description here



Current Result:



enter image description here



The triangle should still have the orange color filled and the edges with the above mentioned color.



Note: This example is from the PGF manual only. Providing the code in the manual is not recommended/appreciated without explanation.



Is there an alternate way to fill a shape instead of using filldraw or draw[fill] command.



MWE:



documentclassarticle
usepackagetikz
usetikzlibrarycalc
usetikzlibrarythrough
usetikzlibraryintersections
begindocument
begintikzpicture[help lines/.style=thin,draw=black!50]
coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
draw[name path=A--B] (A) -- (B);
% draw let p1 = ($(B) - (A)$),
% n2 = veclen(x1,y1)
% in
% (A) circle (n2)
% (B) circle (n2);
node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

%coordinate[label=above:$C$] (C) at (intersection-1); using by instead

draw [name path=C--C',red] (C) -- (C');

path [name intersections=of=A--B and C--C', by=F];
node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

draw[fill=orange!80] (A) -- (B) -- (C) -- cycle;
foreach point in A,B,C
fill [black,opacity=0.5] (point) circle (2pt);
endtikzpicture
enddocument









share|improve this question

















  • 2





    What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

    – leandriis
    yesterday












  • @leandriis then how do I use fill draw. You are splitting the draw statements

    – subham soni
    yesterday











  • In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

    – leandriis
    yesterday













1












1








1








I want to color the edge AB with thick blue color and edges AC and BC with thick red color.



Referring to the answer in Multiple color edges in TikZ, one way is to use the clip[draw] command. But, I am not sure how to use in my context, as my shape is a triangle and the triangle is filled with orange color as well.



Expected Result:



enter image description here



Current Result:



enter image description here



The triangle should still have the orange color filled and the edges with the above mentioned color.



Note: This example is from the PGF manual only. Providing the code in the manual is not recommended/appreciated without explanation.



Is there an alternate way to fill a shape instead of using filldraw or draw[fill] command.



MWE:



documentclassarticle
usepackagetikz
usetikzlibrarycalc
usetikzlibrarythrough
usetikzlibraryintersections
begindocument
begintikzpicture[help lines/.style=thin,draw=black!50]
coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
draw[name path=A--B] (A) -- (B);
% draw let p1 = ($(B) - (A)$),
% n2 = veclen(x1,y1)
% in
% (A) circle (n2)
% (B) circle (n2);
node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

%coordinate[label=above:$C$] (C) at (intersection-1); using by instead

draw [name path=C--C',red] (C) -- (C');

path [name intersections=of=A--B and C--C', by=F];
node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

draw[fill=orange!80] (A) -- (B) -- (C) -- cycle;
foreach point in A,B,C
fill [black,opacity=0.5] (point) circle (2pt);
endtikzpicture
enddocument









share|improve this question














I want to color the edge AB with thick blue color and edges AC and BC with thick red color.



Referring to the answer in Multiple color edges in TikZ, one way is to use the clip[draw] command. But, I am not sure how to use in my context, as my shape is a triangle and the triangle is filled with orange color as well.



Expected Result:



enter image description here



Current Result:



enter image description here



The triangle should still have the orange color filled and the edges with the above mentioned color.



Note: This example is from the PGF manual only. Providing the code in the manual is not recommended/appreciated without explanation.



Is there an alternate way to fill a shape instead of using filldraw or draw[fill] command.



MWE:



documentclassarticle
usepackagetikz
usetikzlibrarycalc
usetikzlibrarythrough
usetikzlibraryintersections
begindocument
begintikzpicture[help lines/.style=thin,draw=black!50]
coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
draw[name path=A--B] (A) -- (B);
% draw let p1 = ($(B) - (A)$),
% n2 = veclen(x1,y1)
% in
% (A) circle (n2)
% (B) circle (n2);
node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

%coordinate[label=above:$C$] (C) at (intersection-1); using by instead

draw [name path=C--C',red] (C) -- (C');

path [name intersections=of=A--B and C--C', by=F];
node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

draw[fill=orange!80] (A) -- (B) -- (C) -- cycle;
foreach point in A,B,C
fill [black,opacity=0.5] (point) circle (2pt);
endtikzpicture
enddocument






tikz-pgf color






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









subham sonisubham soni

4,24082981




4,24082981







  • 2





    What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

    – leandriis
    yesterday












  • @leandriis then how do I use fill draw. You are splitting the draw statements

    – subham soni
    yesterday











  • In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

    – leandriis
    yesterday












  • 2





    What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

    – leandriis
    yesterday












  • @leandriis then how do I use fill draw. You are splitting the draw statements

    – subham soni
    yesterday











  • In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

    – leandriis
    yesterday







2




2





What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

– leandriis
yesterday






What if you add draw [name path=A--C,thick,red] (A) -- (C) -- (B); draw [name path=A--B,thick,blue] (A) -- (B); at the end of your tikzpicture?

– leandriis
yesterday














@leandriis then how do I use fill draw. You are splitting the draw statements

– subham soni
yesterday





@leandriis then how do I use fill draw. You are splitting the draw statements

– subham soni
yesterday













In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

– leandriis
yesterday





In my above comment I have split up the triangle into three parts (orange triangle, red line, blue line), as you already noticed. In this comment I also made a suggestion on how to draw the orange filled triangle with thick red lines using a single draw command. You will nevertheless need a second draw command to add the thick blue line.

– leandriis
yesterday










2 Answers
2






active

oldest

votes


















1














Some options can be applied to a portion of the path, this is the case of rounded corners. But this does not work with the colors as indicated on page 149 of manual 3.1.1 which always apply to the entire path.



Screenshot of the page 149:



screenshot



So, to make it easier:



  • I first colored the ABC triangle orange with the fill command (which doesn't draw anything);

  • then I drew two paths, one in blue, the other in red.

screenshot



Commented code:



documentclass[border=5mm]standalone
usepackagetikz
usetikzlibrarycalc
usetikzlibrarythrough
usetikzlibraryintersections
begindocument
begintikzpicture[help lines/.style=thin,draw=black!50]
coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
path[name path=A--B] (A) -- (B);% <-- construct the path, but not draw it
% draw let p1 = ($(B) - (A)$),
% n2 = veclen(x1,y1)
% in
% (A) circle (n2)
% (B) circle (n2);
node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

%coordinate[label=above:$C$] (C) at (intersection-1); using by instead

path [name path=C--C',red] (C) -- (C');

path [name intersections=of=A--B and C--C', by=F];
%node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

fill[orange!80] (A) -- (B) -- (C) -- cycle;%<-- only fill without draw the edges
draw[blue,thick](A)--(B);%<-- draw in blue
draw[red,thick](A)--(C)--(B);%<-- draw in red
foreach point in A,B,C
fill [black,opacity=0.5] (point) circle (2pt);
endtikzpicture
enddocument





share|improve this answer
































    3














    You can save some of your paths by using the possibilities of the path or draw command. Especially the empty paths may be removed by integrating the intersections into the relevant paths.



    To color your way from A to B simply draw a line between the two points (after drawing the frame or simply removing the frame). The same works for A--B--C.



    triangle



    documentclassarticle
    usepackagetikz
    usetikzlibrarycalc
    usetikzlibrarythrough
    usetikzlibraryintersections
    begindocument
    begintikzpicture[help lines/.style=thin,draw=black!50]
    path[name path=A--B] (0,0) coordinate[label=left:textcolorblue!80!black$A$] (A) --
    (1.25,0.25) coordinate[label=right:textcolorblue!80!black$B$] (B);
    node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
    node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;
    draw[name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C',
    name path=C--C',red] (C) -- (C');
    node[fill=red,inner sep=1pt,name intersections=of=A--B and C--C', by=F,label=-45:$F$] at (F) ;

    draw[draw=none,fill=orange!80] (A) -- (B) -- (C) -- cycle;
    draw[blue,thick] (A) -- (B);
    draw[red,thick] (A) -- (C) -- (B);

    foreach point in A,B,C
    fill [black,opacity=0.5] (point) circle (2pt);
    endtikzpicture
    enddocument





    share|improve this answer























    • One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

      – leandriis
      yesterday











    • @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

      – TeXnician
      yesterday











    • As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

      – leandriis
      yesterday











    • @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

      – TeXnician
      yesterday










    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
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478550%2fcolor-each-edge-separately-in-tikz%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









    1














    Some options can be applied to a portion of the path, this is the case of rounded corners. But this does not work with the colors as indicated on page 149 of manual 3.1.1 which always apply to the entire path.



    Screenshot of the page 149:



    screenshot



    So, to make it easier:



    • I first colored the ABC triangle orange with the fill command (which doesn't draw anything);

    • then I drew two paths, one in blue, the other in red.

    screenshot



    Commented code:



    documentclass[border=5mm]standalone
    usepackagetikz
    usetikzlibrarycalc
    usetikzlibrarythrough
    usetikzlibraryintersections
    begindocument
    begintikzpicture[help lines/.style=thin,draw=black!50]
    coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
    coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
    path[name path=A--B] (A) -- (B);% <-- construct the path, but not draw it
    % draw let p1 = ($(B) - (A)$),
    % n2 = veclen(x1,y1)
    % in
    % (A) circle (n2)
    % (B) circle (n2);
    node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
    node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

    path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

    %coordinate[label=above:$C$] (C) at (intersection-1); using by instead

    path [name path=C--C',red] (C) -- (C');

    path [name intersections=of=A--B and C--C', by=F];
    %node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

    fill[orange!80] (A) -- (B) -- (C) -- cycle;%<-- only fill without draw the edges
    draw[blue,thick](A)--(B);%<-- draw in blue
    draw[red,thick](A)--(C)--(B);%<-- draw in red
    foreach point in A,B,C
    fill [black,opacity=0.5] (point) circle (2pt);
    endtikzpicture
    enddocument





    share|improve this answer





























      1














      Some options can be applied to a portion of the path, this is the case of rounded corners. But this does not work with the colors as indicated on page 149 of manual 3.1.1 which always apply to the entire path.



      Screenshot of the page 149:



      screenshot



      So, to make it easier:



      • I first colored the ABC triangle orange with the fill command (which doesn't draw anything);

      • then I drew two paths, one in blue, the other in red.

      screenshot



      Commented code:



      documentclass[border=5mm]standalone
      usepackagetikz
      usetikzlibrarycalc
      usetikzlibrarythrough
      usetikzlibraryintersections
      begindocument
      begintikzpicture[help lines/.style=thin,draw=black!50]
      coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
      coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
      path[name path=A--B] (A) -- (B);% <-- construct the path, but not draw it
      % draw let p1 = ($(B) - (A)$),
      % n2 = veclen(x1,y1)
      % in
      % (A) circle (n2)
      % (B) circle (n2);
      node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
      node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

      path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

      %coordinate[label=above:$C$] (C) at (intersection-1); using by instead

      path [name path=C--C',red] (C) -- (C');

      path [name intersections=of=A--B and C--C', by=F];
      %node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

      fill[orange!80] (A) -- (B) -- (C) -- cycle;%<-- only fill without draw the edges
      draw[blue,thick](A)--(B);%<-- draw in blue
      draw[red,thick](A)--(C)--(B);%<-- draw in red
      foreach point in A,B,C
      fill [black,opacity=0.5] (point) circle (2pt);
      endtikzpicture
      enddocument





      share|improve this answer



























        1












        1








        1







        Some options can be applied to a portion of the path, this is the case of rounded corners. But this does not work with the colors as indicated on page 149 of manual 3.1.1 which always apply to the entire path.



        Screenshot of the page 149:



        screenshot



        So, to make it easier:



        • I first colored the ABC triangle orange with the fill command (which doesn't draw anything);

        • then I drew two paths, one in blue, the other in red.

        screenshot



        Commented code:



        documentclass[border=5mm]standalone
        usepackagetikz
        usetikzlibrarycalc
        usetikzlibrarythrough
        usetikzlibraryintersections
        begindocument
        begintikzpicture[help lines/.style=thin,draw=black!50]
        coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
        coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
        path[name path=A--B] (A) -- (B);% <-- construct the path, but not draw it
        % draw let p1 = ($(B) - (A)$),
        % n2 = veclen(x1,y1)
        % in
        % (A) circle (n2)
        % (B) circle (n2);
        node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
        node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

        path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

        %coordinate[label=above:$C$] (C) at (intersection-1); using by instead

        path [name path=C--C',red] (C) -- (C');

        path [name intersections=of=A--B and C--C', by=F];
        %node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

        fill[orange!80] (A) -- (B) -- (C) -- cycle;%<-- only fill without draw the edges
        draw[blue,thick](A)--(B);%<-- draw in blue
        draw[red,thick](A)--(C)--(B);%<-- draw in red
        foreach point in A,B,C
        fill [black,opacity=0.5] (point) circle (2pt);
        endtikzpicture
        enddocument





        share|improve this answer















        Some options can be applied to a portion of the path, this is the case of rounded corners. But this does not work with the colors as indicated on page 149 of manual 3.1.1 which always apply to the entire path.



        Screenshot of the page 149:



        screenshot



        So, to make it easier:



        • I first colored the ABC triangle orange with the fill command (which doesn't draw anything);

        • then I drew two paths, one in blue, the other in red.

        screenshot



        Commented code:



        documentclass[border=5mm]standalone
        usepackagetikz
        usetikzlibrarycalc
        usetikzlibrarythrough
        usetikzlibraryintersections
        begindocument
        begintikzpicture[help lines/.style=thin,draw=black!50]
        coordinate[label=left:textcolorblue!80!black$A$] (A) at (0,0);
        coordinate[label=right:textcolorblue!80!black$B$] (B) at (1.25,0.25);
        path[name path=A--B] (A) -- (B);% <-- construct the path, but not draw it
        % draw let p1 = ($(B) - (A)$),
        % n2 = veclen(x1,y1)
        % in
        % (A) circle (n2)
        % (B) circle (n2);
        node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
        node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;

        path [name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C'];

        %coordinate[label=above:$C$] (C) at (intersection-1); using by instead

        path [name path=C--C',red] (C) -- (C');

        path [name intersections=of=A--B and C--C', by=F];
        %node[fill=red,inner sep=1pt, label=-45:$F$] at (F) ;

        fill[orange!80] (A) -- (B) -- (C) -- cycle;%<-- only fill without draw the edges
        draw[blue,thick](A)--(B);%<-- draw in blue
        draw[red,thick](A)--(C)--(B);%<-- draw in red
        foreach point in A,B,C
        fill [black,opacity=0.5] (point) circle (2pt);
        endtikzpicture
        enddocument






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday

























        answered yesterday









        AndréCAndréC

        10.2k11547




        10.2k11547





















            3














            You can save some of your paths by using the possibilities of the path or draw command. Especially the empty paths may be removed by integrating the intersections into the relevant paths.



            To color your way from A to B simply draw a line between the two points (after drawing the frame or simply removing the frame). The same works for A--B--C.



            triangle



            documentclassarticle
            usepackagetikz
            usetikzlibrarycalc
            usetikzlibrarythrough
            usetikzlibraryintersections
            begindocument
            begintikzpicture[help lines/.style=thin,draw=black!50]
            path[name path=A--B] (0,0) coordinate[label=left:textcolorblue!80!black$A$] (A) --
            (1.25,0.25) coordinate[label=right:textcolorblue!80!black$B$] (B);
            node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
            node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;
            draw[name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C',
            name path=C--C',red] (C) -- (C');
            node[fill=red,inner sep=1pt,name intersections=of=A--B and C--C', by=F,label=-45:$F$] at (F) ;

            draw[draw=none,fill=orange!80] (A) -- (B) -- (C) -- cycle;
            draw[blue,thick] (A) -- (B);
            draw[red,thick] (A) -- (C) -- (B);

            foreach point in A,B,C
            fill [black,opacity=0.5] (point) circle (2pt);
            endtikzpicture
            enddocument





            share|improve this answer























            • One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

              – leandriis
              yesterday











            • @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

              – TeXnician
              yesterday











            • As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

              – leandriis
              yesterday











            • @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

              – TeXnician
              yesterday















            3














            You can save some of your paths by using the possibilities of the path or draw command. Especially the empty paths may be removed by integrating the intersections into the relevant paths.



            To color your way from A to B simply draw a line between the two points (after drawing the frame or simply removing the frame). The same works for A--B--C.



            triangle



            documentclassarticle
            usepackagetikz
            usetikzlibrarycalc
            usetikzlibrarythrough
            usetikzlibraryintersections
            begindocument
            begintikzpicture[help lines/.style=thin,draw=black!50]
            path[name path=A--B] (0,0) coordinate[label=left:textcolorblue!80!black$A$] (A) --
            (1.25,0.25) coordinate[label=right:textcolorblue!80!black$B$] (B);
            node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
            node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;
            draw[name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C',
            name path=C--C',red] (C) -- (C');
            node[fill=red,inner sep=1pt,name intersections=of=A--B and C--C', by=F,label=-45:$F$] at (F) ;

            draw[draw=none,fill=orange!80] (A) -- (B) -- (C) -- cycle;
            draw[blue,thick] (A) -- (B);
            draw[red,thick] (A) -- (C) -- (B);

            foreach point in A,B,C
            fill [black,opacity=0.5] (point) circle (2pt);
            endtikzpicture
            enddocument





            share|improve this answer























            • One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

              – leandriis
              yesterday











            • @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

              – TeXnician
              yesterday











            • As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

              – leandriis
              yesterday











            • @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

              – TeXnician
              yesterday













            3












            3








            3







            You can save some of your paths by using the possibilities of the path or draw command. Especially the empty paths may be removed by integrating the intersections into the relevant paths.



            To color your way from A to B simply draw a line between the two points (after drawing the frame or simply removing the frame). The same works for A--B--C.



            triangle



            documentclassarticle
            usepackagetikz
            usetikzlibrarycalc
            usetikzlibrarythrough
            usetikzlibraryintersections
            begindocument
            begintikzpicture[help lines/.style=thin,draw=black!50]
            path[name path=A--B] (0,0) coordinate[label=left:textcolorblue!80!black$A$] (A) --
            (1.25,0.25) coordinate[label=right:textcolorblue!80!black$B$] (B);
            node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
            node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;
            draw[name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C',
            name path=C--C',red] (C) -- (C');
            node[fill=red,inner sep=1pt,name intersections=of=A--B and C--C', by=F,label=-45:$F$] at (F) ;

            draw[draw=none,fill=orange!80] (A) -- (B) -- (C) -- cycle;
            draw[blue,thick] (A) -- (B);
            draw[red,thick] (A) -- (C) -- (B);

            foreach point in A,B,C
            fill [black,opacity=0.5] (point) circle (2pt);
            endtikzpicture
            enddocument





            share|improve this answer













            You can save some of your paths by using the possibilities of the path or draw command. Especially the empty paths may be removed by integrating the intersections into the relevant paths.



            To color your way from A to B simply draw a line between the two points (after drawing the frame or simply removing the frame). The same works for A--B--C.



            triangle



            documentclassarticle
            usepackagetikz
            usetikzlibrarycalc
            usetikzlibrarythrough
            usetikzlibraryintersections
            begindocument
            begintikzpicture[help lines/.style=thin,draw=black!50]
            path[name path=A--B] (0,0) coordinate[label=left:textcolorblue!80!black$A$] (A) --
            (1.25,0.25) coordinate[label=right:textcolorblue!80!black$B$] (B);
            node (D) [name path=D,draw,circle through=(B),label=left:$D$,help lines,draw] at (A) ;
            node (E) [name path=E,draw,circle through=(A),label=right:$E$,help lines,draw] at (B) ;
            draw[name intersections=of=D and E, by=[label=above:$C$]C,[label=below:$C'$]C',
            name path=C--C',red] (C) -- (C');
            node[fill=red,inner sep=1pt,name intersections=of=A--B and C--C', by=F,label=-45:$F$] at (F) ;

            draw[draw=none,fill=orange!80] (A) -- (B) -- (C) -- cycle;
            draw[blue,thick] (A) -- (B);
            draw[red,thick] (A) -- (C) -- (B);

            foreach point in A,B,C
            fill [black,opacity=0.5] (point) circle (2pt);
            endtikzpicture
            enddocument






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered yesterday









            TeXnicianTeXnician

            25.6k63390




            25.6k63390












            • One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

              – leandriis
              yesterday











            • @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

              – TeXnician
              yesterday











            • As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

              – leandriis
              yesterday











            • @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

              – TeXnician
              yesterday

















            • One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

              – leandriis
              yesterday











            • @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

              – TeXnician
              yesterday











            • As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

              – leandriis
              yesterday











            • @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

              – TeXnician
              yesterday
















            One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

            – leandriis
            yesterday





            One could also use draw[fill=orange!80, draw=red,thick] (A) -- (B) -- (C) -- cycle; instead of draw[fill=orange!80] (A) -- (B) -- (C) -- cycle; and draw[red,thick] (A) -- (C) -- (B);.

            – leandriis
            yesterday













            @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

            – TeXnician
            yesterday





            @leandriis Well, it's to highlight the "color each edge separately" from the question. You are right that it is even shorter by overlaying drawn paths.

            – TeXnician
            yesterday













            As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

            – leandriis
            yesterday





            As you already suggested in your answer to '[...] save some of your paths [...]' I thought the same could also be applied to the code that is added to answer the question.

            – leandriis
            yesterday













            @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

            – TeXnician
            yesterday





            @leandriis My initial intention was to specifically remove these empty paths, but of course you are right ;)

            – TeXnician
            yesterday

















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478550%2fcolor-each-edge-separately-in-tikz%23new-answer', 'question_page');

            );

            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







            Popular posts from this blog

            Solar Wings Breeze Design and development Specifications (Breeze) References Navigation menu1368-485X"Hang glider: Breeze (Solar Wings)"e

            Kathakali Contents Etymology and nomenclature History Repertoire Songs and musical instruments Traditional plays Styles: Sampradayam Training centers and awards Relationship to other dance forms See also Notes References External links Navigation menueThe Illustrated Encyclopedia of Hinduism: A-MSouth Asian Folklore: An EncyclopediaRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to Play10.1353/atj.2005.0004The Illustrated Encyclopedia of Hinduism: A-MEncyclopedia of HinduismKathakali Dance-drama: Where Gods and Demons Come to PlaySonic Liturgy: Ritual and Music in Hindu Tradition"The Mirror of Gesture"Kathakali Dance-drama: Where Gods and Demons Come to Play"Kathakali"Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceMedieval Indian Literature: An AnthologyThe Oxford Companion to Indian TheatreSouth Asian Folklore: An Encyclopedia : Afghanistan, Bangladesh, India, Nepal, Pakistan, Sri LankaThe Rise of Performance Studies: Rethinking Richard Schechner's Broad SpectrumIndian Theatre: Traditions of PerformanceModern Asian Theatre and Performance 1900-2000Critical Theory and PerformanceBetween Theater and AnthropologyKathakali603847011Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceBetween Theater and AnthropologyBetween Theater and AnthropologyNambeesan Smaraka AwardsArchivedThe Cambridge Guide to TheatreRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeThe Garland Encyclopedia of World Music: South Asia : the Indian subcontinentThe Ethos of Noh: Actors and Their Art10.2307/1145740By Means of Performance: Intercultural Studies of Theatre and Ritual10.1017/s204912550000100xReconceiving the Renaissance: A Critical ReaderPerformance TheoryListening to Theatre: The Aural Dimension of Beijing Opera10.2307/1146013Kathakali: The Art of the Non-WorldlyOn KathakaliKathakali, the dance theatreThe Kathakali Complex: Performance & StructureKathakali Dance-Drama: Where Gods and Demons Come to Play10.1093/obo/9780195399318-0071Drama and Ritual of Early Hinduism"In the Shadow of Hollywood Orientalism: Authentic East Indian Dancing"10.1080/08949460490274013Sanskrit Play Production in Ancient IndiaIndian Music: History and StructureBharata, the Nāṭyaśāstra233639306Table of Contents2238067286469807Dance In Indian Painting10.2307/32047833204783Kathakali Dance-Theatre: A Visual Narrative of Sacred Indian MimeIndian Classical Dance: The Renaissance and BeyondKathakali: an indigenous art-form of Keralaeee

            Method to test if a number is a perfect power? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Detecting perfect squares faster than by extracting square rooteffective way to get the integer sequence A181392 from oeisA rarely mentioned fact about perfect powersHow many numbers such $n$ are there that $n<100,lfloorsqrtn rfloor mid n$Check perfect squareness by modulo division against multiple basesFor what pair of integers $(a,b)$ is $3^a + 7^b$ a perfect square.Do there exist any positive integers $n$ such that $lfloore^nrfloor$ is a perfect power? What is the probability that one exists?finding perfect power factors of an integerProve that the sequence contains a perfect square for any natural number $m $ in the domain of $f$ .Counting Perfect Powers