Skip to content

Commit

Permalink
Now for non-DMDA results one can plot a single component using "-dof …
Browse files Browse the repository at this point in the history
…N -c k" where k=0,1,...,N.
  • Loading branch information
bueler committed Oct 13, 2021
1 parent f863ec7 commit 5f6aca9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions c/ch5/plotTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@
plt.pause(0.1)
print('.')
else:
for k in range(dims[0]):
plt.plot(t,U[k],label='y[%d]' % k)
if args.dof > 1:
print('plotting only component %d ...' % args.c)
plt.plot(t,U[args.c],label='y[%d]' % args.c)
else:
for k in range(dims[0]):
plt.plot(t,U[k],label='y[%d]' % k)
plt.xlabel('t')
plt.legend()
if args.filename:
print('writing file %s' % args.filename)
plt.savefig(args.filename)
else:
plt.show()

0 comments on commit 5f6aca9

Please sign in to comment.