-
Notifications
You must be signed in to change notification settings - Fork 5
/
data_visualization.py
51 lines (36 loc) · 944 Bytes
/
data_visualization.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from mpl_toolkits.mplot3d import axes3d
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from importlib import reload
import matplotlib.animation as animation
from matplotlib import style
from pylab import *
import time
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
def animate(data):
x, y = data
ax1.clear()
ax1.plot(x, y)
ani = animation.FuncAnimation(fig, animate, interval=1000)
plt.show()
def plot_3d_scatter(data):
"""
:param data: tuple: (x_list, y_list, z_list)
"""
fig = plt.figure()
ax = plt.axes(facecolor="1.0")
ax = fig.add_subplot(1, 1, 1)
ax = fig.gca(projection='3d')
x, y, z = data
ax.scatter(x, y, z, alpha=0.8, edgecolors='none', s=30)
plt.title('Test 3d scatter plot')
plt.legend(loc=2)
plt.show()
# def transpose_data(data_xyz):
# """
#
# :param data: tuple: (list, list, list)
# """