Skip to content

Commit

Permalink
Check before switching backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jemrobinson committed Jul 2, 2018
1 parent c1579ea commit bba617c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/decorations/test_decorations_atlas_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def test_atlas_text_incorrect_alignment():


def test_atlas_text_renderer():
matplotlib.pyplot.switch_backend("TkAgg")
with mATLASplotlib.canvases.Simple() as canvas:
canvas.plot_dataset([0, 1], [5, 10], style="scatter")
canvas.add_ATLAS_label(0.5, 0.5, plot_type="Internal", anchor_to="upper right")
matplotlib.pyplot.switch_backend("pdf")
if hasattr(matplotlib.backends, "backend_agg"):
matplotlib.pyplot.switch_backend("agg")
with mATLASplotlib.canvases.Simple() as canvas:
canvas.plot_dataset([0, 1], [5, 10], style="scatter")
canvas.add_ATLAS_label(0.5, 0.5, plot_type="Internal", anchor_to="upper right")
matplotlib.pyplot.switch_backend("pdf")

0 comments on commit bba617c

Please sign in to comment.