diff --git a/scripts/pick_barrier.py b/scripts/pick_barrier.py index 8e5ec54..be63d5a 100644 --- a/scripts/pick_barrier.py +++ b/scripts/pick_barrier.py @@ -41,6 +41,17 @@ import sys from pathlib import Path import cv2 +import matplotlib +# Reason: force an interactive backend so plt.show() actually opens a window. +# Some environments (depending on matplotlibrc / DISPLAY / installed Qt-vs-Tk +# bindings) default to Agg, which silently no-ops the picker. Try the common +# GUI backends in order; fall through to whatever is set if none are available. +for _backend in ("TkAgg", "QtAgg", "Qt5Agg", "GTK3Agg"): + try: + matplotlib.use(_backend, force=True) + break + except (ImportError, ValueError): + continue import matplotlib.pyplot as plt import numpy as np import pandas as pd