From 3ed032be38ce189b5a4a940ac364af1b1c22e9f1 Mon Sep 17 00:00:00 2001 From: Robin Wimmers Date: Tue, 23 Jul 2024 09:58:19 +0200 Subject: [PATCH] fix(plot): use nanmin and nanmax to get axes lims --- src/baec/measurements/settlement_rod_measurement_series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/baec/measurements/settlement_rod_measurement_series.py b/src/baec/measurements/settlement_rod_measurement_series.py index 2cc7275..5c94a6c 100644 --- a/src/baec/measurements/settlement_rod_measurement_series.py +++ b/src/baec/measurements/settlement_rod_measurement_series.py @@ -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 @@ -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)