Skip to content

Commit 926c8d3

Browse files
committed
Modifications to present two plots to screen rather than to png file.
1 parent dad3cec commit 926c8d3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

monte-carlo/fluence-vs-number-of-photons.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565

6666
# plot 4 cases in grid
6767
fig, axes = plt.subplots(nrows=2,ncols=2)
68+
fig.suptitle("Fluence vs n")
6869
xLabel = "ρ [mm]"
6970
yLabel = "z [mm]"
7071
title = "log(Φ(ρ,z)) [mm-2]"
@@ -147,12 +148,10 @@
147148
cbar = fig.colorbar(im3, cmap=colormap, location='right', shrink=0.6, pad=0.05)
148149
cbar.set_ticks(cbar_ticks)
149150

150-
plt.savefig('fluence-vs-n.png')
151-
152151
# plot relative error as a function of N, the number of photons simulated
153152
# plot 4 cases in grid
154-
plt.clf() # clear fluence figure
155153
fig, axes = plt.subplots(nrows=2,ncols=2)
154+
fig.suptitle("Relative error vs n")
156155
xLabel = "ρ [mm]"
157156
yLabel = "z [mm]"
158157
title = "relerror(Φ(ρ,z))"
@@ -199,5 +198,5 @@
199198
axes[1,1].text(10, 90, 'N=10000')
200199
cbar = fig.colorbar(im3, cmap=colormap, location='right', shrink=0.6, pad=0.05)
201200

202-
plt.savefig('relative-error-vs-n.png')
201+
plt.show()
203202

0 commit comments

Comments
 (0)