@@ -509,29 +509,8 @@ def get_cachedir():
509
509
510
510
511
511
@_logged_cached ('matplotlib data path: %s' )
512
- def get_data_path (* , _from_rc = None ):
512
+ def get_data_path ():
513
513
"""Return the path to Matplotlib data."""
514
- if _from_rc is not None :
515
- cbook .warn_deprecated (
516
- "3.2" ,
517
- message = ("Setting the datapath via matplotlibrc is deprecated "
518
- "%(since)s and will be removed in %(removal)s." ),
519
- removal = '3.3' )
520
- path = Path (_from_rc )
521
- if path .is_dir ():
522
- defaultParams ['datapath' ][0 ] = str (path )
523
- return str (path )
524
- else :
525
- warnings .warn (f"You passed datapath: { _from_rc !r} in your "
526
- f"matplotribrc file ({ matplotlib_fname ()} ). "
527
- "However this path does not exist, falling back "
528
- "to standard paths." )
529
-
530
- return _get_data_path ()
531
-
532
-
533
- @_logged_cached ('(private) matplotlib data path: %s' )
534
- def _get_data_path ():
535
514
path = Path (__file__ ).with_name ("mpl-data" )
536
515
if path .is_dir ():
537
516
defaultParams ['datapath' ][0 ] = str (path )
@@ -594,7 +573,7 @@ def gen_candidates():
594
573
yield matplotlibrc
595
574
yield os .path .join (matplotlibrc , 'matplotlibrc' )
596
575
yield os .path .join (get_configdir (), 'matplotlibrc' )
597
- yield os .path .join (_get_data_path (), 'matplotlibrc' )
576
+ yield os .path .join (get_data_path (), 'matplotlibrc' )
598
577
599
578
for fname in gen_candidates ():
600
579
if os .path .exists (fname ) and not os .path .isdir (fname ):
@@ -861,10 +840,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
861
840
config .update (config_from_file )
862
841
863
842
with cbook ._suppress_matplotlib_deprecation_warning ():
864
- if config ['datapath' ] is None :
865
- config ['datapath' ] = _get_data_path ()
866
- else :
867
- config ['datapath' ] = get_data_path (_from_rc = config ['datapath' ])
843
+ config ['datapath' ] = get_data_path ()
868
844
869
845
if "" .join (config ['text.latex.preamble' ]):
870
846
_log .info ("""
0 commit comments