2016-07-26 79 views
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中。

回答

0

它可能是遲,但只提對未來的一個可能的解決方案:

在TikZ當前開發版本也可以用於生產動畫SVGs Documentation of the animations-library一個新的動畫庫。也許這些信息可以幫助你。我不知道如何使用這個工具以及它能做什麼,但是我已經看到了使用這個動畫圖形庫的Beamer演示文稿。它似乎運作良好。