{"id":26471124,"url":"https://github.com/paulvirally/mplfig","last_synced_at":"2026-05-20T04:49:30.977Z","repository":{"id":50375457,"uuid":"518900782","full_name":"PaulVirally/mplfig","owner":"PaulVirally","description":"Save and load matplotlib figures like MATLAB's .fig files!","archived":false,"fork":false,"pushed_at":"2022-07-28T16:31:55.000Z","size":500,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T20:53:18.563Z","etag":null,"topics":["matplotlib","matplotlib-figures","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaulVirally.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-28T15:31:08.000Z","updated_at":"2025-01-09T08:19:30.000Z","dependencies_parsed_at":"2022-09-19T13:12:16.221Z","dependency_job_id":null,"html_url":"https://github.com/PaulVirally/mplfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulVirally%2Fmplfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulVirally%2Fmplfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulVirally%2Fmplfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulVirally%2Fmplfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulVirally","download_url":"https://codeload.github.com/PaulVirally/mplfig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244506034,"owners_count":20463464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","matplotlib-figures","python","python3"],"created_at":"2025-03-19T20:53:23.220Z","updated_at":"2026-05-20T04:49:30.946Z","avatar_url":"https://github.com/PaulVirally.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"mplfig\n======\n\nMatplotlib by default only allows you to export your figures in formats that are used for publishing (e.g., a `.pgf` file, a resterized `.png` file, etc.). MATLAB allows you to save files in a `.fig` format which allows you to change the plot very easily (say, to fix a typo on an axis label, or to change the colorscheme). mplfig strives to bring this functionality to matplotlib. With mplfig, you can save your matplotlib files and load them right back up in another python script.\n\nExample\n=======\n\nFirst, create a figure and save with it mplfig.\n```python\nimport mplfig\nimport matplotlib.pyplot as plt\n\nxs = list(range(10))\nys = list(map(lambda x: x**2, xs))\n\nplt.plot(xs, ys)\nmplfig.save_figure(plt.gcf(), 'myfig.mplpkl')\n\nplt.show()\n```\n![Before](example_before.png)\n\nNext, load it back up and change the figure!\n```python\nimport mplfig\nimport matplotlib.pyplot as plt\n\nfig = mplfig.load_figure('myfig.mplpkl') # Load the saved figure\n\naxes = fig.get_axes()\naxes[0].set_xlabel('$x$') # Add an x label\naxes[0].set_ylabel('$y = x^2$') # Add a y label\naxes[0].lines[0].set_marker('o') # Add a circle marker\n\nplt.show()\n```\n![After](example_after.png)\n\nInstall\n=======\n\nmplfig is on PyPI\n```sh\npip3 install -U mplfig\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulvirally%2Fmplfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulvirally%2Fmplfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulvirally%2Fmplfig/lists"}