Skip to content

Commit 19cbb14

Browse files
committed
Merge branch 'issue498' of git://github.com/mdboom/matplotlib into mdboom-issue498
Conflicts: lib/matplotlib/cbook.py
2 parents 2c91aa6 + 6c5e961 commit 19cbb14

31 files changed

+6273
-331
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include lib/matplotlib/mpl-data/images/*
1313
include lib/matplotlib/mpl-data/fonts/ttf/*
1414
include lib/matplotlib/mpl-data/fonts/pdfcorefonts/*
1515
include lib/matplotlib/mpl-data/fonts/afm/*
16+
recursive-include lib/matplotlib/mpl-data/sample_data/*
1617
recursive-include license LICENSE*
1718
recursive-include examples *
1819
recursive-include doc *

examples/misc/sample_data_test.py

-27
This file was deleted.

examples/pylab_examples/centered_ticklabels.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import matplotlib.pyplot as plt
2222

2323
# load some financial data; apple's stock price
24-
fh = cbook.get_sample_data('aapl.npy')
24+
fh = cbook.get_sample_data('aapl.npy.gz')
2525
r = np.load(fh); fh.close()
2626
r = r[-250:] # get the last 250 days
2727

examples/pylab_examples/data_helper.py

100644100755
+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def get_two_stock_data():
1111
"""
1212
ticker1, ticker2 = 'INTC', 'AAPL'
1313

14-
file1 = cbook.get_sample_data('INTC.dat', asfileobj=False)
15-
file2 = cbook.get_sample_data('AAPL.dat', asfileobj=False)
16-
M1 = fromstring( open(file1, 'rb').read(), '<d')
14+
file1 = cbook.get_sample_data('INTC.dat.gz')
15+
file2 = cbook.get_sample_data('AAPL.dat.gz')
16+
M1 = fromstring( file1.read(), '<d')
1717

1818
M1 = resize(M1, (M1.shape[0]/2,2) )
1919

20-
M2 = fromstring( open(file2, 'rb').read(), '<d')
20+
M2 = fromstring( file2.read(), '<d')
2121
M2 = resize(M2, (M2.shape[0]/2,2) )
2222

2323
d1, p1 = M1[:,0], M1[:,1]

examples/pylab_examples/image_demo2.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
w, h = 512, 512
88

9-
datafile = cbook.get_sample_data('ct.raw', asfileobj=False)
10-
print ('loading %s' % datafile)
11-
s = open(datafile, 'rb').read()
9+
datafile = cbook.get_sample_data('ct.raw.gz', asfileobj=True)
10+
s = datafile.read()
1211
A = fromstring(s, uint16).astype(float)
1312
A *= 1.0/max(A)
1413
A.shape = w, h
@@ -35,4 +34,3 @@
3534
setp(gca(), 'xticklabels', [])
3635

3736
show()
38-

examples/pylab_examples/mri_demo.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
from pylab import *
55
import matplotlib.cbook as cbook
66
# data are 256x256 16 bit integers
7-
dfile = cbook.get_sample_data('s1045.ima', asfileobj=False)
8-
print ('loading image %s' % dfile)
9-
im = np.fromstring(open(dfile, 'rb').read(), np.uint16).astype(float)
7+
dfile = cbook.get_sample_data('s1045.ima')
8+
im = np.fromstring(dfile.read(), np.uint16).astype(float)
109
im.shape = 256, 256
1110

1211
#imshow(im, ColormapJet(256))

examples/pylab_examples/mri_with_eeg.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515

1616
if 1: # load the data
1717
# data are 256x256 16 bit integers
18-
dfile = cbook.get_sample_data('s1045.ima', asfileobj=False)
19-
print ('loading image %s' % dfile)
20-
im = np.fromstring(open(dfile, 'rb').read(), np.uint16).astype(float)
18+
dfile = cbook.get_sample_data('s1045.ima.gz')
19+
im = np.fromstring(dfile.read(), np.uint16).astype(float)
2120
im.shape = 256, 256
2221

2322
if 1: # plot the MRI in pcolor

lib/matplotlib/__init__.py

-14
Original file line numberDiff line numberDiff line change
@@ -813,20 +813,6 @@ def rc_params_from_file(fname, fail_on_error=False):
813813
# this is the instance used by the matplotlib classes
814814
rcParams = rc_params()
815815

816-
if rcParams['examples.directory']:
817-
# paths that are intended to be relative to matplotlib_fname()
818-
# are allowed for the examples.directory parameter.
819-
# However, we will need to fully qualify the path because
820-
# Sphinx requires absolute paths.
821-
if not os.path.isabs(rcParams['examples.directory']):
822-
_basedir, _fname = os.path.split(matplotlib_fname())
823-
# Sometimes matplotlib_fname() can return relative paths,
824-
# Also, using realpath() guarentees that Sphinx will use
825-
# the same path that matplotlib sees (in case of weird symlinks).
826-
_basedir = os.path.realpath(_basedir)
827-
_fullpath = os.path.join(_basedir, rcParams['examples.directory'])
828-
rcParams['examples.directory'] = _fullpath
829-
830816
rcParamsOrig = rcParams.copy()
831817

832818
rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \

0 commit comments

Comments
 (0)