1
我試圖重新創建this animation。我想要的是TikZ中的機械系統和R/ggplot中的圖。最後,我想在演示中使用所有這些,理想情況下在R markdown/sweave演示文稿中。將TikZ動畫與ggplot動畫結合
這甚至可能嗎?
什麼我到現在爲止是機械系統的TikZ:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, patterns, decorations.pathmorphing, decorations.markings}
\begin{document}
\tikzstyle{blocksmall} = [draw, rectangle, minimum height = 0.25cm, minimum width = 0.25cm]
\tikzstyle{block} = [draw, rectangle, minimum height = 1cm, minimum width = 2cm]
\tikzstyle{spring} = [decorate, decoration = {zigzag, pre length = 0.3cm, post length = 0.3cm, segment length = 6}]
\tikzstyle{ground} = [fill, pattern = north east lines, draw = none, minimum width = 0.75cm, minimum height = 0.3cm]
\begin{tikzpicture}
\node [blocksmall] (u) {$u$};
\node [block, right of = u, node distance = 3cm] (m) {$m$};
\node (ground) [ground, anchor = north, yshift = -0.25cm, xshift = 0cm, minimum width = 7cm] at (m.south) {};
\draw (ground.north east) -- (ground.north west);
\draw (m.south west) ++ (0.4cm,-0.125cm) circle (0.125cm) (m.south east) ++ (-0.4cm,-0.125cm) circle (0.125cm);
\draw [spring] (u) -- node[auto, yshift = 0.15cm] {$k$} (m);
\end{tikzpicture}
\end{document}
編輯1:我發現這個動畫與Raphael.js和自定義linear.js完成。然後將所有內容合併到freq.html中。