Skip to content

Commit

Permalink
[FIX] - updated test_utils_002_RandomParameters in test_utils.py for …
Browse files Browse the repository at this point in the history
…plot stability using "qt5agg" and removed savefig
  • Loading branch information
Konstantin Weise committed Jul 22, 2024
1 parent d3a998b commit 819d87a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# test options
folder = 'tmp' # output folder
plot = False # plot and save output
plot = True # plot and save output
matlab = False # test Matlab functionality
save_session_format = ".pkl" # file format of saved gpc session ".hdf5" (slow) or ".pkl" (fast)
seed = 1 # random seed for grids
Expand Down Expand Up @@ -159,15 +159,16 @@ def test_utils_002_RandomParameters(self):

if plot:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = parameters["x1"].plot_pdf()
ax = parameters["x2"].plot_pdf()
ax = parameters["x3"].plot_pdf()
ax = parameters["x4"].plot_pdf()
ax = parameters["x5"].plot_pdf()
ax = parameters["x6"].plot_pdf()
ax.legend(["x1", "x2", "x3", "x4", "x5", "x6"])
ax.savefig(os.path.join(folder, test_name) + ".png")
import matplotlib
matplotlib.use("qt5agg")
parameters["x1"].plot_pdf()
parameters["x2"].plot_pdf()
parameters["x3"].plot_pdf()
parameters["x4"].plot_pdf()
parameters["x5"].plot_pdf()
parameters["x6"].plot_pdf()
plt.legend(["x1", "x2", "x3", "x4", "x5", "x6"])
plt.savefig(os.path.join(folder, test_name) + ".png")

print("done!\n")

Expand Down

0 comments on commit 819d87a

Please sign in to comment.