Skip to content

Commit 1132fc7

Browse files
committed
small tweaks to size and spacing identified during review
1 parent 73ced9f commit 1132fc7

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

Diff for: scripts/annotation-connection-styles.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
pathlib.Path(__file__).parent/'../styles/base.mplstyle',
99
pathlib.Path(__file__).parent/'../styles/plotlet-grid.mplstyle',
1010
])
11+
mpl.rc('lines', markersize=3)
1112

1213

1314
def demo_con_style(ax, connectionstyle):
@@ -17,8 +18,8 @@ def demo_con_style(ax, connectionstyle):
1718
ax.annotate("",
1819
xy=(x1, y1), xycoords='data',
1920
xytext=(x2, y2), textcoords='data',
20-
arrowprops=dict(arrowstyle="->", color="0.5",
21-
shrinkA=2, shrinkB=2,
21+
arrowprops=dict(arrowstyle="->", lw=0.5, color="0.5",
22+
shrinkA=3, shrinkB=3,
2223
patchA=None, patchB=None,
2324
connectionstyle=connectionstyle),
2425
)
@@ -41,4 +42,3 @@ def demo_con_style(ax, connectionstyle):
4142
ax.set(xlim=(0, 1), ylim=(0, 1), xticks=[], yticks=[], aspect=1)
4243

4344
plt.savefig("../figures/annotation-connection-styles.pdf")
44-
# plt.show()

Diff for: scripts/tick-formatters.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25))
3232
ax.xaxis.set_major_formatter(ticker.NullFormatter())
3333
ax.xaxis.set_minor_formatter(ticker.NullFormatter())
34-
ax.text(0.0, 0.1, "ticker.NullFormatter()",
34+
ax.text(0.0, 0.2, "ticker.NullFormatter()",
3535
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
3636

3737
# Fixed formatter
@@ -40,47 +40,47 @@
4040
ax.xaxis.set_major_locator(ticker.FixedLocator(range(6)))
4141
majors = ["zero", "one", "two", "three", "four", "five"]
4242
ax.xaxis.set_major_formatter(ticker.FixedFormatter(majors))
43-
ax.text(0.0, 0.1, "ticker.FixedFormatter(['zero', 'one', 'two', …])",
43+
ax.text(0.0, 0.2, "ticker.FixedFormatter(['zero', 'one', 'two', …])",
4444
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
4545

4646
# FuncFormatter formatter
4747
ax = axs[2]
4848
ax.xaxis.set_major_locator(ticker.MultipleLocator(1.00))
4949
ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25))
5050
ax.xaxis.set_major_formatter(ticker.FuncFormatter(lambda x, pos: "[%.2f]" % x))
51-
ax.text(0.0, 0.1, 'ticker.FuncFormatter(lambda x, pos: "[%.2f]" % x)',
51+
ax.text(0.0, 0.2, 'ticker.FuncFormatter(lambda x, pos: "[%.2f]" % x)',
5252
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
5353

5454
# FormatStr formatter
5555
ax = axs[3]
5656
ax.xaxis.set_major_locator(ticker.MultipleLocator(1.00))
5757
ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25))
5858
ax.xaxis.set_major_formatter(ticker.FormatStrFormatter(">%d<"))
59-
ax.text(0.0, 0.1, "ticker.FormatStrFormatter('>%d<')",
59+
ax.text(0.0, 0.2, "ticker.FormatStrFormatter('>%d<')",
6060
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
6161

6262
# Scalar formatter
6363
ax = axs[4]
6464
ax.xaxis.set_major_locator(ticker.AutoLocator())
6565
ax.xaxis.set_minor_locator(ticker.AutoMinorLocator())
6666
ax.xaxis.set_major_formatter(ticker.ScalarFormatter(useMathText=True))
67-
ax.text(0.0, 0.1, "ticker.ScalarFormatter()",
67+
ax.text(0.0, 0.2, "ticker.ScalarFormatter()",
6868
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
6969

7070
# StrMethod formatter
7171
ax = axs[5]
7272
ax.xaxis.set_major_locator(ticker.MultipleLocator(1.00))
7373
ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25))
7474
ax.xaxis.set_major_formatter(ticker.StrMethodFormatter("{x}"))
75-
ax.text(0.0, 0.1, "ticker.StrMethodFormatter('{x}')",
75+
ax.text(0.0, 0.2, "ticker.StrMethodFormatter('{x}')",
7676
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
7777

7878
# Percent formatter
7979
ax = axs[6]
8080
ax.xaxis.set_major_locator(ticker.MultipleLocator(1.00))
8181
ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.25))
8282
ax.xaxis.set_major_formatter(ticker.PercentFormatter(xmax=5))
83-
ax.text(0.0, 0.1, "ticker.PercentFormatter(xmax=5)",
83+
ax.text(0.0, 0.2, "ticker.PercentFormatter(xmax=5)",
8484
fontfamily="Source Code Pro", transform=ax.transAxes, in_layout=False)
8585

86-
plt.savefig("../figures/tick-formatters.pdf")
86+
fig.savefig("../figures/tick-formatters.pdf")

Diff for: scripts/tick-locators.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
ax = axs[0]
3030
ax.xaxis.set_major_locator(ticker.NullLocator())
3131
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()",
3333
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
3434

3535
# Multiple Locator
3636
ax = axs[1]
3737
ax.xaxis.set_major_locator(ticker.MultipleLocator(0.5))
3838
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)",
4040
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
4141

4242
# Fixed Locator
@@ -45,43 +45,43 @@
4545
ax.xaxis.set_major_locator(ticker.FixedLocator(majors))
4646
minors = np.linspace(0, 1, 11)[1:-1]
4747
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])",
4949
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
5050

5151
# Linear Locator
5252
ax = axs[3]
5353
ax.xaxis.set_major_locator(ticker.LinearLocator(3))
5454
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)",
5656
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
5757

5858
# Index Locator
5959
ax = axs[4]
6060
ax.plot(range(0, 5), [0]*5, color='white')
6161
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)",
6363
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
6464

6565
# Auto Locator
6666
ax = axs[5]
6767
ax.xaxis.set_major_locator(ticker.AutoLocator())
6868
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()",
7070
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
7171

7272
# MaxN Locator
7373
ax = axs[6]
7474
ax.xaxis.set_major_locator(ticker.MaxNLocator(4))
7575
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)",
7777
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
7878

7979
# Log Locator
8080
ax = axs[7]
8181
ax.set_xlim(10**3, 10**10)
8282
ax.set_xscale('log')
8383
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)",
8585
fontfamily='Source Code Pro', transform=ax.transAxes, in_layout=False)
8686

87-
plt.savefig("../figures/tick-locators.pdf")
87+
fig.savefig("../figures/tick-locators.pdf")

0 commit comments

Comments
 (0)