Skip to content

Commit bd2b13c

Browse files
committed
Add titles to clarify intent
1 parent c80897d commit bd2b13c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/pylab_examples/histogram_demo_histtypes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
y = normpdf( bins, mu, sigma)
1717
ax0.plot(bins, y, 'k--', linewidth=1.5)
1818

19+
ax0.set_title('stepfilled')
20+
1921
# Create a histogram by providing the bin edges (unequally spaced).
2022
bins = [100,150,180,195,205,220,250,300]
2123
n, bins, patches = ax1.hist(x, bins, normed=1, histtype='bar', rwidth=0.8)
24+
ax1.set_title('unequal bins')
2225

2326
n, bins, patches = ax2.hist(x, 50, normed=1, histtype='step', cumulative=True)
2427

@@ -42,9 +45,9 @@
4245
n, bins, patches = ax2.hist(x, bins=bins, normed=1,
4346
histtype='step', cumulative=-1)
4447

45-
4648
ax2.grid(True)
4749
ax2.set_ylim(0, 1.05)
50+
ax2.set_title('cumulative step')
4851

4952
plt.tight_layout()
5053
plt.show()

examples/pylab_examples/histogram_demo_multihist.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
color=['crimson', 'burlywood', 'chartreuse'],
1313
label=['Crimson', 'Burlywood', 'Chartreuse'])
1414
ax0.legend(prop={'size': 10})
15+
ax0.set_title('bar')
1516

1617

1718
n, bins, patches = ax1.hist(x, 10, normed=1, histtype='bar', stacked=True)
19+
ax1.set_title('stacked bar')
1820

1921
n, bins, patches = ax2.hist(x, 10, histtype='step', stacked=True, fill=True)
22+
ax2.set_title('stepfilled')
2023

2124
# Make a multiple-histogram of data-sets with different length.
2225
x0 = mu + sigma*np.random.randn(10000)
@@ -31,6 +34,7 @@
3134
w2[:len(x2)/2] = 0.5
3235

3336
n, bins, patches = ax3.hist( [x0,x1,x2], 10, weights=[w0, w1, w2], histtype='bar')
37+
ax3.set_title('different sample sizes')
3438

3539
plt.tight_layout()
3640
plt.show()

0 commit comments

Comments
 (0)