From f6f5c70372113df2a0a9915ac32befe38a117571 Mon Sep 17 00:00:00 2001 From: Christopher Yeh Date: Tue, 8 Aug 2023 13:44:47 -0700 Subject: [PATCH] Fix plotting bug When pandapower is imported, matplotlib savefig may run into a bug where the GraphicsContextBase._capstyle is set to a str instead of a CapStyle instance. Calling the proper set_capstyle() method solves this issue. --- pandapower/plotting/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandapower/plotting/__init__.py b/pandapower/plotting/__init__.py index 8b71f2bea..11a5090a4 100644 --- a/pandapower/plotting/__init__.py +++ b/pandapower/plotting/__init__.py @@ -16,7 +16,7 @@ class GC(GraphicsContextBase): def __init__(self): super().__init__() - self._capstyle = 'round' + self.set_capstyle('round') def custom_new_gc(self): return GC()