Skip to content

Commit

Permalink
add tmin/tmax fix to ps.plots.series()
Browse files Browse the repository at this point in the history
revert nb change
  • Loading branch information
dbrakenhoff committed Feb 17, 2023
1 parent 51f8282 commit 10522d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/examples/08_changing_responses.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"axes = ps.plots.series(\n",
" head=head,\n",
" stresses=[prec, evap, river],\n",
" tmin=pd.Timestamp(\"2000\"),\n",
" tmin=\"2000\",\n",
" labels=[\"Head\\n[m]\", \"Prec\\n[mm/d]\", \"Evap\\n[mm/d]\", \"River [m3/d]\"],\n",
")"
]
Expand Down
6 changes: 6 additions & 0 deletions pastas/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ def series(
bbox=(0, 0, 1, 1), colWidths=(1.5, 1), cellText=stress_stats
)
axes[i, 2].axis("off")

# temporary fix, as set_xlim currently does not work with strings mpl=3.6.1
if tmin is not None:
tmin = Timestamp(tmin)
if tmax is not None:
tmax = Timestamp(tmax)
axes[0, 0].set_xlim([tmin, tmax])
axes[0, 0].minorticks_off()

Expand Down

0 comments on commit 10522d3

Please sign in to comment.