Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a18d9c

Browse files
committed
Clean up unit examples:
1 parent 98ce210 commit 6a18d9c

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

examples/units/artist_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Artist tests
44
============
55
6-
Test unit support with each of the matplotlib primitive artist types
6+
Test unit support with each of the Matplotlib primitive artist types.
77
8-
The axes handles unit conversions and the artists keep a pointer to
9-
their axes parent, so you must init the artists with the axes instance
10-
if you want to initialize them with unit data, or else they will not
8+
The axis handles unit conversions and the artists keep a pointer to
9+
their axis parent, so you must initialize the artists with the axis instance
10+
if you want to use them with unit data, or else they will not
1111
know how to convert the units to scalars.
1212
"""
1313
import random
@@ -38,15 +38,15 @@
3838
ax.add_collection(lc)
3939

4040
# test a plain-ol-line
41-
line = lines.Line2D(
42-
[0*cm, 1.5*cm], [0*cm, 2.5*cm], lw=2, color='black', axes=ax)
41+
line = lines.Line2D([0*cm, 1.5*cm], [0*cm, 2.5*cm],
42+
lw=2, color='black', axes=ax)
4343
ax.add_line(line)
4444

4545
if 0:
4646
# test a patch
4747
# Not supported at present.
48-
rect = patches.Rectangle(
49-
(1*cm, 1*cm), width=5*cm, height=2*cm, alpha=0.2, axes=ax)
48+
rect = patches.Rectangle((1*cm, 1*cm), width=5*cm, height=2*cm,
49+
alpha=0.2, axes=ax)
5050
ax.add_patch(rect)
5151

5252

examples/units/bar_demo2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Bar demo with units
44
===================
55
6-
plot using a variety of cm vs inches conversions. The example shows
7-
how default unit instrospection works (ax1), how various keywords can
6+
A plot using a variety of centimetre vs inches conversions. This example shows
7+
how default unit introspection works (ax1), how various keywords can
88
be used to set the x and y units to override the defaults (ax2, ax3,
99
ax4) and how one can set the xlimits using scalars (ax3, current units
1010
assumed) or units (conversions applied to get the numbers to current
11-
units)
11+
units).
1212
1313
"""
1414
import numpy as np

examples/units/radian_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Radian ticks
44
============
55
6-
Plot with radians from the basic_units mockup example package
6+
Plot with radians from the basic_units mockup example package.
7+
78
This example shows how the unit class can determine the tick locating,
89
formatting and axis labeling.
910
"""

0 commit comments

Comments
 (0)