From cdb1ea09b5173576d795b99debc30219072a095d Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 25 May 2022 11:22:16 +0400 Subject: feat: improve plotting --- src/plotter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plotter.py b/src/plotter.py index d19d344..c803f3f 100644 --- a/src/plotter.py +++ b/src/plotter.py @@ -22,7 +22,6 @@ class Plotter: def plot(self, model, normalize=True, density=False, save_path=''): self.clear() - self.patch = axes.add_patch(Rectangle((0, 0), *reversed(model.bfs_size), color='gray')) axes.set_title('Velocity field (normalized)') plt.suptitle(f'Avg mass source per grid point = {model.avg_error()}') plt.xlabel('X') @@ -41,14 +40,14 @@ class Plotter: density = density or int((max(model.domain_size) / model.step) / 40) + plt.contourf(x, y, model.p) + # self.patch = axes.add_patch(Rectangle((0, 0), *reversed(model.bfs_size), color='gray')) + # TODO: allow using streamplot self.plt = plt.quiver( x[::density, ::density], y[::density, ::density], u[::density, ::density], v[::density, ::density], - model.p[::density, ::density], - scale=30, - cmap='inferno' ) self.colorbar = plt.colorbar(label='Pressure') -- cgit v1.2.3