Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ae9221

Browse files
committed
added Jae Joon's legend and offsetbox implementation
svn path=/trunk/matplotlib/; revision=6461
1 parent fa40fa9 commit 3ae9221

File tree

5 files changed

+945
-266
lines changed

5 files changed

+945
-266
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-11-30 Reimplementaion of the legend which supports baseline alignement,
2+
multi-column, and expand mode. - JJL
3+
14
2008-12-01 Fixed histogram autoscaling bug when bins or range are given
25
explicitly (fixes Debian bug 503148) - MM
36

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
3+
import matplotlib.pyplot as plt
4+
import numpy as np
5+
6+
def myplot(ax):
7+
t1 = np.arange(0.0, 1.0, 0.1)
8+
for n in [1, 2, 3, 4]:
9+
ax.plot(t1, t1**n, label="n=%d"%(n,))
10+
11+
ax1 = plt.subplot(3,1,1)
12+
ax1.plot([1], label="multi\nline")
13+
ax1.plot([1], label="$2^{2^2}$")
14+
ax1.plot([1], label=r"$\frac{1}{2}\pi$")
15+
ax1.legend(loc=1, ncol=3, shadow=True)
16+
17+
ax2 = plt.subplot(3,1,2)
18+
myplot(ax2)
19+
ax2.legend(loc=1, ncol=2, shadow=True)
20+
21+
22+
ax3 = plt.subplot(3,1,3)
23+
myplot(ax3)
24+
ax3.legend(loc=1, ncol=4, mode="expand", shadow=True)
25+
26+
27+
#title('Damped oscillation')
28+
29+
plt.draw()
30+
plt.show()
31+
32+
#plt.savefig("legend_demo3")
33+
34+

0 commit comments

Comments
 (0)