1

In the below code how can I draw the line around the circle so that half be blue half red (two color circle border)?

\node[circle, draw=blue,line width=.5mm] at (0, 0) [label=center:{($A$)}] (A) {};

1
  • Try to draw two semi-circles with different colours? B.t.w., the circle is the line.
    – Bernard
    May 5 '20 at 11:07
1

This is what dash patterns are for. Here are some basic examples.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[circle, draw=blue,dash pattern=on pi*0.5em off pi*0.5em,
postaction={draw=red,dash phase=pi*0.5em},
,line width=.5mm,minimum size=1em] at (0, 0) [label=center:{($A$)}]  (A) {};
\node[circle, draw=blue,dash pattern=on pi*1em off pi*1em,
postaction={draw=red,dash phase=pi*1em},
,line width=.5mm,minimum size=2em] at (2, 0) [label=center:{($A$)}]  (A) {};
\end{tikzpicture}
\end{document}

enter image description here

Obviously you can make this a style. (Please let me know if this is to be spelled out.)

1
  • Why are there 0 scores for these answers? :-( very nice.
    – Sebastiano
    May 6 '20 at 22:15
1
\documentclass[tikz,margin=3mm]{standalone}

\begin{document}
    \begin{tikzpicture}[line width=.5mm]
\draw[red] (-0.5,0) arc (180:0:0.5);
\draw[blue] (0.5,0) arc (360:180:0.5);
\node {$(A)$};
    \end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.