matplotlib简单的定时动画示例

时间:2017-03-13 19:26:07

标签: python-3.x animation matplotlib

我正在为matplotlib寻找一个简单的定时动画示例。我在matplotlib库中找到了几个对subplot示例的引用,但是我需要看一些更基本的代码来建模我的代码。

我在x轴上有10个离散值,在y轴上有一个连续值(想想直方图)。 x和y之间的关系变化超过500次。

这是一个只有5个类别和5个步骤的数据集的可疑截断版本:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
  <div class="row">
    <div class="col-xs-8 col-xs-offset-2">
      <h5 style="text-align:center;">
        The buttons have alt="" text that needs to be added to the contents of the textbox when pressed.
      </h5>
      <div style="box-shadow:2px 2px 5px black; min-height:200px; padding:25px; margin:10px;">
        <textarea id="the_box" class="form-control" rows="3"></textarea>
        <button class="btn" id="hotlinkConcerned" alt="I am very concerned.">Concerned</button>

        <button class="btn" id="hotlinkHappy" alt="I am very happy.">Happy</button>
      </div>
    </div>

  </div>

</div>

如何在matplotlib中为这样的数据集设置动画?

1 个答案:

答案 0 :(得分:1)

以下是this question使用上面的数据回答的示例。

enter image description here

from sqlalchemy.orm import sessionmaker