Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{standalone}
- usepackage{tikz}
- usetikzlibrary{positioning}
- usepackage{animate}
- usepackage{xsavebox}
- usepackage{pgf}
- begin{document}
- newcommandXA{1}
- newcommandYA{10}
- newcommandLengthProbe{3.5}
- newcommandwidthProbe{0.5}
- newcommandcontactPoint{0.1}
- newcommandneuronX{3}
- newcommandneuronY{8.5}
- newcommandneuronYTwo{3.5}
- gdefoldy{0}
- %empty first frame:
- xsbox{mygraph}{tikz path[use as bounding box] (0,0) rectangle (11.5,12);}%
- makebox[0pt][l]{xusebox{mygraph}}%
- xsbox{mygraph}{%
- begin{tikzpicture}
- path[use as bounding box] (0,0) rectangle (11.5,12);
- draw (XA,YA) -- (XA,YA-LengthProbe) -- (XA+widthProbe,YA-LengthProbe -widthProbe) --(XA+widthProbe,YA) -- (XA,YA); %linear probes
- foreach gx in {0}{ %contact point on the first linear probe
- foreach ix in {1,3}
- draw (XA+0.1,YA-ix+gx) rectangle (XA+contactPoint+0.1,YA-ix-contactPoint+gx);
- foreach ix in {0,2}
- draw (XA+0.3,YA-ix-0.2+gx) rectangle (XA+contactPoint+0.3,YA-ix-contactPoint-0.2+gx);
- }
- node[] at (10.5,9.5) {Channel 1};
- node[] at (10.5,8.5) {Channel 2};
- node[] at (10.5,7.5) {Channel 3};
- node[] at (10.5,6.5) {Channel 4};
- node [circle,draw] at (neuronX,neuronY) (N1) {};
- node [circle,draw,below right = 0.2cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.15cm and -0.2cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,above right = 0.05cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.8cm and 0.3cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,below right = 1.2cm and 0.2cm of N1] () {};
- node [circle,draw,below left = 1.4cm and 0.0cm of N1] () {};
- node[yshift = 10.5cm,xshift = 3.5cm] () {Before Optimisation};
- coordinate (A1) at (2.5,10);
- coordinate (B1) at (2,6);
- coordinate (A2) at (4 , 10);
- coordinate (B2) at (4.5 , 6);
- end{tikzpicture}
- %repeat previous graph
- makebox[0pt][l]{xusebox{mygraph}}%
- }
- begin{animateinline}[controls]{8}
- xusebox{mygraph}
- newframe
- multiframe{30}{rx=6.9+0.05}{%
- pgfmathsetmacro{y}{0.1*rand}%
- xsbox{mygraph}{%
- %repeat previous graph
- makebox[0pt][l]{xusebox{mygraph}}%
- %append new line segment
- begin{tikzpicture}
- foreach x in {-1,0,1,2}{
- path[use as bounding box] (0,0) rectangle (11.5,12);
- pgfmathsetmacro{oldx}{rx-0.05}
- ifdim 7.3pt < rx pt relax
- ifdim 7.8pt > rx ptrelax
- draw [red,line cap=round] (oldx,oldy+7.6+x) -- (rx,y+7.6+x);
- node[yshift = 10.5cm,xshift = 7.5cm] () {Light Pulse};
- shade[top color=orange,bottom color=orange,middle color = red,fill opacity=0.4] (A2) to [bend right=10] (B2) to [] (B1) to [bend right=10] (A1) to (A2);
- node [circle,draw] at (neuronX,neuronY) (N1) {};
- node [circle,draw,below right = 0.2cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.15cm and -0.2cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,above right = 0.05cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.8cm and 0.3cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,below right = 1.2cm and 0.2cm of N1] () {};
- node [circle,draw,below left = 1.4cm and 0.0cm of N1] () {};
- else
- draw [line cap=round] (oldx,oldy+7.3+x) -- (rx,y+7.3+x);
- shade[top color=white,bottom color=white,middle color = white] (A2) to [bend right=10] (B2) to [] (B1) to [bend right=10] (A1) to (A2);
- node [circle,draw] at (neuronX,neuronY) (N1) {};
- node [circle,draw,below right = 0.2cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.15cm and -0.2cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,above right = 0.05cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.8cm and 0.3cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,below right = 1.2cm and 0.2cm of N1] () {};
- node [circle,draw,below left = 1.4cm and 0.0cm of N1] () {};
- fi
- else
- draw [line cap=round] (oldx,oldy+7.3+x) -- (rx,y+7.3+x);
- shade[top color=white,bottom color=white,middle color = white]
- (A2) to [bend right=10] (B2) to [] (B1) to [bend right=10] (A1) to
- (A2);
- node [circle,draw] at (neuronX,neuronY) (N1) {};
- node [circle,draw,below right = 0.2cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.15cm and -0.2cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,above right = 0.05cm and 0.2cm of N1] () {};
- node [circle,draw,below right = 0.8cm and 0.3cm of N1] () {};
- node [circle,draw,below left = 0.6cm and -0.2cm of N1] () {};
- node [circle,draw,below right = 1.2cm and 0.2cm of N1] () {};
- node [circle,draw,below left = 1.4cm and 0.0cm of N1] () {};
- fi
- }
- end{tikzpicture}%
- }%
- xusebox{mygraph}%
- xdefoldy{y}%
- }
- end{animateinline}
- end{document}
Add Comment
Please, Sign In to add comment