8000 Added test for units with Rectangle · matplotlib/matplotlib@e1a93b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit e1a93b2

Browse files
TD22057dstansby
authored andcommitted
Added test for units with Rectangle
Update test_units_patches.py Update test_units_patches.py
1 parent d961906 commit e1a93b2

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Tests using patches with units.
3+
"""
4+
from __future__ import (absolute_import, division, print_function,
5+
unicode_literals)
6+
7+
from matplotlib.testing.decorators import image_comparison
8+
import matplotlib.pyplot as plt
9+
import matplotlib.patches as mpatches
10+
11+
12+
@image_comparison(baseline_images=['units_rectangle'], extensions=['png'])
13+
def test_units_rectangle():
14+
import matplotlib.testing.jpl_units as U
15+
U.register()
16+
17+
p = mpatches.Rectangle((5*U.km, 6*U.km), 1*U.km, 2*U.km)
18+
19+
fig = plt.figure()
20+
ax = plt.subplot(111)
21+
ax.add_patch(p)
22+
ax.set_xlim([4*U.km, 7*U.km])
23+
ax.set_ylim([5*U.km, 9*U.km])

0 commit comments

Comments
 (0)
0