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

Skip to content

Commit 890071e

Browse files
authored
Merge pull request #6726 from tacaswell/mnt_simplify_get_data
MNT: use _get_data_path is cbook
2 parents a2c3344 + 762d895 commit 890071e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/cbook.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,7 @@ def get_sample_data(fname, asfileobj=True):
821821
if matplotlib.rcParams['examples.directory']:
822822
root = matplotlib.rcParams['examples.directory']
823823
else:
824-
root = os.path.join(os.path.dirname(__file__),
825-
"mpl-data", "sample_data")
824+
root = os.path.join(matplotlib._get_data_path(), 'sample_data')
826825
path = os.path.join(root, fname)
827826

828827
if asfileobj:

0 commit comments

Comments
 (0)