Skip to content

Commit 3beefd2

Browse files
committed
Blog demo updates
1 parent fe4e9a7 commit 3beefd2

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

SplatStats/demos/blogDemo.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,42 @@
7171
(fig, ax) = plt.subplots(figsize=(8, 8), subplot_kw={"projection": "polar"})
7272
(fig, ax) = splat.plotkillDeathIris(
7373
(fig, ax), pHist,
74-
innerGuides=(0, 6, 1), outerGuides=(10, 50, 10)
74+
innerGuides=(0, 6, 1), outerGuides=(10, 50, 10),
75+
frameColor="#000000AA"
76+
)
77+
ax.set_yticklabels(
78+
["", 10, 20, 30, 40],
79+
fontdict={'fontsize': 8, 'color': '#00000066'}
80+
)
81+
ax.set_rlabel_position(0)
82+
plt.savefig(
83+
path.join(oPath, f'KD_Iris.png'),
84+
dpi=200, bbox_inches='tight', facecolor=fig.get_facecolor()
85+
)
86+
###############################################################################
87+
# Match History
88+
###############################################################################
89+
(xRange, yRange) = ((-350, pHist.shape[0]), ((0, 40), (0, 2000)))
90+
fig = plt.figure(figsize=(30, 5))
91+
gs = fig.add_gridspec(
92+
2, 1,
93+
width_ratios=(1, ), height_ratios=(.75, .05),
94+
left=0.1, right=0.9, bottom=0.1, top=0.9,
95+
wspace=0.05, hspace=0
96+
)
97+
(ax_top, ax_bottom) = (fig.add_subplot(gs[0]), fig.add_subplot(gs[1], sharex=ax_top))
98+
(_, ax_top) = splat.plotMatchHistory(
99+
(fig, ax_top), pHist, ilocRange=xRange,
100+
yRange=yRange, sizeMultiplier=1
101+
)
102+
(_, ax_bottom) = splat.plotMatchTypeHistory(
103+
(fig, ax_bottom), pHist, ilocRange=xRange,
104+
sizeMultiplier=.9, labelsize=5.25
105+
)
106+
ax_top.tick_params(labelbottom=False)
107+
ax_bottom.set_yticks([])
108+
plt.setp(ax_bottom.get_xticklabels(), rotation=90, ha='right')
109+
plt.savefig(
110+
path.join(oPath, f'History.png'),
111+
dpi=200, bbox_inches='tight', facecolor=fig.get_facecolor()
75112
)

SplatStats/plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def plotIris(
473473
outerGuides[0]+innerOffset, outerGuides[1]+innerOffset, outerGuides[2]
474474
))
475475
ax.set_yticks(yTicks)
476-
ax.yaxis.grid(True, color=frameColor, ls='-', lw=0.125, zorder=-10)
476+
ax.yaxis.grid(True, color=frameColor, ls='-', lw=0.2, zorder=-10)
477477
ax.spines["start"].set_color("none")
478478
ax.spines["polar"].set_color(outerGuidesColor)
479479
# Return figure -----------------------------------------------------------

0 commit comments

Comments
 (0)