Skip to content

Commit 3d5e1ea

Browse files
committed
Fix some bugs in plotting
1 parent 5182261 commit 3d5e1ea

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

wirecell/plot/__main__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,10 @@ def comp1d(ctx, name, tier, frames, chmin, chmax, unit, xrange,
162162
else:
163163
frames = [f.strip() for f in frames.split(",")]
164164

165-
# too high and the pixel marker disappears.
166-
opts=dict(dpi=150)
167165
if single:
168-
out = plottools.NameSingleton(output, **opts)
166+
out = plottools.NameSingleton(output, dpi=150)
169167
else:
170-
out = plottools.pages(output, **opts)
168+
out = plottools.pages(output)
171169

172170
markers=[m.strip() for m in markers.split(' ')]
173171
plotter(datafiles, out,

wirecell/plot/frames.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ def extract(fname, dat):
293293
if interactive :
294294
plt.show()
295295
out.savefig(fig)
296+
if not interactive and hasattr(out, "close"):
297+
out.close()
296298

297299
def channel_correlation(datafile, out, tier='orig', chmin=0, chmax=1, unit='ADC', interactive=False):
298300
'''

wirecell/util/plottools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __exit__(self, typ, value, traceback):
119119

120120

121121

122-
def pages(name, format=None, single=False):
122+
def pages(name, format=None, single=False, **kwds):
123123
'''
124124
Return an instance of something like a PdfPages for the given format.
125125
@@ -142,10 +142,10 @@ def pages(name, format=None, single=False):
142142
'''
143143

144144
if name.endswith(".pdf") or format=="pdf":
145-
return PdfPages(name)
145+
return PdfPages(name, **kwds)
146146
if single:
147147
return NameSingleton(name, format)
148-
return NameSequence(name)
148+
return NameSequence(name, **kwds)
149149

150150

151151
def lg10(arr, eps = None, scale=None):

0 commit comments

Comments
 (0)