I’m trying to have colour gradient on path, and discovered fade-no-fill.sty, which latest version seems to be https://tex.stackexchange.com/a/567029/56823. It works pretty well, but I have two small issues.

My MWE is as follow:

\documentclass[tikz]{standalone}

\usetikzlibrary{shapes}

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\l}{3}
\node [red,draw,thick,ellipse] (S) at (-\l,0) {Solide};
\node [blue,draw,thick,ellipse] (L) at (\l,0) {Liquide};
\node [green,draw,thick,ellipse] (G) at (0,{\l*sqrt(3)}) {Gaz};
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{bottom color=red,top color=green}] (S) to[bend left] (G);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{top color=green,bottom color=blue}] (G) to[bend left] (L);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{right color=blue,left color=red}] (L) to[bend left] (S);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{left color=red,right color=blue}] (S) to (L);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{top color=green,bottom color=blue}] (L) to (G);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{bottom color=red,top color=green}] (G) to (S);
\end{tikzpicture}
\end{document}


It produces this: Note:

1. the clipped blue arrow above “Liquide”.
2. the very strange arrow at the left of “Liquide”.

Any idea what could be causing this and how to solve it?

– Ross
Sep 17, 2021 at 14:14
• Have you tried suggestion from @Ross? (I do not know what it does, but try it) Also add \usetikzlibrary{arrows.meta} "% needed so that bounding boxes correctly include arrows." (should already be in fade-no-fill.sty - but try it) Sep 17, 2021 at 21:27
• Try this (maybe it will expand the bounding box) \path [fade path but don't fill={thick,->,>=latex,transparent!0}{top color=green,bottom color=blue}] (G) to[bend left] (L) edge[draw=none] ([turn] 90:0.2); Sep 17, 2021 at 21:37
• There is another fading question, where the arrowhead gets cut of - maybe you can draw the head separately like here: tex.stackexchange.com/a/597939/8650 Sep 17, 2021 at 21:39
• It is almost certainly an issue with the arrowheads not being included in the bounding box calculations. If you imagine a rectangle around each path then you can see why they get flipped but the others don't. Sep 17, 2021 at 22:09

> = latex is an arrow tip without bounding box. (This arrow head is defined in pgfcorearrows.code.tex and is available regardless of whether arrows.meta is included.)

With > = Latex, the arrow tip has a bounding box. (This arrow head is defined in arrows.meta with proper bounding box.)

• Cool. Do you know why it goes wrong for the normal -> here: tex.stackexchange.com/q/597927/8650 ? Sep 18, 2021 at 3:26
• I also answered that question =P. It has something to do with the order of computation. (fading comes before adding arrow heads.) Sep 18, 2021 at 3:29
• Wow - You effortlessly jumped back in time and answered, just to make me look stupid :o) Sep 18, 2021 at 3:39
• 😅 (dummy parentheses to meet mim char requirement) Sep 18, 2021 at 3:48
• Interesting, good to know. I’m accepting this answer since this is the one correctly solving clipping while using fade-no-fill, but @hpekristiansen new solution with twice drawing is also nice to work without fade-no-fill. :) Sep 18, 2021 at 4:49

Here is another methode where all the arrows are drawn twice with two different colors path fading from different directions.

\documentclass[tikz, border=1 cm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[red,draw,thick,ellipse] (S) at (-3,0) {Solide};
\node[blue,draw,thick,ellipse] (L) at (3,0) {Liquide};
\node[green,draw,thick,ellipse] (G) at (0,{3*sqrt(3)}) {Gaz};
\draw[green, path fading=south, thick ,-latex] (S) to[bend left] (G);
\draw[red, path fading=north, thick ,-latex] (S) to[bend left] (G);
\draw[green, path fading=south, thick ,-latex] (G) to[bend left] (L);
\draw[blue, path fading=north, thick ,-latex] (G) to[bend left] (L);
\draw[blue, path fading=west, thick ,-latex] (L) to[bend left] (S);
\draw[red, path fading=east, thick ,-latex] (L) to[bend left] (S);
\draw[blue, path fading=west, thick, shorten >=5pt] (S) to (L); %this arror is problematic
\draw[blue, thick ,-latex] ([xshift=-4pt] L.west) -- (L.west); %seperate arrow head
\draw[red, path fading=east, thick ,-latex] (S) to (L);
\draw[green, path fading=south, thick ,-latex] (L) to (G);
\draw[blue, path fading=north, thick ,-latex] (L) to (G);
\draw[green, path fading=south, thick ,-latex] (G) to (S);
\draw[red, path fading=north, thick ,-latex] (G) to (S);
\end{tikzpicture}
\end{document}


The horizontal blue arrow head gets clipped, but is redrawn. A more universal method is here: https://tex.stackexchange.com/a/597939/8650

Edit:

The double drawing can be made into a style with a postaction here is a start:

\documentclass[tikz, border=1 cm]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \a in {0,10,...,360}{
\coordinate (A) at (0,0);
\coordinate (B) at (\a:3);
\draw let \p1=($(B)-(A)$), \n1={atan2(\y1,\x1)} in [green, path fading=west, fading angle = \n1, thick ,-latex, postaction={draw, red, path fading=east, fading angle = \n1, thick ,-latex}]  ([xshift=5pt, yshift=5pt]A) (A) to[bend left] (B);
}
\end{tikzpicture}
\end{document}


• This is a very nice solution and I might actually switch to that, however I’ve accepted @symbol-1 solution since it properly fixes the clipping answer in the context of the question (using fade-no-fill). But I’ve upvoted you on tex.stackexchange.com/a/615816/56823 ;) Sep 18, 2021 at 4:52
• I agree Symbol1 answered your question. (but this is probably a nicer solution) Sep 18, 2021 at 4:55
• Actually it’s not just the arrow that gets clipped, see tex.stackexchange.com/q/615945/56823 Sep 19, 2021 at 9:13

Since we are into workarounds, I’ve tried this one:

\documentclass[tikz]{standalone}

\usetikzlibrary{shapes}

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\l}{3}
\node [red,draw,thick,ellipse] (S) at (-\l,0) {Solide};
\node [blue,draw,thick,ellipse] (L) at (\l,0) {Liquide};
\node [green,draw,thick,ellipse] (G) at (0,{\l*sqrt(3)}) {Gaz};
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{bottom color=red,top color=green}] (S) to[bend left] (G);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{top color=green,bottom color=blue}] (G) to[bend left] (L);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{right color=blue,left color=red}] (L) to[bend left] (S);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{left color=red,right color=blue}] (S) to (L);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{top color=green,bottom color=blue}] (L) to (G);
\path [fade path but don't fill={thick,->,>=latex,transparent!0}{bottom color=red,top color=green}] (G) to (S);
\draw [thick,<-,>=latex,blue] (L.west) -- ++(-0.1,0); % Redraw west arrow
\draw [thick,<-,>=latex,blue] (L.north) -- ++(0,0.1); % Redraw north arrow
\end{tikzpicture}
\end{document}


The result suits me, but this is still a workaround nonetheless.

I do not know \usepackage{fade-no-fill}, but here is an alternative solution using tikzfadingfrompicture:

\documentclass[tikz, border=1 cm]{standalone}
\pgfmathsetmacro{\l}{3}
\node[transparent!0,draw,thick,ellipse] (S) at (-\l,0) {Solide};
\node[transparent!0,draw,thick,ellipse] (L) at (\l,0) {Liquide};
\node[transparent!0,draw,thick,ellipse] (G) at (0,{\l*sqrt(3)}) {Gaz};
\draw[transparent!0, thick ,-latex] (S) to[bend left] (G);
\draw[transparent!0, thick ,-latex] (G) to[bend left] (L);
\draw[transparent!0, thick ,-latex] (L) to[bend left] (S);
\draw[transparent!0, thick ,-latex] (S) to (L);
\draw[transparent!0, thick ,-latex] (L) to (G);
\draw[transparent!0, thick ,-latex] (G) to (S);
\begin{document}
\begin{tikzpicture}
\end{tikzpicture}
\end{document}


Edit:

I just got an idea of how to prevent translation of the tikzfadingfrompicture - simply add a circle centered at (0,0) that encompasses everything.

\draw[transparent!100] (0,0) circle (6);. Now the nodes can be drawn outside the fading, if so desired:

\documentclass[tikz, border=1 cm]{standalone}
\node[transparent!100,draw,thick,ellipse] (S) at (-3,0) {Solide};
\node[transparent!100,draw,thick,ellipse] (L) at (3,0) {Liquide};
\node[transparent!100,draw,thick,ellipse] (G) at (0,{3*sqrt(3)}) {Gaz};
\draw[transparent!0, thick ,-latex] (S) to[bend left] (G);
\draw[transparent!0, thick ,-latex] (G) to[bend left] (L);
\draw[transparent!0, thick ,-latex] (L) to[bend left] (S);
\draw[transparent!0, thick ,-latex] (S) to (L);
\draw[transparent!0, thick ,-latex] (L) to (G);
\draw[transparent!0, thick ,-latex] (G) to (S);
\draw[transparent!100] (0,0) circle (6);

• Wow! This is very interesting. I didn't know about this tikzfadingfrompicture environment. I'll dig into it (since it's in the manual). Sep 17, 2021 at 18:00
• @SebGlav I find it difficult to work with and not well described. fit fading=false prevents scaling of the fading picture, but there will be a translation. I unsuccessfully tried to have the nodes outside the fading, but I can not make the placement predictable. Sep 17, 2021 at 18:09