Skip to content

Commit 27137e9

Browse files
authored
Merge pull request #350 from kushaangupta/main
Add figsize handler for plot_probegroup
2 parents a6e124c + e346621 commit 27137e9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/probeinterface/plotting.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,25 @@ def plot_probegroup(probegroup, same_axes: bool = True, **kargs):
252252

253253
import matplotlib.pyplot as plt
254254

255+
figsize = kargs.pop("figsize", None)
256+
255257
n = len(probegroup.probes)
256258

257259
if same_axes:
258260
if "ax" in kargs:
259261
ax = kargs.pop("ax")
260262
else:
261263
if probegroup.ndim == 2:
262-
fig, ax = plt.subplots()
264+
fig, ax = plt.subplots(figsize=figsize)
263265
else:
264-
fig = plt.figure()
266+
fig = plt.figure(figsize=figsize)
265267
ax = fig.add_subplot(1, 1, 1, projection="3d")
266268
axs = [ax] * n
267269
else:
268270
if "ax" in kargs:
269271
raise ValueError("when same_axes=False, an axes object cannot be passed into this function.")
270272
if probegroup.ndim == 2:
271-
fig, axs = plt.subplots(ncols=n, nrows=1)
273+
fig, axs = plt.subplots(ncols=n, nrows=1, figsize=figsize)
272274
if n == 1:
273275
axs = [axs]
274276
else:

0 commit comments

Comments
 (0)