|
9 | 9 | :doc:`/gallery/lines_bars_and_markers/marker_fillstyle_reference` |
10 | 10 | and :doc:`/gallery/shapes_and_collections/marker_path` examples. |
11 | 11 | """ |
| 12 | + |
12 | 13 | import numpy as np |
13 | 14 | import matplotlib.pyplot as plt |
14 | 15 | from matplotlib.lines import Line2D |
15 | 16 |
|
16 | 17 |
|
17 | | -points = np.ones(5) # Draw 3 points for each line |
18 | | -text_style = dict(horizontalalignment='right', verticalalignment='center', |
19 | | - fontsize=12, fontdict={'family': 'monospace'}) |
20 | | -marker_style = dict(color='cornflowerblue', linestyle=':', marker='o', |
21 | | - markersize=15, markerfacecoloralt='gray') |
22 | | - |
23 | | - |
24 | | -def format_axes(ax): |
25 | | - ax.margins(0.2) |
26 | | - ax.set_axis_off() |
27 | | - |
| 18 | +points = np.ones(5) # Draw 5 points for each line |
| 19 | +marker_style = dict(color='tab:blue', linestyle=':', marker='o', |
| 20 | + markersize=15, markerfacecoloralt='tab:red') |
28 | 21 |
|
29 | 22 | fig, ax = plt.subplots() |
30 | 23 |
|
31 | 24 | # Plot all fill styles. |
32 | 25 | for y, fill_style in enumerate(Line2D.fillStyles): |
33 | | - ax.text(-0.5, y, repr(fill_style), **text_style) |
| 26 | + ax.text(-0.5, y, repr(fill_style), |
| 27 | + horizontalalignment='center', verticalalignment='center') |
34 | 28 | ax.plot(y * points, fillstyle=fill_style, **marker_style) |
35 | | - format_axes(ax) |
36 | | - ax.set_title('fill style') |
| 29 | + |
| 30 | +ax.set_axis_off() |
| 31 | +ax.set_title('fill style') |
37 | 32 |
|
38 | 33 | plt.show() |
0 commit comments