7
  1. Why 4-6, 4-7, 7-5 get these colorings? More precisely, what is the difference between [draw=green, fill=green] to [color=green]?

  2. Why the 4-5 arc has a slightly bigger width that 7-6? You can see a faint black outerline in the 4-5 arc.

This is a minimal example with my questions:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, positioning, trees, mindmap, calc}
\begin{document}
\begin{tikzpicture}

\tikzset{every node/.style={minimum size=5pt, inner sep=0pt, outer sep=0pt, node distance=25pt}}
\tikzset{black circle/.style={every node, shape=circle, draw=black, fill=black, text=white}}
\tikzset{thick edge/.style={-, black, fill=none, thick, text=black}}
\tikzset{thick arc/.style={->, black, fill=none, thick, >=stealth, text=black}}

\node[black circle] (4) {4};
\node[black circle, below=of 4] (5) {5};
\node[black circle, right=of 5] (6) {6};
\node[black circle, above=of 6] (7) {7};

\draw[thick arc] (4) -- (5);
\draw[thick arc, green] (7) -- (6);
\draw[thick arc, color=green] (4) -- (6);

\draw[thick arc, draw=green] (7) -- (5);

\draw[thick arc, draw=green, fill=green] (4) -- (7);

\draw[thick arc, green] (4) -- (5);

\end{tikzpicture}
\end{document}

1 Answer 1

12
  1. There are three different options for setting colours of specific elements: draw, fill, and text. The colour specified using draw applies to outlines, fill applies to areas (and filled arrow tips, like stealth and latex, but unlike the default), text applies to the text in nodes. color is a shorthand for setting all three of these simultaneously. Just specifying a colour on its own is a shorthand for the shorthand: It also applies to draw, fill and text.

    green and color=green are equivalent, and since you're not using text in your example, fill=green, draw=green is also equivalent here.

  2. The faint black outline comes from the fact that you're drawing the arrow from 4 to 5 twice: First in black, then again in green. The faint outline is an artefact of the anti-aliasing of the renderer (see the discussion at TikZ borders showing through when they shouldn't (overlapping circles)).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .