• Skip to main content
  • Skip to primary sidebar

学習記録

リアルタイム描写

2017年12月28日 by 河副 太智 Leave a Comment

動くグラフ

https://www.reddit.com/r/dataisbeautiful/comments/7l9ef7/i_simulated_and_animated_500_instances_of_the/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from matplotlib import pyplot as plt
import numpy as np
import time
from IPython.display import display, clear_output
%matplotlib inline
 
fig = plt.figure(figsize=(16,10))
axe = fig.add_subplot(111)
 
# 繰り返す回数を決める
num = 5
 
for i in range(num):
    A = np.random.randn(1000)
    axe.hist(A,bins=50)
    axe.set_xlim([-4,4])
    axe.set_ylim([0,70])
    display(fig)
    clear_output(wait = True)
    # 最後の出力は消さないので、if文で最後だけ消さないようにする。
    if i != num-1:
        axe.cla()

from IPython.display import display, clear_output

display(fig) 画像を出力します。
clear_output(wait = True) 出力結果を消します。
axeに入れられたグラフデータを削除します。

このエントリーをはてなブックマークに追加

Tweet
[`yahoo` not found]
このエントリーを Google ブックマーク に追加
LinkedIn にシェア
LINEで送る


Filed Under: グラフ

Reader Interactions

コメントを残す コメントをキャンセル

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Primary Sidebar

カテゴリー

  • AWS
  • Bootstrap
  • Dash
  • Django
  • flask
  • GIT(sourcetree)
  • Plotly/Dash
  • VPS
  • その他tool
  • ブログ
  • プログラミング
    • Bokeh
    • css
    • HoloViews
    • Jupyter
    • Numpy
    • Pandas
    • PosgreSQL
    • Python 基本
    • python3
      • webアプリ
    • python3解説
    • scikit-learn
    • scipy
    • vps
    • Wordpress
    • グラフ
    • コマンド
    • スクレイピング
    • チートシート
    • データクレンジング
    • ブロックチェーン
    • 作成実績
    • 時系列分析
    • 機械学習
      • 分析手法
      • 教師有り
    • 異常値検知
    • 自然言語処理
  • 一太郎
  • 数学
    • sympy
      • 対数関数(log)
      • 累乗根(n乗根)
    • 暗号学

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in