1
from mms_rans_p2p1_keps_tools import *
4
import matplotlib.pyplot as plt
9
python function_printer.py AA BB CC DD .. n_rows
11
AA, BB, CC, DD are names of functions in mms_rans_p2p1_keps_tools.py (any number can be entered)
12
n_rows is the number of rows to display the functions on
16
for arg in sys.argv[1:-1]:
18
n_rows = int(sys.argv[-1])
20
matplotlib.rcParams['xtick.direction'] = 'out'
21
matplotlib.rcParams['ytick.direction'] = 'out'
22
plt.subplots_adjust(left=None, bottom=None, right=None, top=None,
23
wspace=0.2, hspace=0.2)
26
X = linspace(0.0, pi, res)
27
Y = linspace(0.0, pi, res)
30
data = empty([len(functions), res, res])
31
for z, function in enumerate(functions):
32
for j, x[0] in enumerate(X):
33
for i, x[1] in enumerate(Y):
34
data[z,i,j] = eval(function + '(x)')
35
plt.subplot(n_rows, len(functions)/n_rows + 1, z+1)
36
CS = plt.contour(X, Y, data[z])
37
plt.clabel(CS, inline=1, fontsize=10)
38
plt.title(functions[z])