Repository navigation
Description
import matplotlib
print "\n".join(dir(matplotlib))yields
RcParams
Verbose
__builtins__
__doc__
__file__
__name__
__package__
__path__
__version__
__version__numpy__
_create_tmp_config_dir
_deprecated_ignore_map
_deprecated_map
_get_configdir
_get_data_path
_get_data_path_cached
_get_home
_havedate
_is_writable_dir
_python24
_required
_use_error_msg
ascii
byte2str
cbook
checkdep_dvipng
checkdep_ghostscript
checkdep_inkscape
checkdep_pdftops
checkdep_ps_distiller
checkdep_tex
checkdep_usetex
checkdep_xmllint
colors
compare_versions
compat
converter
dateutil
default
defaultParams
default_test_modules
distutils
expected_version
fontconfig_pattern
found_version
get_backend
get_configdir
get_data_path
get_example_data
get_home
get_py2exe_datafiles
interactive
is_interactive
is_string_like
key
major
matplotlib_fname
minor1
minor2
numpy
os
print_function
pyparsing
rc
rcParams
rcParamsDefault
rcParamsOrig
rc_context
rc_file
rc_file_defaults
rc_params
rc_params_from_file
rcdefaults
rcsetup
re
s
shutil
subprocess
sys
tempfile
test
tk_window_focus
tmp
use
validate_backend
validate_toolbar
verbose
warnings
x
This is a mess; from the user's standpoint there are some useful things in there, but they are hard to identify among all the detritus from the startup process. And then there is the bewildering rc conglomeration. Maybe that should be treated separately.
I'm not sure whether cleaning this up requires one or more MEPs, but it probably does require some strategic thinking, so I am starting this with a MEP tag.
As a first shot, maybe all that is required is a bunch of del commands sprinkled throughout init.py. Or, every variable and module that needs to be deleted could be given a unique prefix, or added to a list, and then all could be deleted at the end.
Alternatively, leading underscores could be used aggressively so that at least when using ipython tab completion, only names that are intended to be part of the public API would appear.
Activity
pelson commentedon May 23, 2013
To remove most of the
rctype objects we can create aconfigmodule and simply expose the RcParams instancercParamstomatplotlib/__init__.py. We might consider adding the context manager capabilities to the RcParams class itself (with a method, rather than overriding__call__or some other such loaded behaviour).As you say, much of the rest looks like it could simply be
deleted.pelson commentedon May 23, 2013
I don't necessarily think we need a MEP for this - thanks to @mdboom's deprecate wrapper it'd be a pretty quick PR to deprecate most of the unnecessary stuff - is feasible to get this into
v1.3and actually removed inv1.4+.dpsanders commentedon Jul 20, 2013
The name
rcParamsis terrible -- it reeks of 1970s UNIX! What aboutmpl_parameters, or justparameters?Easy enough to introduce the new name and deprecate the old without breaking anything.
petehuang commentedon Dec 29, 2016
Namespace is still stuffy. For clarity, the deprecate functionality is here https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/cbook.py. You can see examples of usage in commit 8364f87
github-actions commentedon Mar 1, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
timhoffm commentedon Mar 1, 2023
While we have made some progress, there's still things we may want to clean up.
timhoffm commentedon Sep 15, 2025
More cleanup done in #28728.
I think the only left cleanup is the set of
*rcfunctions, but that would be part of a redesign and we don't need to keep this issue open for that.