forked from UW-ERSL/TOuNN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotUtil.py
More file actions
25 lines (23 loc) · 798 Bytes
/
Copy pathplotUtil.py
File metadata and controls
25 lines (23 loc) · 798 Bytes
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
import matplotlib.pyplot as plt
from matplotlib import colors
import numpy as np
class Plotter:
def plotConvergence(self, convg):
plt.figure();
for key in convg:
y = np.array(convg[key]);
plt.semilogy(y, label = str(key));
plt.xlabel('Iterations');
plt.ylabel(str(key));
plt.grid('True')
plt.figure();
def plotDensity(self, xy, density, titleStr):
fig, ax = plt.subplots();
plt.subplot(1,1,1);
plt.imshow(-np.flipud(density.T), cmap='gray',\
interpolation='none',norm=colors.Normalize(vmin=-1,vmax=0))
plt.axis('Equal')
plt.title(titleStr)
plt.grid(False)
fig.canvas.draw();
plt.pause(0.01)