{"id":13869865,"url":"https://github.com/liuyxpp/mpltex","last_synced_at":"2025-08-04T17:43:57.993Z","repository":{"id":20410123,"uuid":"23686334","full_name":"liuyxpp/mpltex","owner":"liuyxpp","description":"A python package for producing publication quality images using matplotlib.","archived":false,"fork":false,"pushed_at":"2020-09-08T12:31:34.000Z","size":751,"stargazers_count":100,"open_issues_count":0,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-18T04:44:39.315Z","etag":null,"topics":["matplotlib","plotting","plotting-in-python","publishing","python"],"latest_commit_sha":null,"homepage":"http://www.yxliu.group/software/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liuyxpp.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-05T01:42:35.000Z","updated_at":"2025-05-12T17:40:23.000Z","dependencies_parsed_at":"2022-07-26T02:47:12.273Z","dependency_job_id":null,"html_url":"https://github.com/liuyxpp/mpltex","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/liuyxpp/mpltex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyxpp%2Fmpltex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyxpp%2Fmpltex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyxpp%2Fmpltex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyxpp%2Fmpltex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuyxpp","download_url":"https://codeload.github.com/liuyxpp/mpltex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuyxpp%2Fmpltex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263250602,"owners_count":23437288,"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","plotting","plotting-in-python","publishing","python"],"created_at":"2024-08-05T20:01:20.099Z","updated_at":"2025-07-03T03:05:44.566Z","avatar_url":"https://github.com/liuyxpp.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"mpltex\n======\n\n``mpltex`` is a python package for producing publication quality images using ``matplotlib``, which is inspired by `Olga Botvinnik \u003chttp://olgabotvinnik.com/\u003e`_'s python package `prettyplotlib \u003chttps://github.com/olgabot/prettyplotlib\u003e`_. Tutorial can be found at `www.yxliu.group \u003chttp://www.yxliu.group/2014/09/mpltex\u003e`_.\n\nThe internal ``matplotlib`` color cycle is replaced by Tableau classic 10 color scheme which looks less saturated and more pleasing to eyes.\nThe colors of this scheme is reordered, which is different from current version of ``matplotlib`` v3.\nOther available color schemes for multi-line plots are ColorBrewer Set 1 and Tableau classic 20.\nFor more information on these color schemes, see `documentation of palettable \u003chttps://jiffyclub.github.io/palettable\u003e`_.\n\n``mpltex`` also provide a way to generate highly configurable line styles with colors, line types, and line markers.\nHollow markers are supported.\n\n``mpltex`` should work properly both in Python 2 and 3. If not, please file an issue at `Github \u003chttps://github.com/liuyxpp/mpltex\u003e`_.\n\nQuickstart\n----------\n\n1. Install\n^^^^^^^^^^\n\n::\n\n    $ pip install mpltex\n\n**Required Packages**\n\n-  `matplotlib \u003chttp://matplotlib.org/\u003e`_. Can be installed via\n   ``pip install matplotlib``.\n-  `palettable \u003chttps://github.com/jiffyclub/palettable\u003e`_. Can be\n   installed via ``pip install palettable``.\n\n2. Usage\n^^^^^^^^\n\nExamples and sample plots can be found `here \u003chttp://www.yxliu.group/2014/09/mpltex\u003e`_.\n\nTo use `mpltex`, just add one of ``mpltex`` decorators before your plot functions.\n\n.. code:: python\n\n    import mpltex\n\n    @mpltex.acs_decorator\n    def myplot():\n        # plot images by matplotlib ...\n\n        # Save the image. Give a file name without extension.\n        # You can also save figure outside your_plot if you like.\n        fig.save_fig('/path/to/save/fig/figname')\n\n    # Then use your_plot in a normal way.\n    myplot()\n\nAnd it will create a plot ready for publishing in journals published by American Chemical Society (ACS).\n\n**Available Decorators**\n\n* ``mpltex.acs_decorator``: output EPS images for publishing in ACS (American Chemical Society).\n* ``mpltex.aps_decorator``: output EPS images for publishing in APS (American Physical Society).\n* ``mpltex.rsc_decorator``: output EPS images for publishing in RSC (Royal Society of Chemistry).\n* ``mpltex.presentation_decorator``: output PDF images for presentation slides (Keynote).\n* ``mpltex.web_decorator``: output PNG images for web pages.\n\n``mpltex`` also provides several helper functions to facilitate production of specific type of images.\nFollowing codes will produce a set of line arts with cycled line styles with the help of ``mpltex.linestyle_generator`` function.\nNote that since version 0.5, ``linestyles`` is a shorthand for ``linestyle_generator``.\n\n.. code:: python\n\n    import matplotlib.pyplot as plt\n    import mpltex\n\n    @mpltex.acs_decorator\n    def myplot():\n        # ...   # generate data x and y\n        fig, ax = plt.subplots(111)\n\n        # The default line style is iterating over\n        # color, line, and marker with hollow types.\n        linestyles = mpltex.linestyles()\n        # equivalently\n        # linestyles = mpltex.linestyle_generator()\n\n        for i in range(number_of_lines):\n            ax.plot(x[i], y[i], label=str(i), **next(linestyles)\n\n        ax.locator_params(nbins=5)  # limit the number of major ticks\n        ax.legend(loc='best')  # show legend in a best location\n        fig.tight_layout(pad=0.1)  # make layout as tight as possible\n        fig.savefig('/path/to/save/fig/figname')\n\nContribute\n----------\n\nFork the project at `github.com \u003chttps://github.com/liuyxpp/mpltex\u003e`_ and file a pull request.\n\nLinks\n-----\n\n* `Yi-Xin Liu's personal academic website \u003chttp://www.yxliu.group\u003e`_\n* `Development version at github.com \u003chttps://github.com/liuyxpp/mpltex\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuyxpp%2Fmpltex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuyxpp%2Fmpltex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuyxpp%2Fmpltex/lists"}