Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ae9221

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

File tree

Expand file treeCollapse file tree

5 files changed

+945
-266
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+945
-266
lines changed

‎CHANGELOG

Copy file name to clipboardExpand all lines: CHANGELOG
+3Lines 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

+34Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.