8000 Move float() casting in Rectangle patch by dstansby · Pull Request #8938 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Move float() casting in Rectangle patch #8938

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 6 commits into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
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
Added test for units with Rectangle
Update test_units_patches.py

Update test_units_patches.py
  • Loading branch information
TD22057 authored and dstansby committed Jul 26, 2017
commit cd45b6af93dc562cc4286ce3aea0e59eff0307b4
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions lib/matplotlib/tests/test_units_patches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Tests using patches with units.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches


@image_comparison(baseline_images=['units_rectangle'], extensions=['png'])
def test_units_rectangle():
import matplotlib.testing.jpl_units as U
U.register()

p = mpatches.Rectangle((5*U.km, 6*U.km), 1*U.km, 2*U.km)

fig = plt.figure()
ax = plt.subplot(111)
ax.add_patch(p)
ax.set_xlim([4*U.km, 7*U.km])
ax.set_ylim([5*U.km, 9*U.km])
0