I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use.
If somebody can give me a hand to start in a good way.
I have an old image with ppt style and I would like to customise it a bit. Main problem is I'm a beginner in Tikz/PGF and i really don't know where to start and which environments I should use.
If somebody can give me a hand to start in a good way.
Well, today everybody woke up from the wrong side of the bed apparently, so somebody has to fart the bad mood out on this one.
But please notice that advice is not fit for our Q&A site without concrete examples because it would be too specific to your needs. You can also use the chat room if you wish to have a quick discussion. Our questions tend to be to the point about certain aspects with less commenting.
Anyway, here is some initial points for you so that you can start decorating them or changing the colors etc. And that is up to you to pick up the manual and start working on it :)
\documentclass[tikz]{standalone}
\pgfdeclaredecoration{single pulse}{initial}{
\state{initial}[width=\pgfdecoratedinputsegmentlength]
{%
\pgfpathlineto{\pgfpoint{0.2*\pgfdecoratedinputsegmentlength}{0mm}}%
\pgfpathsine{\pgfpoint{0.15\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}%
\pgfpathcosine{\pgfpoint{0.15\pgfdecorationsegmentlength}{-\pgfdecorationsegmentamplitude}}%
\pgfpathsine{\pgfpoint{0.15\pgfdecorationsegmentlength}{-\pgfdecorationsegmentamplitude}}
\pgfpathcosine{\pgfpoint{0.15\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}%
\pgfpathlineto{\pgfpointdecoratedinputsegmentlast}%
}
\state{final}{}%
}
\begin{document}
\begin{tikzpicture}[mydeco/.style={decoration={single pulse,amplitude=4mm,segment length=2mm},decorate}]
\foreach\x in{0,1,2}{
\draw[mydeco] (0,-\x) -- (1,-\x);
\draw[mydeco] (2+0.25*\x,-\x) -- (3+0.25*\x,-\x);
\draw[mydeco] (4+0.5*\x,-\x) -- (5+0.5*\x,-\x);
}
\draw[dashed,blue] \foreach \x in {0,2,4}{(\x,0) -- (\x,-2.2)};
\draw[red,dashed] \foreach \x in {2.25,4.5}{(\x,-1) -- (\x,-2.2)};
\end{tikzpicture}
\end{document}
You might also like to learn Metapost, the graphics language devised by John Hobby and D. E. Knuth. Here are two little functions that draw a pulse shape and the down brace you would need for your picture. The rest of it is just lines and labels, as explained in the manual.
prologues := 3;
outputtemplate := "%j%c.eps";
vardef pulse(expr s) =
save x, y, pulse; path pulse;
z1 = left; z2 = z1/4; x3 = x2/2; y3 = 1;
pulse = z1 .. subpath (0.2,0.6) of (z1--z2) .. controls z2 and z2
.. subpath (0.2,0.6) of (z2--z3) .. controls z3 and z3 .. origin;
(pulse .. reverse pulse rotated 180) scaled 1/2s
enddef;
vardef down_brace(expr s) =
save arm; path arm;
arm = (-1,1/4) {down} .. {right} (-7/8,1/8) -- (-1/8,1/8) {right} .. {down} origin;
(arm .. reverse arm reflectedabout(up,down)) scaled 1/2s
enddef;
beginfig(1);
draw pulse(1cm) withcolor .78 blue;
draw down_brace(1cm) shifted (0,-7mm) withcolor .56 red;
endfig;
end.
Since the functions return a path
, you can join them together like this:
draw pulse(1cm) -- pulse(1cm) shifted (2cm,0) -- pulse(1cm) shifted (4cm,0) withcolor .7 white;
to produce this.
You can also do this with one of MP's "inline" for
loops if you prefer:
draw pulse(1cm) for i=1,2: -- pulse(1cm) shifted (i*2cm,0) endfor withcolor .7 white;
So, this is what I did so far :
\begin{tikzpicture}[mydeco/.style={decoration={single pulse,amplitude=7mm,segment length=3mm},decorate}]
\foreach\x in{0,2,4}{
\draw[mydeco] (0,-\x) -- (0.6,-\x);
\draw[mydeco] (2+0.15*\x,-\x) -- (2.6+0.15*\x,-\x);
\draw[mydeco] (4+0.30*\x,-\x) -- (4.6+0.30*\x,-\x);
}
\draw[dotted,gray] \foreach \x in {0,2,4}{(0, -\x) -- (5+0.3*4, -\x)};
\draw[dashed,blue] \foreach \x in {2,4}{(\x,0) -- (\x,-1.1)};
\draw[dashed,red] \foreach \x in {2.3,4.6}{(\x,-2) -- (\x,-3.1)};
\draw[dashed,green] \foreach \x in {2.6,5.2}{(\x,-4) -- (\x,-5.1)};
\draw[dashed,black,thick] (0,1) node[above] {$t_0$} -- (0,-5.2) ;
\draw[blue,<->,thick] (0.05,-0.8) -- (2-0.05,-0.8) node [below,align=center,midway] {$T$};
\draw[blue,<->,thick] (2+0.05,-0.8) -- (4-0.05,-0.8) node [below,align=center,midway] {$T$};
\draw[red,<->,thick] (0.05,-2.8) -- (2.3-0.05,-2.8) node [below,align=center,midway] {$T+t_1$};
\draw[red,<->,thick] (2.3+0.05,-2.8) -- (4.6-0.05,-2.8) node [below,align=center,midway] {$T+t_1$};
\draw[green,<->,thick] (0.05,-4.8) -- (2.6-0.05,-4.8) node [below,align=center,midway] {$T+2*t_1$};
\draw[green,<->,thick] (2.6+0.05,-4.8) -- (5.2-0.05,-4.8) node [below,align=center,midway] {$T+2*t_1$};
\draw [fill=blue!20,draw=blue,thick] (-0.3,0) -- (-1.0,0.5) arc (90:270:.20) -- (-0.3,0) -- (-1,-0.04) arc (90:270:.20) -- cycle node[above,inner sep=22pt, midway] {\tiny{Antenna 1}};
\draw [fill=red!20,draw=red,thick] (-0.3,-2) -- (-1.0,-2+0.5) arc (90:270:.20) -- (-0.3,-2) -- (-1,-0.04-2) arc (90:270:.20) -- cycle node[above,inner sep=22pt, midway] {\tiny{Antenna 2}};
\draw [fill=green!20,draw=green,thick] (-0.3,-4) -- (-1.0,-4+0.5) arc (90:270:.20) -- (-0.3,-4) -- (-1,-0.04-4) arc (90:270:.20) -- cycle node[above,inner sep=22pt, midway] {\tiny{Antenna 3}};
\draw[decorate,decoration={brace,mirror},thick] (0,-5.3) -- (0.6,-5.3) node[below,midway] {{\tiny Tir dans l'axe}};
\draw[decorate,decoration={brace,mirror},thick] (2.2,-5.3) -- (2.6+0.6,-5.3) node[below,midway] {{\tiny Dépointage $\Theta_A$}};
\draw[decorate,decoration={brace,mirror},thick] (4.4,-5.3) -- (5.2+0.6,-5.3) node[below,midway] {{\tiny Dépointage $\Theta_B$}};
\end{tikzpicture}