From ef9cac09d21b3485ec4f061a7508fccb186acc94 Mon Sep 17 00:00:00 2001 From: Benjamin Bean Date: Fri, 24 Jan 2025 18:17:35 -0700 Subject: [PATCH] fix matplotlib support on Mac --- opencsp/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opencsp/__init__.py b/opencsp/__init__.py index 15b8bd1bb..04977feb3 100644 --- a/opencsp/__init__.py +++ b/opencsp/__init__.py @@ -18,6 +18,15 @@ import copy import sys import argparse +import platform + + +if platform.system() == 'Darwin': + # On Mac, force matplotlib to use the TkAgg. + # Maybe we consider doing this for all systems? + import matplotlib + + matplotlib.use('TkAgg') def _opencsp_settings_dirs() -> list[str]: