Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions advection/simulation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import importlib
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

import advection.advective_fluxes as flx
Expand Down Expand Up @@ -118,6 +119,7 @@ def dovis(self):

# needed for PDF rendering
cb = axes.cbar_axes[0].colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")
cb.solids.set_rasterized(True)
cb.solids.set_edgecolor("face")

Expand Down
2 changes: 2 additions & 0 deletions advection_nonuniform/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import importlib
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

import advection_nonuniform.advective_fluxes as flx
Expand Down Expand Up @@ -145,6 +146,7 @@ def dovis(self):

# needed for PDF rendering
cb = axes.cbar_axes[0].colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")
cb.solids.set_rasterized(True)
cb.solids.set_edgecolor("face")

Expand Down
4 changes: 2 additions & 2 deletions analysis/plotvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def makeplot(plotfile, variable, outfile,
if log:
var = np.log10(var)

plt.imshow(np.transpose(var.v()),
img = plt.imshow(np.transpose(var.v()),
interpolation="nearest", origin="lower",
extent=[myg.xmin, myg.xmax, myg.ymin, myg.ymax])

if not compact:
plt.colorbar()
plt.colorbar(img)

plt.xlabel("x")
plt.ylabel("y")
Expand Down
2 changes: 2 additions & 0 deletions compressible/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import importlib

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

import compressible.BC as BC
Expand Down Expand Up @@ -281,6 +282,7 @@ def dovis(self):

# needed for PDF rendering
cb = axes.cbar_axes[n].colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")
cb.solids.set_rasterized(True)
cb.solids.set_edgecolor("face")

Expand Down
2 changes: 2 additions & 0 deletions compressible_react/simulation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import print_function

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

Expand Down Expand Up @@ -111,6 +112,7 @@ def dovis(self):

# needed for PDF rendering
cb = axes.cbar_axes[n].colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")
cb.solids.set_rasterized(True)
cb.solids.set_edgecolor("face")

Expand Down
6 changes: 4 additions & 2 deletions diffusion/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import importlib
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

import mesh.patch as patch
Expand Down Expand Up @@ -135,7 +136,7 @@ def dovis(self):

myg = self.cc_data.grid

plt.imshow(np.transpose(phi.v()),
img = plt.imshow(np.transpose(phi.v()),
interpolation="nearest", origin="lower",
extent=[myg.xmin, myg.xmax, myg.ymin, myg.ymax],
cmap=self.cm)
Expand All @@ -144,7 +145,8 @@ def dovis(self):
plt.ylabel("y")
plt.title("phi")

plt.colorbar()
cb = plt.colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")

plt.figtext(0.05, 0.0125, "t = {:10.5f}".format(self.cc_data.t))

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_general_alphabeta_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,27 @@ def test_general_poisson_dirichlet(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_general_beta_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,27 @@ def test_general_poisson_dirichlet(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_general_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,27 @@ def test_general_poisson_dirichlet(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_general_dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,27 +150,27 @@ def test_general_poisson_dirichlet(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_general_inhomogeneous.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,27 @@ def test_general_poisson_inhomogeneous(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
12 changes: 6 additions & 6 deletions examples/multigrid/mg_test_vc_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def test_vc_constant(N):

plt.figure(num=1, figsize=(5.0, 5.0), dpi=100, facecolor='w')

plt.imshow(np.transpose(c[g.ilo:g.ihi+1, g.jlo:g.jhi+1]),
img1 = plt.imshow(np.transpose(c[g.ilo:g.ihi+1, g.jlo:g.jhi+1]),
interpolation="nearest", origin="lower",
extent=[g.xmin, g.xmax, g.ymin, g.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.savefig("mg_alpha.png")

Expand Down Expand Up @@ -117,27 +117,27 @@ def test_vc_constant(N):

plt.subplot(121)

plt.imshow(np.transpose(v[a.ilo:a.ihi+1, a.jlo:a.jhi+1]),
img2 = plt.imshow(np.transpose(v[a.ilo:a.ihi+1, a.jlo:a.jhi+1]),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img2)

plt.subplot(122)

plt.imshow(np.transpose(e[a.ilo:a.ihi+1, a.jlo:a.jhi+1]),
img3 = plt.imshow(np.transpose(e[a.ilo:a.ihi+1, a.jlo:a.jhi+1]),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img3)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_vc_dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@ def test_vc_poisson_dirichlet(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
8 changes: 4 additions & 4 deletions examples/multigrid/mg_test_vc_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,27 @@ def test_vc_poisson_periodic(N, store_bench=False, comp_bench=False,

plt.subplot(121)

plt.imshow(np.transpose(v.v()),
img1 = plt.imshow(np.transpose(v.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("nx = {}".format(nx))

plt.colorbar()
plt.colorbar(img1)

plt.subplot(122)

plt.imshow(np.transpose(e.v()),
img2 = plt.imshow(np.transpose(e.v()),
interpolation="nearest", origin="lower",
extent=[a.xmin, a.xmax, a.ymin, a.ymax])

plt.xlabel("x")
plt.ylabel("y")
plt.title("error")

plt.colorbar()
plt.colorbar(img2)

plt.tight_layout()

Expand Down
2 changes: 2 additions & 0 deletions swe/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import importlib

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

import swe.derives as derives
Expand Down Expand Up @@ -263,6 +264,7 @@ def dovis(self):

# needed for PDF rendering
cb = axes.cbar_axes[n].colorbar(img)
cb.formatter = matplotlib.ticker.FormatStrFormatter("")
cb.solids.set_rasterized(True)
cb.solids.set_edgecolor("face")

Expand Down