René's URL Explorer Experiment


Title: [Bug]: Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). · Issue #32053 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). · Issue #32053 · matplotlib/matplotlib

X Title: [Bug]: Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). · Issue #32053 · matplotlib/matplotlib

Description: Bug summary Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). Code for reproduction import pickle import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize...

Open Graph Description: Bug summary Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). Code for reproduction import pickle import matplotlib.pypl...

X Description: Bug summary Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). Code for reproduction import pickle import matplotlib.pypl...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/32053

X: @github

direct link

Domain: Github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi().","articleBody":"### Bug summary\n\nPickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via `Figure.set_dpi()`.\n\n### Code for reproduction\n\n```python\nimport pickle\nimport matplotlib.pyplot as plt\n\nfig, ax = plt.subplots(figsize=(5, 3), dpi=100)\nax.plot([0, 1, 2, 3], [0, 1, 4, 9], label=\"quadratic\")\nax.set_title(\"DPI round trip\")\nax.legend()\n\nprint(\"Original DPI:\", fig.get_dpi())\nfig.set_dpi(150)\nprint(\"DPI after public set_dpi(150):\", fig.get_dpi())\n\nrestored = pickle.loads(pickle.dumps(fig))\nprint(\"DPI after pickle round trip:\", restored.get_dpi())\nprint(\"Line count:\", len(restored.axes[0].lines))\n\nplt.close(fig)\nplt.close(restored)\n```\n\n### Actual outcome\n\n```text\nOriginal DPI: 100\nDPI after public set_dpi(150): 150\nDPI after pickle round trip: 100\nLine count: 1\n```\n\n### Expected outcome\n\nThe explicitly configured DPI should be preserved across pickle round-tripping:\n\n```text\nOriginal DPI: 100\nDPI after public set_dpi(150): 150\nDPI after pickle round trip: 150\nLine count: 1\n```\n\n### Additional information\n\nThis regression was introduced by [PR #23476](https://github.com/matplotlib/matplotlib/pull/23476).\n\nThe new code replaces the current DPI with `_original_dpi` whenever that state entry exists. This correctly discards a transient DPI change made for a canvas device-pixel ratio, but `_original_dpi` is established independently of later public calls to `Figure.set_dpi()`. Consequently, a figure intentionally changed from 100 to 150 DPI is serialized with 100 DPI instead of 150 DPI, causing a loss of public figure state.\n\n### Operating system\n\nLinux\n\n### Matplotlib Version\n\n3.11.0\n\n### Matplotlib Backend\n\nagg\n\n### Python version\n\n3.11.13\n\n### Jupyter version\n\nN/A\n\n### Installation\n\nN/A","author":{"url":"https://github.com/RippleTester","@type":"Person","name":"RippleTester"},"datePublished":"2026-07-17T10:07:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/32053/matplotlib/issues/32053"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9236e9ee-bf37-2ddd-8077-380b90608685
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBFE8:E9480:1B5649:24CEF8:6A62834C
html-safe-nonced4478e9181f275409f5d9e0171bc21867f8035a6dea30b1ead1da23cbf7af36e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkU4OkU5NDgwOjFCNTY0OToyNENFRjg6NkE2MjgzNEMiLCJ2aXNpdG9yX2lkIjoiMTU0MDM4ODY5NTM1MDM0NjU3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaceeb061dff08291d89571a081011a97f3b2ba93482eaf2ec1a87838c5c8d376af
hovercard-subject-tagissue:4910296880
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/32053/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fd4345d735bfab0a2a00e8d41309a7120318ce76606b9e2eb797c867f131390b/matplotlib/matplotlib/issues/32053
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fd4345d735bfab0a2a00e8d41309a7120318ce76606b9e2eb797c867f131390b/matplotlib/matplotlib/issues/32053
og:image:altBug summary Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi(). Code for reproduction import pickle import matplotlib.pypl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRippleTester
hostnamegithub.com
expected-hostnamegithub.com
None834f5745a0905171956ffda6a4bdff25548a80194071fe4a15acaa5b349a60a0
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4d79f1b99472a521fc5fb66e9fdc3ce742937dff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/matplotlib/matplotlib/issues/32053#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32053
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32053
Sign up https://Github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://Github.com/matplotlib/matplotlib/issues/32053
Reloadhttps://Github.com/matplotlib/matplotlib/issues/32053
Reloadhttps://Github.com/matplotlib/matplotlib/issues/32053
Please reload this pagehttps://Github.com/matplotlib/matplotlib/issues/32053
matplotlib https://Github.com/matplotlib
matplotlibhttps://Github.com/matplotlib/matplotlib
Please reload this pagehttps://Github.com/matplotlib/matplotlib/issues/32053
Notifications https://Github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://Github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://Github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://Github.com/matplotlib/matplotlib
Issues 1.1k https://Github.com/matplotlib/matplotlib/issues
Pull requests 421 https://Github.com/matplotlib/matplotlib/pulls
Actions https://Github.com/matplotlib/matplotlib/actions
Projects https://Github.com/matplotlib/matplotlib/projects
Wiki https://Github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://Github.com/matplotlib/matplotlib/security
Insights https://Github.com/matplotlib/matplotlib/pulse
Code https://Github.com/matplotlib/matplotlib
Issues https://Github.com/matplotlib/matplotlib/issues
Pull requests https://Github.com/matplotlib/matplotlib/pulls
Actions https://Github.com/matplotlib/matplotlib/actions
Projects https://Github.com/matplotlib/matplotlib/projects
Wiki https://Github.com/matplotlib/matplotlib/wiki
Security and quality https://Github.com/matplotlib/matplotlib/security
Insights https://Github.com/matplotlib/matplotlib/pulse
[Bug]: Pickle round-tripping a figure incorrectly restores its original DPI instead of a DPI explicitly changed via Figure.set_dpi().https://Github.com/matplotlib/matplotlib/issues/32053#top
ai-contributionPRs that are AI generated without a human in the loophttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22ai-contribution%22
first-contributionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22first-contribution%22
https://github.com/RippleTester
RippleTesterhttps://github.com/RippleTester
on Jul 17, 2026https://github.com/matplotlib/matplotlib/issues/32053#issue-4910296880
PR #23476https://github.com/matplotlib/matplotlib/pull/23476
ai-contributionPRs that are AI generated without a human in the loophttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22ai-contribution%22
first-contributionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22first-contribution%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.