{"id":15358572,"url":"https://github.com/astrofrog/mpl_styles","last_synced_at":"2026-06-19T15:31:30.852Z","repository":{"id":11230619,"uuid":"13623293","full_name":"astrofrog/mpl_styles","owner":"astrofrog","description":null,"archived":false,"fork":false,"pushed_at":"2013-10-16T20:54:58.000Z","size":260,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-24T07:42:03.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrofrog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-16T15:38:59.000Z","updated_at":"2013-12-15T13:20:00.000Z","dependencies_parsed_at":"2022-09-14T19:40:41.379Z","dependency_job_id":null,"html_url":"https://github.com/astrofrog/mpl_styles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/astrofrog/mpl_styles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fmpl_styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fmpl_styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fmpl_styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fmpl_styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrofrog","download_url":"https://codeload.github.com/astrofrog/mpl_styles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fmpl_styles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34538108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-01T12:41:50.070Z","updated_at":"2026-06-19T15:31:30.539Z","avatar_url":"https://github.com/astrofrog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"About\n-----\n\nThe purpose of this package is to collect and provide high-quality\n[Matplotlib](http://www.matplotlib.org) styles.\n\nCustomizing the look of Matplotlib plots is relatively easy thanks to the [rc parameter framework](http://matplotlib.org/users/customizing.html). For\nexample, you can easily set the font for your plot using:\n\n    plt.rcParams['font.family'] = 'Georgia'\n\nHowever, you may have to tweak quite a few such parameters to get a good\nlooking plot. The present package leverages the rc parameter framework to\nprovide presets that save you time if you want to just get a good looking plot\nfast.\n\nFuture versions of Matplotlib will likely include the ability to select such presets (or 'style sheets') - see  [https://github.com/matplotlib/matplotlib/pull/2236](https://github.com/matplotlib/matplotlib/pull/2236). Once this is available, the styles in this repository will be adapted so as to be usable by the new Matplotlib framework.\n\nContributing\n------------\n\nThe aim of this package is to collaboratively come up with a set of\nhigh-quality styles. Please contribute styles to ``mpl_styles/styles.py``.\nSimply define a function named ``style_\u003cstyle_name\u003e`` that takes no arguments,\nand returns a dictionary of Matplotlib rc parameter settings.\n\nInstalling\n----------\n\nThis package is still in development, but you can install the latest developer\nversion with:\n\n    git clone https://github.com/astrofrog/mpl_styles.git\n    cd mpl_styles\n    python setup.py install\n\nUsing styles\n------------\n\nYou can either set a global style for the rest of the script:\n\n    mpl_styles.use('style_name')\n\n    fig = plt.figure()\n    ax = fig.add_subplot(1,1,1)\n    ...\n\nor make use of the context manager to temporarily change the style:\n\n    with mpl_styles.use('style_name'):\n\n        fig = plt.figure()\n        ax = fig.add_subplot(1,1,1)\n        ...\n\nAvailable styles\n----------------\n\nThe following styles are currently available:\n\n* ``'test'`` - a test style:\n\n![test](test.png)\n\n* ``'white_on_black'`` - a style for presentations with black backgrounds\n\n![white_on_black](white_on_black.png)\n\nThis package is under development. We are curerntly working on a set of styles!\nPlease also contribute your own! (see *Contributing* above).\n\nFonts\n-----\n\nNote that you will need to make sure that fonts that are needed for specific\nstyles are present in TTF format on your system (which not all default system\nfonts will be). A great resource for free fonts is [Google Web Fonts](http://www.google.com/fonts).\n\nOther useful helpers\n--------------------\n\n### Improved Log Formatter\n\nThe default log formatter is Matplotlib is sub-optimal = it returns values such\nas 10^0, 10^1, etc. To use a more sensible log formatter, you can do:\n\n    from mpl_styles.formatters import LogFormatterMathtextAuto\n\n    fig = plt.figure()\n    ax = fig.add_subplot(1,1,1)\n    ax.xaxis.set_major_formatter(LogFormatterMathtextAuto())  # for the x axis\n    ax.yaxis.set_major_formatter(LogFormatterMathtextAuto())  # for the y axis\n    ...\n\nand values between (and including) 0.01 and 100 will be rendered in decimal,\nnot exponential notation. If you use the interactive pylab interface, you need to instead make the plot and then:\n\n    ...\n    from mpl_styles.formatters import LogFormatterMathtextAuto\n    gca().xaxis.set_major_formatter(LogFormatterMathtextAuto())  # for the x axis\n    gca().yaxis.set_major_formatter(LogFormatterMathtextAuto())  # for the y axis\n    gcf().canvas.draw()\n\nIf you make a plot with multiple subplots, you will need to run the\n``gca()...`` command after making each sub-plot, and the\n``gcf().canvas.draw()`` command after you are done setting all the formatters.\n\nCredits\n-------\n\nPackage inspired from a discussion with João Alves (University of Vienna)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fmpl_styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrofrog%2Fmpl_styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fmpl_styles/lists"}