Skip to content

Commit

Permalink
fix(plot): use nanmin and nanmax to get axes lims
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Jul 23, 2024
1 parent 5aabb8d commit 3ed032b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/baec/measurements/settlement_rod_measurement_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from functools import cache
from typing import List

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.axes import Axes
Expand Down Expand Up @@ -263,7 +264,9 @@ def plot_z_time(self, axes: Axes | None = None) -> Axes:
legend=True,
)

axes.set_ylim(df[z_cols].values.min() - 0.5, df[z_cols].values.max() + 0.5)
axes.set_ylim(
np.nanmin(df[z_cols].values) - 0.5, np.nanmax(df[z_cols].values) + 0.5
)
axes.grid()

axes.set_ylabel(self.coordinate_reference_systems.vertical_datum_and_units)
Expand Down

0 comments on commit 3ed032b

Please sign in to comment.