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

Skip to content

Commit 19092ec

Browse files
committed
Merged revisions 4059-4134 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4061 | jdh2358 | 2007-10-29 14:52:41 -0400 (Mon, 29 Oct 2007) | 2 lines fixed some examples bugs ........ r4062 | jdh2358 | 2007-10-29 15:00:25 -0400 (Mon, 29 Oct 2007) | 2 lines added cohere demo ........ r4072 | dsdale | 2007-10-31 15:43:54 -0400 (Wed, 31 Oct 2007) | 2 lines added STIX fonts ........ r4073 | dsdale | 2007-10-31 15:53:35 -0400 (Wed, 31 Oct 2007) | 2 lines add STIX license agreement ........ r4081 | efiring | 2007-11-01 03:21:00 -0400 (Thu, 01 Nov 2007) | 2 lines Made contour auto level generation work with log color scale ........ r4087 | dsdale | 2007-11-01 10:17:28 -0400 (Thu, 01 Nov 2007) | 2 lines install fonts/otf to mpl-data ........ r4088 | dsdale | 2007-11-01 10:32:52 -0400 (Thu, 01 Nov 2007) | 2 lines dont enable usetex in arrow_demo.py ........ r4092 | dsdale | 2007-11-01 12:56:33 -0400 (Thu, 01 Nov 2007) | 2 lines rm configtest.py from repository ........ r4093 | dsdale | 2007-11-01 12:57:26 -0400 (Thu, 01 Nov 2007) | 2 lines remove STIXFonts zip file ........ r4094 | dsdale | 2007-11-02 08:55:51 -0400 (Fri, 02 Nov 2007) | 2 lines improved ghostscript version checking ........ r4095 | jdh2358 | 2007-11-02 09:13:40 -0400 (Fri, 02 Nov 2007) | 2 lines added Manuel's contour linestyle patch ........ r4096 | dsdale | 2007-11-02 12:37:37 -0400 (Fri, 02 Nov 2007) | 3 lines commit patch 1599876, fixes to qt4agg backend and qt4 blitting demo. Thanks to Phil Thompson. ........ r4097 | jdh2358 | 2007-11-02 14:45:38 -0400 (Fri, 02 Nov 2007) | 2 lines fix unit changes for errorbar_limits code ........ r4106 | efiring | 2007-11-04 21:36:20 -0500 (Sun, 04 Nov 2007) | 2 lines Added easy access to minor tick properties (Pierre G-M) ........ r4107 | mdboom | 2007-11-05 10:45:00 -0500 (Mon, 05 Nov 2007) | 3 lines First pass at getting STIX fonts to work. Support .otf fonts in font_manager.py ........ r4110 | mdboom | 2007-11-05 12:30:08 -0500 (Mon, 05 Nov 2007) | 2 lines Make STIX fonts work. ........ r4112 | efiring | 2007-11-05 14:49:27 -0500 (Mon, 05 Nov 2007) | 2 lines Minor cleanup; removed old ipython hack. ........ r4113 | efiring | 2007-11-05 14:54:49 -0500 (Mon, 05 Nov 2007) | 2 lines make step_demo use npyma ........ r4114 | efiring | 2007-11-05 15:13:00 -0500 (Mon, 05 Nov 2007) | 2 lines Make safezip accept more args; quadmesh_demo cleanup ........ r4115 | mdboom | 2007-11-05 15:42:23 -0500 (Mon, 05 Nov 2007) | 2 lines Fix rcParams bug. ........ r4126 | mdboom | 2007-11-06 13:32:30 -0500 (Tue, 06 Nov 2007) | 3 lines Prevent errors when using OpenType CFF fonts. This means turning off subsetting on backend_pdf, and raising an exception in backend_ps. ........ r4130 | mdboom | 2007-11-06 14:38:29 -0500 (Tue, 06 Nov 2007) | 2 lines Converted STIX fonts from otf to ttf. ........ r4131 | mdboom | 2007-11-06 14:38:57 -0500 (Tue, 06 Nov 2007) | 1 line Removing STIX otf fonts ........ r4132 | mdboom | 2007-11-06 14:39:23 -0500 (Tue, 06 Nov 2007) | 2 lines Converted STIX fonts from otf to ttf. ........ svn path=/branches/transforms/; revision=4135
2 parents 0ceb5e4 + f1f49f4 commit 19092ec

54 files changed

Lines changed: 819 additions & 260 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg
2+
backend and qt4 blitting demo - DSD
3+
4+
2007-10-31 Made log color scale easier to use with contourf;
5+
automatic level generation now works. - EF
6+
17
2007-10-29 TRANSFORMS REFACTORING
28

39
The primary goal of this refactoring was to make it easier
@@ -66,7 +72,6 @@
6672

6773
See API_CHANGES for more low-level information about this
6874
refactoring.
69-
7075

7176
2007-10-24 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF
7277

LICENSE/LICENSE_STIX

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
TERMS AND CONDITIONS
2+
3+
1. Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of the STIX Fonts-TM set accompanying this license
5+
(collectively, the "Fonts") and the associated documentation files
6+
(collectively with the Fonts, the "Font Software"), to reproduce and
7+
distribute the Font Software, including the rights to use, copy, merge
8+
and publish copies of the Font Software, and to permit persons to whom
9+
the Font Software is furnished to do so same, subject to the following
10+
terms and conditions (the "License").
11+
12+
2. The following copyright and trademark notice and these Terms and
13+
Conditions shall be included in all copies of one or more of the Font
14+
typefaces and any derivative work created as permitted under this
15+
License:
16+
17+
Copyright (c) 2001-2005 by the STI Pub Companies, consisting of
18+
the American Institute of Physics, the American Chemical Society, the
19+
American Mathematical Society, the American Physical Society, Elsevier,
20+
Inc., and The Institute of Electrical and Electronic Engineers, Inc.
21+
Portions copyright (c) 1998-2003 by MicroPress, Inc. Portions copyright
22+
(c) 1990 by Elsevier, Inc. All rights reserved. STIX Fonts-TM is a
23+
trademark of The Institute of Electrical and Electronics Engineers, Inc.
24+
25+
3. You may (a) convert the Fonts from one format to another (e.g.,
26+
from TrueType to PostScript), in which case the normal and reasonable
27+
distortion that occurs during such conversion shall be permitted and (b)
28+
embed or include a subset of the Fonts in a document for the purposes of
29+
allowing users to read text in the document that utilizes the Fonts. In
30+
each case, you may use the STIX Fonts-TM mark to designate the resulting
31+
Fonts or subset of the Fonts.
32+
33+
4. You may also (a) add glyphs or characters to the Fonts, or modify
34+
the shape of existing glyphs, so long as the base set of glyphs is not
35+
removed and (b) delete glyphs or characters from the Fonts, provided
36+
that the resulting font set is distributed with the following
37+
disclaimer: "This [name] font does not include all the Unicode points
38+
covered in the STIX Fonts-TM set but may include others." In each case,
39+
the name used to denote the resulting font set shall not include the
40+
term "STIX" or any similar term.
41+
42+
5. You may charge a fee in connection with the distribution of the
43+
Font Software, provided that no copy of one or more of the individual
44+
Font typefaces that form the STIX Fonts-TM set may be sold by itself.
45+
46+
6. THE FONT SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY
47+
KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES
48+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
49+
OF COPYRIGHT, PATENT, TRADEMARK OR OTHER RIGHT. IN NO EVENT SHALL
50+
MICROPRESS OR ANY OF THE STI PUB COMPANIES BE LIABLE FOR ANY CLAIM,
51+
DAMAGES OR OTHER LIABILITY, INCLUDING, BUT NOT LIMITED TO, ANY GENERAL,
52+
SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES, WHETHER IN AN
53+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM OR OUT OF THE USE OR
54+
INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT
55+
SOFTWARE.
56+
57+
7. Except as contained in the notice set forth in Section 2, the
58+
names MicroPress Inc. and STI Pub Companies, as well as the names of the
59+
companies/organizations that compose the STI Pub Companies, shall not be
60+
used in advertising or otherwise to promote the sale, use or other
61+
dealings in the Font Software without the prior written consent of the
62+
respective company or organization.
63+
64+
8. This License shall become null and void in the event of any
65+
material breach of the Terms and Conditions herein by licensee.
66+
67+
9. A substantial portion of the STIX Fonts set was developed by
68+
MicroPress Inc. for the STI Pub Companies. To obtain additional
69+
mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow
70+
Street, Forest Hills, NY 11375, USA - Phone: (718) 575-1816.
71+

examples/animation_blit_qt4.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,29 @@
1515

1616
class BlitQT(QtCore.QObject):
1717
def __init__(self):
18-
QtCore.QObject.__init__(self, None)
19-
2018
self.ax = p.subplot(111)
2119
self.canvas = self.ax.figure.canvas
20+
21+
# By making this a child of the canvas we make sure that it is
22+
# destroyed first and avoids a possible exception when the user clicks
23+
# on the window's close box.
24+
QtCore.QObject.__init__(self, self.canvas)
25+
2226
self.cnt = 0
2327

2428
# create the initial line
2529
self.x = npy.arange(0,2*npy.pi,0.01)
2630
self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2)
2731

2832
self.background = None
33+
self.old_size = 0, 0
2934

3035
def timerEvent(self, evt):
31-
if self.background is None:
36+
# See if the size has changed since last time round.
37+
current_size = self.ax.bbox.width(), self.ax.bbox.height()
38+
39+
if self.old_size != current_size:
40+
self.old_size = current_size
3241
self.background = self.canvas.copy_from_bbox(self.ax.bbox)
3342

3443
# restore the clean slate background

examples/arrow_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"""
1212
from pylab import *
1313

14-
rc('text', usetex=True)
1514
rates_to_bases={'r1':'AT', 'r2':'TA', 'r3':'GA','r4':'AG','r5':'CA','r6':'AC', \
1615
'r7':'GT', 'r8':'TG', 'r9':'CT','r10':'TC','r11':'GC','r12':'CG'}
1716
numbered_bases_to_rates = dict([(v,k) for k, v in rates_to_bases.items()])

examples/backend_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
'barh_demo.py',
3333
'color_demo.py',
3434
'colorbar_only.py',
35+
'cohere_demo.py',
3536
'contour_demo.py',
3637
'contourf_demo.py',
37-
'csd_demo.py',
38+
'csd_demo.py',
3839
'custom_ticker1.py',
3940
'customize_rc.py',
4041
'date_demo1.py',

examples/cohere_demo.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python
2+
"""
3+
Compute the coherence of two signals
4+
"""
5+
import numpy as n
6+
7+
from pylab import figure, show
8+
9+
dt = 0.01
10+
t = n.arange(0, 30, dt)
11+
Nt = len(t)
12+
nse1 = n.random.randn(Nt) # white noise 1
13+
nse2 = n.random.randn(Nt) # white noise 2
14+
r = n.exp(-t/0.05)
15+
16+
cnse1 = n.convolve(nse1, r)*dt # colored noise 1
17+
cnse1 = cnse1[:Nt]
18+
cnse2 = n.convolve(nse2, r)*dt # colored noise 2
19+
cnse2 = cnse2[:Nt]
20+
21+
# two signals with a coherent part and a random part
22+
s1 = 0.01*n.sin(2*n.pi*10*t) + cnse1
23+
s2 = 0.01*n.sin(2*n.pi*10*t) + cnse2
24+
25+
fig = figure()
26+
ax = fig.add_subplot(211)
27+
ax.plot(t, s1, 'b-', t, s2, 'g-')
28+
ax.set_xlim(0,5)
29+
ax.set_xlabel('time')
30+
ax.set_ylabel('s1 and s2')
31+
32+
ax = fig.add_subplot(212)
33+
cxy, f = ax.cohere(s1, s2, 256, 1./dt)
34+
35+
show()
36+
37+

examples/image_slices_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, ax, X):
1717
self.update()
1818

1919
def onscroll(self, event):
20-
20+
print event.button
2121
if event.button=='up':
2222
self.ind = numpy.clip(self.ind+1, 0, self.slices-1)
2323
else:

examples/keypress_demo.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#!/usr/bin/env python
22
"""
33
Show how to connect to keypress events
4-
5-
Note, on the wx backend on some platforms (eg linux), you have to
6-
first click on the figure before the keypress events are activated.
7-
If you know how to fix this, please email us!
84
"""
9-
from pylab import *
5+
import numpy as n
6+
from pylab import figure, show
107

118
def press(event):
129
print 'press', event.key
13-
if event.key=='g':
14-
grid()
15-
draw()
10+
if event.key=='x':
11+
visible = xl.get_visible()
12+
xl.set_visible(not visible)
13+
fig.canvas.draw()
14+
15+
fig = figure()
16+
ax = fig.add_subplot(111)
17+
18+
fig.canvas.mpl_connect('key_press_event', press)
1619

17-
connect('key_press_event', press)
20+
ax.plot(n.random.rand(12), n.random.rand(12), 'go')
21+
xl = ax.set_xlabel('easy come, easy go')
1822

19-
title('press g to toggle grid')
20-
plot(rand(12), rand(12), 'go')
2123
show()

examples/mathtext_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
r'$\mathcal{H} = \int d \tau \left(\epsilon E^2 + \mu H^2\right)$',
4949
r'$\widehat{abc}\widetilde{def}$',
5050
r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$',
51-
r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$'
51+
r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$',
52+
ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
5253
]
5354

5455
from pylab import *

examples/quadmesh_demo.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22
"""
33
pcolormesh uses a QuadMesh, a faster generalization of pcolor, but
44
with some restrictions.
5+
6+
This demo illustrates a bug in quadmesh with masked data.
57
"""
68

7-
import numpy as nx
8-
from pylab import figure,show
9+
import numpy as npy
10+
from matplotlib.pyplot import figure, show
911
from matplotlib import cm, colors
12+
from matplotlib.numerix import npyma as ma
1013

1114
n = 56
12-
x = nx.linspace(-1.5,1.5,n)
13-
X,Y = nx.meshgrid(x,x);
14-
Qx = nx.cos(Y) - nx.cos(X)
15-
Qz = nx.sin(Y) + nx.sin(X)
15+
x = npy.linspace(-1.5,1.5,n)
16+
X,Y = npy.meshgrid(x,x);
17+
Qx = npy.cos(Y) - npy.cos(X)
18+
Qz = npy.sin(Y) + npy.sin(X)
1619
Qx = (Qx + 1.1)
17-
Z = nx.sqrt(X**2 + Y**2)/5;
18-
Z = (Z - nx.amin(Z)) / (nx.amax(Z) - nx.amin(Z))
20+
Z = npy.sqrt(X**2 + Y**2)/5;
21+
Z = (Z - Z.min()) / (Z.max() - Z.min())
1922

2023
# The color array can include masked values:
21-
Zm = nx.ma.masked_where(nx.fabs(Qz) < 0.5*nx.amax(Qz), Z)
24+
Zm = ma.masked_where(npy.fabs(Qz) < 0.5*npy.amax(Qz), Z)
2225

2326

2427
fig = figure()

0 commit comments

Comments
 (0)