-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
LOG: added printout of rcParams at debug level #10039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly concerned about the verbosity.
Yeah if you set level to DEBUG you get a lot of output and it basically needs to go in a file. OTOH I don’t think there is any reason to be shy about verbose output when using debug. The motivation here is to just ask the user for one file rather than the debug output and the matpltolibrc. But I don’t feel strongly if this is seen as cluttering up the debug info. FWIW I usually put the logging info after the matpltolib import to keep the log shorter without all the startup info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, it might be good to include the output of matplotlib.get_fname()
, which shows the source of the matplotlibrc file that might have modified the rcParams
. This is probably more valuable for debugging than the full rcParams
.
@@ -1181,6 +1182,9 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True): | |||
if rcParams['axes.formatter.use_locale']: | |||
locale.setlocale(locale.LC_ALL, '') | |||
|
|||
_log.debug('rcParams: ') | |||
_log.debug(rcParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested consolidation:
_log.debug('rcParams:\n%s', rcParams)
I think this will result in a more nicely-formatted output because it will not have the extra header info from the logging formatter at the start of the rcParams
list.
it's #9761. |
OK, I think I agree that this is very very verbose, and indeed a more reliable way of asking a user for their rcParams is: from matplotlib import rcParams
print(rcParams) So I think I'll close this. |
PR Summary
In helping to debug #10016 I noted that there is no good way to see what the rcParams are in the debug interface. This seemed easy to add
PR Checklist