Skip to content

Commit 4a61f50

Browse files
committed
Add credit to figures themselves
1 parent a274a41 commit 4a61f50

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

examples/showcase/xkcd.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://xkcd.com/418/
77

88
fig = plt.figure()
9-
ax = fig.add_subplot(1, 1, 1)
9+
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
1010
ax.spines['right'].set_color('none')
1111
ax.spines['top'].set_color('none')
1212
plt.xticks([])
@@ -24,12 +24,16 @@
2424

2525
plt.xlabel('time')
2626
plt.ylabel('my overall health')
27+
fig.text(
28+
0.5, 0.05,
29+
'"Stove Ownership" from xkcd by Randall Monroe',
30+
ha='center')
2731

2832
# Based on "The Data So Far" from XKCD by Randall Monroe
2933
# http://xkcd.com/373/
3034

3135
fig = plt.figure()
32-
ax = fig.add_subplot(1, 1, 1)
36+
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
3337
ax.bar([-0.125, 1.0-0.125], [0, 100], 0.25)
3438
ax.spines['right'].set_color('none')
3539
ax.spines['top'].set_color('none')
@@ -42,4 +46,9 @@
4246

4347
plt.title("CLAIMS OF SUPERNATURAL POWERS")
4448

49+
fig.text(
50+
0.5, 0.05,
51+
'"The Data So Far" from xkcd by Randall Monroe',
52+
ha='center')
53+
4554
plt.show()

0 commit comments

Comments
 (0)