Skip to content

Commit 25b881f

Browse files
committed
DOC: more comments
1 parent f473228 commit 25b881f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/style_sheets/style_sheets_reference.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def plot_figure(axs, style_label=""):
104104
# Use a dedicated RandomState instance to draw the same "random" values
105105
# across the different figures.
106106
prng = np.random.RandomState(96917002)
107+
# the facecolor rcparam is not applied to subfigures, so
108+
# do so manually here:
107109
axs[0].figure.set_facecolor(plt.rcParams['figure.facecolor'])
108110
axs[0].set_ylabel('ylabel')
109111

@@ -113,13 +115,17 @@ def plot_figure(axs, style_label=""):
113115
plot_colored_circles(axs[3], prng)
114116
plot_colored_sinusoidal_lines(axs[4])
115117
plot_histograms(axs[5], prng)
118+
# make a suptitle, in the same style for all subfigures,
119+
# except those with dark backgrounds, which get a lighter
120+
# color:
116121
col = np.array([19, 6, 84])/256
117122
back = mcolors.rgb_to_hsv(
118123
mcolors.to_rgb(plt.rcParams['figure.facecolor']))[2]
119124
if back < 0.5:
120125
col = [0.8, 0.8, 1]
121-
axs[0].figure.suptitle(style_label, x=0.03, fontsize=12,
122-
ha='left', color=col)
126+
axs[0].figure.suptitle(style_label, x=0.015, fontsize=14, ha='left',
127+
color=col, fontfamily='DejaVu Sans',
128+
fontweight='normal')
123129

124130
if __name__ == "__main__":
125131

0 commit comments

Comments
 (0)