Skip to content

Commit

Permalink
Solving matplotlib problem
Browse files Browse the repository at this point in the history
  • Loading branch information
FloraSauerbronn committed Jun 19, 2024
1 parent e98909e commit a2558c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import pytest
import matplotlib
matplotlib.use('agg') # Use the 'agg' backend

import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from gliderpy.plotting import plot_track, plot_transect
from gliderpy.fetchers import GliderDataFetcher
Expand Down Expand Up @@ -39,5 +43,6 @@ def test_plot_transect_multiple_figures(glider_data):
def test_plot_transect_size(glider_data):
# Generate the plot with a specific size
fig, ax = plt.subplots(figsize=(15, 9))
glider_data.plot_transect(var="temperature", ax=ax)
assert fig.get_size_inches() == pytest.approx([15., 9.])
glider_data.plot_transect(var="temperature")
np.testing.assert_array_equal(fig.get_size_inches(), np.array([15., 9.]))

0 comments on commit a2558c7

Please sign in to comment.