From 1f7860ddcd4db7c272b4ff6aa74801c295d36e39 Mon Sep 17 00:00:00 2001 From: Kushaan Gupta Date: Thu, 15 Jan 2026 14:56:15 -0500 Subject: [PATCH 1/2] Enhance plot_probegroup to handle varying contact colors & values for each probe --- src/probeinterface/plotting.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/probeinterface/plotting.py b/src/probeinterface/plotting.py index ce535cf..f71c15e 100644 --- a/src/probeinterface/plotting.py +++ b/src/probeinterface/plotting.py @@ -307,8 +307,21 @@ def plot_probegroup(probegroup, same_axes: bool = True, **kargs): kargs["zlims"] = None kargs["title"] = False + + cum_contact_cnt = 0 + total_contacts = sum(p.get_contact_count() for p in probegroup.probes) + for i, probe in enumerate(probegroup.probes): - plot_probe(probe, ax=axs[i], **kargs) + n = probe.get_contact_count() + kargs_probe = kargs.copy() + for key in ["contacts_colors", "contacts_values", "text_on_contact"]: + if key in kargs and kargs[key] is not None: + val = kargs[key] + if hasattr(val, "__len__") and len(val) == total_contacts: + kargs_probe[key] = val[cum_contact_cnt : cum_contact_cnt + n] + + plot_probe(probe, ax=axs[i], **kargs_probe) + cum_contact_cnt += n def plot_probe_group(probegroup, same_axes: bool = True, **kargs): From 8c1db269ea04ad911bea018bada2d63ac8bd5728 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:57:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/probeinterface/plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/probeinterface/plotting.py b/src/probeinterface/plotting.py index f71c15e..92220ee 100644 --- a/src/probeinterface/plotting.py +++ b/src/probeinterface/plotting.py @@ -319,7 +319,7 @@ def plot_probegroup(probegroup, same_axes: bool = True, **kargs): val = kargs[key] if hasattr(val, "__len__") and len(val) == total_contacts: kargs_probe[key] = val[cum_contact_cnt : cum_contact_cnt + n] - + plot_probe(probe, ax=axs[i], **kargs_probe) cum_contact_cnt += n