I am doing a job that is simple but must be done thousands of times. I want to create a command whose inputs are two coordinates ( \coordinate (A) at (0,0); and B at \coordinate (B) at (3,6); for example), and four colors. The desired output is a path between the coordinates that is decorated with this figure that I show you below


I have tried, but the command is beyond my knowledge of Tikz. Also below I show you some handmade examples with the result that I need.


The base code is

\usetikzlibrary {decorations.markings}
            \draw (-8,0)-- (8,0);       
            \draw[fill][line width=0.5pt, ](-2,-1)rectangle (2, 1);
            \draw[red] (-1.5, 1)-- ++ (0,-2);
            \draw[blue] (-1, 1)-- ++ (0,-2);
            \draw[yellow] (-0.5, 1)-- ++ (0,-2);
            \draw[orange] (-0, 1)-- ++ (0,-2);

Thank you very much for any help.

1 Answer 1


You could do this with a path picture in a sloped node. You can adjust minimum height and minimum width, and then also adjust the (relative) coordinates of the four lines.

enter image description here


    mynode/.style n args={4}{sloped, allow upside down, thick, fill, minimum height=2cm, minimum width=4cm, path picture={




You must log in to answer this question.

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