8000 Merge remote-tracking branch 'TD22057/rectangle_units' into rect-units · matplotlib/matplotlib@37d4979 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37d4979

Browse files
committed
Merge remote-tracking branch 'TD22057/rectangle_units' into rect-units
2 parents 5239042 + ab57deb commit 37d4979

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