|
29 | 29 | ax = axs[0]
|
30 | 30 | ax.xaxis.set_major_locator(ticker.NullLocator())
|
31 | 31 | ax.xaxis.set_minor_locator(ticker.NullLocator())
|
32 |
| -ax.text(0.0, 0.1, "ticker.NullLocator()", |
| 32 | +ax.text(0.0, 0.2, "ticker.NullLocator()", |
33 | 33 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
34 | 34 |
|
35 | 35 | # Multiple Locator
|
36 | 36 | ax = axs[1]
|
37 | 37 | ax.xaxis.set_major_locator(ticker.MultipleLocator(0.5))
|
38 | 38 | ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.1))
|
39 |
| -ax.text(0.0, 0.1, "ticker.MultipleLocator(0.5)", |
| 39 | +ax.text(0.0, 0.2, "ticker.MultipleLocator(0.5)", |
40 | 40 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
41 | 41 |
|
42 | 42 | # Fixed Locator
|
|
45 | 45 | ax.xaxis.set_major_locator(ticker.FixedLocator(majors))
|
46 | 46 | minors = np.linspace(0, 1, 11)[1:-1]
|
47 | 47 | ax.xaxis.set_minor_locator(ticker.FixedLocator(minors))
|
48 |
| -ax.text(0.0, 0.1, "ticker.FixedLocator([0, 1, 5])", |
| 48 | +ax.text(0.0, 0.2, "ticker.FixedLocator([0, 1, 5])", |
49 | 49 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
50 | 50 |
|
51 | 51 | # Linear Locator
|
52 | 52 | ax = axs[3]
|
53 | 53 | ax.xaxis.set_major_locator(ticker.LinearLocator(3))
|
54 | 54 | ax.xaxis.set_minor_locator(ticker.LinearLocator(31))
|
55 |
| -ax.text(0.0, 0.1, "ticker.LinearLocator(numticks=3)", |
| 55 | +ax.text(0.0, 0.2, "ticker.LinearLocator(numticks=3)", |
56 | 56 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
57 | 57 |
|
58 | 58 | # Index Locator
|
59 | 59 | ax = axs[4]
|
60 | 60 | ax.plot(range(0, 5), [0]*5, color='white')
|
61 | 61 | ax.xaxis.set_major_locator(ticker.IndexLocator(base=.5, offset=.25))
|
62 |
| -ax.text(0.0, 0.1, "ticker.IndexLocator(base=0.5, offset=0.25)", |
| 62 | +ax.text(0.0, 0.2, "ticker.IndexLocator(base=0.5, offset=0.25)", |
63 | 63 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
64 | 64 |
|
65 | 65 | # Auto Locator
|
66 | 66 | ax = axs[5]
|
67 | 67 | ax.xaxis.set_major_locator(ticker.AutoLocator())
|
68 | 68 | ax.xaxis.set_minor_locator(ticker.AutoMinorLocator())
|
69 |
| -ax.text(0.0, 0.1, "ticker.AutoLocator()", |
| 69 | +ax.text(0.0, 0.2, "ticker.AutoLocator()", |
70 | 70 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
71 | 71 |
|
72 | 72 | # MaxN Locator
|
73 | 73 | ax = axs[6]
|
74 | 74 | ax.xaxis.set_major_locator(ticker.MaxNLocator(4))
|
75 | 75 | ax.xaxis.set_minor_locator(ticker.MaxNLocator(40))
|
76 |
| -ax.text(0.0, 0.1, "ticker.MaxNLocator(n=4)", |
| 76 | +ax.text(0.0, 0.2, "ticker.MaxNLocator(n=4)", |
77 | 77 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
78 | 78 |
|
79 | 79 | # Log Locator
|
80 | 80 | ax = axs[7]
|
81 | 81 | ax.set_xlim(10**3, 10**10)
|
82 | 82 | ax.set_xscale('log')
|
83 | 83 | ax.xaxis.set_major_locator(ticker.LogLocator(base=10.0, numticks=15))
|
84 |
| -ax.text(0.0, 0.1, "ticker.LogLocator(base=10, numticks=15)", |
| 84 | +ax.text(0.0, 0.2, "ticker.LogLocator(base=10, numticks=15)", |
85 | 85 | fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
|
86 | 86 |
|
87 |
| -plt.savefig("../figures/tick-locators.pdf") |
| 87 | +fig.savefig("../figures/tick-locators.pdf") |
0 commit comments