【问题标题】:Combine TikZ animation with ggplot animation结合 TikZ 动画和 ggplot 动画
【发布时间】:2016-07-26 10:00:26
【问题描述】:

我正在尝试重新创建 this animation。我想要的是在 TikZ 中有机械系统,在 R/ggplot 中有绘图。最后,我想在演示文稿中使用所有这些,最好是在 R markdown/sweave 演示文稿中。

这可能吗?

我目前拥有的是机械系统的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

【问题讨论】:

    标签: r animation markdown sweave tikz


    【解决方案1】:

    可能为时已晚,但我只想提一下未来可能的解决方案:

    在当前的 TikZ 开发版本中,有一个新的动画库可以用来制作动画 SVGDocumentation of the animations-library。也许这些信息可以帮助你。我不知道如何使用该工具以及它能够做什么,但我已经看到了使用该库制作动画图形的投影仪演示。它似乎运作良好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      相关资源
      最近更新 更多