[Tex/LaTex] Draw tilted arrow on a diagram using overpic

overpic

I have an image in PNG format. I wanted to draw some arrows over it. These arrows are neither horizontal nor vertical. I am facing problem while assigning the directions to vector.
Below is the image (in which I have drawn the lines from image editor, just to show)

enter image description here

Below is the code to draw an arrow-

\documentclass{article}
\usepackage[percent]{overpic}
\usepackage{xcolor}

\begin{document}
\begin{overpic}{tube}
\put(36,36){\color{green}\vector(2.5,1){50}}
\end{overpic}
\end{document}

Below is the output-

enter image description here

Notice that .5 is getting printed. I have following questions-

  1. How to align arrows in any direction easily?
  2. How to draw dotted lines and arrows?
  3. How to set thickness of the arrow?

Best Answer

The first argument to \vector should be a pair of (coprime) integers. However, the pict2e package removes this restriction and also allows for arbitrary line thickness.

\documentclass{article}
\usepackage[percent]{overpic}
\usepackage{xcolor}
\usepackage{pict2e}

\begin{document}

\begin{overpic}{example-image}
\linethickness{2pt}
\put(36,36){\color{green}\vector(2.5,1){50}}
\end{overpic}

\end{document}

enter image description here

The pict2e package doesn't support dotted arrows.