Skip to content

Commit

Permalink
Merge pull request #85 from danielru/fix/beautification
Browse files Browse the repository at this point in the history
Beautification of plotting scripts
  • Loading branch information
pancetta committed May 30, 2016
2 parents d22fec0 + a594236 commit fe0982f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions examples/acoustic_1d_imex/plot_dispersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ def findomega(stab_fh):
fs = 8
fig = plt.figure()
plt.plot(k_vec, (U_speed+c_speed)+np.zeros(np.size(k_vec)), '--', color='k', linewidth=1.5, label='Exact')
plt.plot(k_vec, phase[1,:], '-', color='g', linewidth=1.5, label='DIRK('+str(dirkts.order)+')')
plt.plot(k_vec, phase[2,:], '-+', color='r', linewidth=1.5, label='IMEX('+str(rkimex.order)+')', markevery=5, mew=1.0)
plt.plot(k_vec, phase[0,:], '-o', color='b', linewidth=1.5, label='SDC('+str(K)+')', markevery=5, markersize=fs/2)
plt.plot(k_vec, phase[1,:], '-', color='g', linewidth=1.5, label='DIRK('+str(dirkts.order)+')')
plt.plot(k_vec, phase[2,:], '-+', color='r', linewidth=1.5, label='IMEX('+str(rkimex.order)+')', markevery=(2,3), mew=1.0)
plt.plot(k_vec, phase[0,:], '-o', color='b', linewidth=1.5, label='SDC('+str(K)+')', markevery=(1,3), markersize=fs/2)
plt.xlabel('Wave number', fontsize=fs, labelpad=0.25)
plt.ylabel('Phase speed', fontsize=fs, labelpad=0.5)
plt.xlim([k_vec[0], k_vec[-1:]])
Expand All @@ -156,8 +156,8 @@ def findomega(stab_fh):
fig = plt.figure()
plt.plot(k_vec, 1.0+np.zeros(np.size(k_vec)), '--', color='k', linewidth=1.5, label='Exact')
plt.plot(k_vec, amp_factor[1,:], '-', color='g', linewidth=1.5, label='DIRK('+str(dirkts.order)+')')
plt.plot(k_vec, amp_factor[2,:], '-+', color='r', linewidth=1.5, label='IMEX('+str(rkimex.order)+')', markevery=5, mew=1.0)
plt.plot(k_vec, amp_factor[0,:], '-o', color='b', linewidth=1.5, label='SDC('+str(K)+')', markevery=5, markersize=fs/2)
plt.plot(k_vec, amp_factor[2,:], '-+', color='r', linewidth=1.5, label='IMEX('+str(rkimex.order)+')', markevery=(2,3), mew=1.0)
plt.plot(k_vec, amp_factor[0,:], '-o', color='b', linewidth=1.5, label='SDC('+str(K)+')', markevery=(1,3), markersize=fs/2)
plt.xlabel('Wave number', fontsize=fs, labelpad=0.25)
plt.ylabel('Amplification factor', fontsize=fs, labelpad=0.5)
fig.gca().tick_params(axis='both', labelsize=fs)
Expand Down
14 changes: 7 additions & 7 deletions examples/fwsw/plot_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
pparams['u0'] = 1.0
swparams = {}
### SET TYPE OF QUADRATURE NODES ###
#swparams['collocation_class'] = collclass.CollGaussLobatto
swparams['collocation_class'] = collclass.CollGaussLobatto
#swparams['collocation_class'] = collclass.CollGaussLegendre
swparams['collocation_class'] = collclass.CollGaussRadau_Right
#swparams['collocation_class'] = collclass.CollGaussRadau_Right

### SET NUMBER OF QUADRATURE NODES ###
swparams['num_nodes'] = 3
swparams['num_nodes'] = 4

### SET NUMBER OF ITERATIONS - SET K=0 FOR COLLOCATION SOLUTION ###
K = 5
Expand Down Expand Up @@ -80,12 +80,12 @@
stab[j,i] = stab_fh

###
rcParams['figure.figsize'] = 2.5, 2.5
rcParams['figure.figsize'] = 1.5, 1.5
fs = 8
fig = plt.figure()
#pcol = plt.pcolor(lambda_s.imag, lambda_f.imag, np.absolute(stab), vmin=0.99, vmax=2.01)
#pcol.set_edgecolor('face')
levels = np.array([0.25, 0.5, 0.75, 0.9, 1.01])
levels = np.array([0.25, 0.5, 0.75, 0.9, 1.1])
# levels = np.array([1.0])
CS1 = plt.contour(lambda_s.imag, lambda_f.imag, np.absolute(stab), levels, colors='k', linestyles='dashed')
CS2 = plt.contour(lambda_s.imag, lambda_f.imag, np.absolute(stab), [1.0], colors='k')
Expand All @@ -103,8 +103,8 @@
plt.gca().tick_params(axis='both', which='both', labelsize=fs)
plt.xlim([0.0, lam_s_max])
plt.ylim([0.0, lam_f_max])
plt.xlabel('$\Delta t \lambda_{slow}$', fontsize=fs, labelpad=2.0)
plt.ylabel('$\Delta t \lambda_{fast}$', fontsize=fs)
plt.xlabel('$\Delta t \lambda_{slow}$', fontsize=fs, labelpad=0.0)
plt.ylabel('$\Delta t \lambda_{fast}$', fontsize=fs, labelpad=0.0)
plt.title(r'$M=%1i$, $K=%1i$' % (swparams['num_nodes'],K), fontsize=fs)
#plt.show()
filename = 'stability-K'+str(K)+'-M'+str(swparams['num_nodes'])+'.pdf'
Expand Down

0 comments on commit fe0982f

Please sign in to comment.