Skip to content

Commit 5ffe804

Browse files
authored
Merge pull request #8377 from dstansby/unit-example-clean
DOC: Clean up unit examples
2 parents 734c09f + 15a769c commit 5ffe804

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

examples/units/artist_tests.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
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
11-
know how to convert the units to scalars.
8+
The axis handles unit conversions and the artists keep a pointer to their axis
9+
parent. You must initialize the artists with the axis instance if you want to
10+
use them with unit data, or else they will not know how to convert the units
11+
to scalars.
1212
"""
1313
import random
1414
import matplotlib.lines as lines
@@ -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: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
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
8-
be used to set the x and y units to override the defaults (ax2, ax3,
9-
ax4) and how one can set the xlimits using scalars (ax3, current units
10-
assumed) or units (conversions applied to get the numbers to current
11-
units)
6+
A plot using a variety of centimetre and inch conversions. This example shows
7+
how default unit introspection works (ax1), how various keywords can be used to
8+
set the x and y units to override the defaults (ax2, ax3, ax4) and how one can
9+
set the xlimits using scalars (ax3, current units assumed) or units
10+
(conversions applied to get the numbers to current units).
1211
1312
"""
1413
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)