|
3 | 3 | Artist tests |
4 | 4 | ============ |
5 | 5 |
|
6 | | -Test unit support with each of the matplotlib primitive artist types |
| 6 | +Test unit support with each of the Matplotlib primitive artist types. |
7 | 7 |
|
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. |
12 | 12 | """ |
13 | 13 | import random |
14 | 14 | import matplotlib.lines as lines |
|
38 | 38 | ax.add_collection(lc) |
39 | 39 |
|
40 | 40 | # 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) |
43 | 43 | ax.add_line(line) |
44 | 44 |
|
45 | 45 | if 0: |
46 | 46 | # test a patch |
47 | 47 | # 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) |
50 | 50 | ax.add_patch(rect) |
51 | 51 |
|
52 | 52 |
|
|
0 commit comments