Skip to content

Commit

Permalink
fix #571 warnings tracksolve (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrakenhoff committed May 3, 2023
1 parent 330a808 commit 9261a90
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pastas/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@ def initialize_figure(
self.ax0, self.ax1, self.ax2 = self.axes

# share x-axes between 2nd and 3rd axes
self.ax1.get_shared_x_axes().join(self.ax1, self.ax2)
self.ax1.sharex(self.ax2)
for t in self.ax1.get_xticklabels():
t.set_visible(False)

# plot oseries
self.ax0.plot(
Expand Down Expand Up @@ -869,7 +871,7 @@ def plot_track_solve(self, params: ArrayLike) -> None:
range(self.itercount + 1), np.array(self.rmse_res)
)
self.r_rmse_plot_dot.set_data(
np.array([self.itercount]), np.array(self.rmse_res[-1])
np.array([self.itercount]), np.array([self.rmse_res[-1]])
)

if self.ml.settings["noise"] and self.ml.noisemodel is not None:
Expand All @@ -878,12 +880,14 @@ def plot_track_solve(self, params: ArrayLike) -> None:
range(self.itercount + 1), np.array(self.rmse_noise)
)
self.n_rmse_plot_dot.set_data(
np.array([self.itercount]), np.array(self.rmse_noise[-1])
np.array([self.itercount]), np.array([self.rmse_noise[-1]])
)

# update parameter plots
for j, (p1, p2) in enumerate(self.param_plot_handles):
p1.set_data(np.array([self.itercount]), np.abs(self.parameters.iloc[-1, j]))
p1.set_data(
np.array([self.itercount]), np.abs([self.parameters.iloc[-1, j]])
)
p2.set_data(
range(self.itercount + 1), self.parameters.iloc[:, j].abs().values
)
Expand Down

0 comments on commit 9261a90

Please sign in to comment.