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

Skip to content

[Bug]: rc settings are altered in jupyter #23825

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

Closed
pulkin opened this issue Sep 8, 2022 · 2 comments
Closed

[Bug]: rc settings are altered in jupyter #23825

pulkin opened this issue Sep 8, 2022 · 2 comments

Comments

@pulkin
Copy link

pulkin commented Sep 8, 2022

Bug summary

I need to set font.size = 25 in my matplotlibrc but it has no effect in my notebook. A bunch of other settings is also updated. Works normally outside notebooks.

Code for reproduction

from matplotlib import rcParams, __version__, pyplot

print(__version__, rcParams["font.size"])
orig = dict(rcParams)
pyplot.plot([0, 1], [0, 1])
after = dict(rcParams)
for k in orig:
    if k not in after:
        print(f"missing in after: {k} = {orig[k]}")
    elif after[k] != orig[k]:
        print(f"changed after: {k} = {after[k]} != {orig[k]}")
for k in after:
    if k not in orig:
        print(f"missing in orig: {k} = {after[k]}")
print(rcParams["font.size"])
pyplot.xlabel("x")
print(rcParams["font.size"])
pyplot.show()

Actual outcome

3.5.3 25.0
changed after: figure.dpi = 72.0 != 100.0
changed after: figure.edgecolor = (1, 1, 1, 0) != white
changed after: figure.facecolor = (1, 1, 1, 0) != white
changed after: figure.figsize = [6.0, 4.0] != [6.4, 4.8]
changed after: figure.subplot.bottom = 0.125 != 0.11
changed after: font.size = 10.0 != 25.0
changed after: interactive = True != False
10.0
10.0

Expected outcome

Font size (25 in this case) remains intact.

Additional information

No response

Operating system

Fedora

Matplotlib Version

3.5.3

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

No response

Jupyter version

3.4.3

Installation

pip

@pulkin
Copy link
Author

pulkin commented Sep 8, 2022

Probably ipython/ipython#10383 and related. Not sure how to fix though: updating from pip does not work for me.

@pulkin
Copy link
Author

pulkin commented Sep 8, 2022

Updating matplotlib-inline to 0.1.6 (was 0.1.3) inside kernel environment worked for me.

@pulkin pulkin closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant