I would like to do something like

\draw (node1) -- (node2) {[dotted] -- (node3)} -- (node4) {[dotted] -- (node5)} -- (node6);

There is no error message but the path comes out without any dotted parts, just everything same plain path.

Of course I could make several separate paths but in the "real" case there are about twenty segments that I would like to make alternatingly solid and dotted.

Is there a way to do it?

  • 1
    You can't just change the line style underway. If you are using edges, you could, see e.g. here.
    – user121799
    Aug 2 '18 at 19:38
  • 1
    If the nodes are alternating you could write just a simple foreach loop in which are only two coordinates connected by a solid/dotted line. Aug 2 '18 at 21:04
  • You can't change colors with an inline scope either. I suspect the problem is that paths are constructed as a whole, then "stroked" (see page 1102). Aug 3 '18 at 16:07
  • @marmot I believe this is the answer to my question. Why could I not want to use edges?? Aug 4 '18 at 4:27

Browse other questions tagged or ask your own question.