Skip to content

Commit

Permalink
Support matplotlib backend "agg" for CueFigure
Browse files Browse the repository at this point in the history
"agg" is the terminal Linux backend, since the user should be aware that
nothing can be shown in this case and raising an error prevents testing
certain functionalities, we support it and do the same commands as for
the "inline" backend.
  • Loading branch information
agoscinski committed Nov 29, 2024
1 parent 40d7b0f commit 93e1198
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scwidgets/cue/_widget_cue_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(
if matplotlib.backends.backend in [
"module://matplotlib_inline.backend_inline",
"macosx",
"agg",
]:
# we close the figure so the figure is only contained in this widget
# and not shown using plt.show()
Expand Down Expand Up @@ -104,6 +105,7 @@ def clear_display(self, wait=False):
if matplotlib.backends.backend in [
"module://matplotlib_inline.backend_inline",
"macosx",
"agg",
]:
self.clear_figure()
self.clear_output(wait=wait)
Expand Down Expand Up @@ -131,6 +133,7 @@ def draw_display(self):
if matplotlib.backends.backend in [
"module://matplotlib_inline.backend_inline",
"macosx",
"agg",
]:
with self:
display(self.figure)
Expand Down

0 comments on commit 93e1198

Please sign in to comment.