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

Skip to content

Commit 78d8122

Browse files
committed
moved rc to matplotlib
svn path=/trunk/matplotlib/; revision=398
1 parent 0dccead commit 78d8122

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

examples/embedding_in_wx3.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@
2121
import sys, time, os, gc
2222
import matplotlib
2323
matplotlib.use('WXAgg')
24-
from matplotlib import rcParams
25-
rcParams['image.origin'] = 'upper' # 'lower': nav toolbar problem -ADS
2624
import matplotlib.cm as cm
2725
from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
2826
from matplotlib.figure import Figure
2927
import matplotlib.numerix as numerix
28+
from matplotlib.mlab import meshgrid
29+
3030
from wxPython.wx import *
3131
from wxPython.xrc import *
3232

3333
ERR_TOL = 1e-5 # floating point slop for peak-detection
3434

35+
36+
matplotlib.rc('image', origin='upper')
37+
3538
class PlotPanel(wxPanel):
3639

3740
def __init__(self, parent):
@@ -54,11 +57,10 @@ def __init__(self, parent):
5457

5558
def init_plot_data(self):
5659
a = self.fig.add_subplot(111)
57-
self.x = numerix.arange(120.0)*2*numerix.pi/60.0
58-
self.x.resize((100,120))
59-
self.y = numerix.arange(100.0)*2*numerix.pi/50.0
60-
self.y.resize((120,100))
61-
self.y = numerix.transpose(self.y)
60+
61+
x = numerix.arange(120.0)*2*numerix.pi/60.0
62+
y = numerix.arange(100.0)*2*numerix.pi/50.0
63+
self.x, self.y = meshgrid(x, y)
6264
z = numerix.sin(self.x) + numerix.cos(self.y)
6365
self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
6466

examples/legend_demo2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
2-
# Make a legend for specific lines
2+
#
3+
# Make a legend for specific lines.
34
from matplotlib.matlab import *
45

56
t1 = arange(0.0, 2.0, 0.1)

0 commit comments

Comments
 (0)