Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to draw an arrow (ray of light) overlayed with perpendicular double headed arrows and circles (to show both s & p polarisation), but I am struggling with decoration commands. I have included what I have so far, can you help me get further?

What I currently have:

What I currently have

(Nasty mockup of) what I would like:

what I would like

\documentclass{article}
\usepackage{tikz, pgfplots}
\usetikzlibrary{shapes,arrows,positioning,decorations.markings}

\begin{document}
\begin{tikzpicture}[scale=0.7]

    \draw [red, line width=1mm, <-]  (0,0) -- (150:5.2)
        [postaction={decorate,decoration={markings,
        mark=between positions 0.2 and 0.9 step 0.2 with {\arrow[red, line width=1mm]{|};}
        }}]
        [postaction={decorate,decoration={markings,
        mark=between positions 0.3 and 0.9 step 0.2 with {\circle{8};}
        }}]
        ;       

\end{tikzpicture}
\end{document}
share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The markings have a local coordinate system with x direction along the tangent and y direction along the normal so you can draw things using that coord system.

\documentclass[tikz]{standalone}

\usetikzlibrary{shapes,arrows,positioning,decorations.markings}

\begin{document}
\begin{tikzpicture}[scale=0.7]
    \draw [red, line width=1mm, <-, 
        postaction={decorate,decoration={markings,
        mark=between positions 0.2 and 0.9 step 0.2 with {\draw [<->,red,thin] (0,-2mm) -- (0,2mm);}
        }}
        ,postaction={decorate,decoration={markings,
        mark=between positions 0.3 and 0.9 step 0.2 with {\draw[thin,blue] circle (3pt);}
        }}]
         (0,0) -- (150:5.2);       

\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
    
Excellent, thanks for your help. –  Chris Jul 16 '13 at 12:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.