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
\documentclass[border=5]{standalone}
\usepackage{tikz}
\usetikzlibrary {decorations.markings}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\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);
\end{scope}
\end{tikzpicture}
\end{document}
Thank you very much for any help.
Best Answer
You could do this with a
path picture
in asloped
node. You can adjustminimum height
andminimum width
, and then also adjust the (relative) coordinates of the four lines.