8000 Use left/right top/bottom instead of width/height in Rectangle by dstansby · Pull Request #9072 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Use left/right top/bottom instead of width/height in Rectangle #9072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 4, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add timedelta rectangle test
  • Loading branch information
dstansby committed Dec 3, 2017
commit 8208ddc9d88df4e0730a8ada99e815498a8712e3
12 changes: 12 additions & 0 deletions lib/matplotlib/tests/test_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,15 @@ def test_connection_patch():
axesA=ax2, axesB=ax1,
arrowstyle="->")
ax2.add_artist(con)


def test_datetime_rectangle():
# Check that creating a rectangle with timedeltas doesn't fail
from datetime import datetime, timedelta

start = datetime(2017, 1, 1, 0, 0, 0)
delta = timedelta(seconds=16)
patch = mpatches.Rectangle((start, 0), delta, 1)

fig, ax = plt.subplots()
ax.add_patch(patch)
0