{ "info": { "author": "Peter Zagubisalo", "author_email": "peter.zagubisalo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "# Matplotlib Helper\n\nMatplotlib Helper is my custom helper to tune Matplotlib experience for [Pandoctools/Knitty](https://github.com/kiwi0fruit/pandoctools) (but it can be used by itself). I tuned fonts (that are shipped with this python package), please see default fonts and other options in default keyword arguments of [`ready()`](https://github.com/kiwi0fruit/matplotlibhelper/blob/master/matplotlibhelper/matplotlib_helper.py)). I made some tweaks to use it with [SugarTeX](https://github.com/kiwi0fruit/sugartex), some tweaks to automatically use interactive Qt5 plots in Atom/Hydrogen or non-jupyter Python. It can also export plots to SVG or PNG.\n\nWorks in Jupyter as well.\n\n\n# Contents\n\n* [Matplotlib Helper](#matplotlib-helper)\n* [Contents](#contents)\n* [Install](#install)\n* [Usage example](#usage-example)\n* [Hints](#hints)\n\n\n# Install\n\nVia conda:\n\n```\nconda install -c defaults -c conda-forge matplotlibhelper\n```\n\nVia pip:\n\n```\npip install matplotlibhelper\n```\n\n\nAdditionally you may need to install to use in Jupyter Lab:\n\n```\nconda install jupyterlab jupyterlab_server tk nodejs\npip install ipympl\njupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib\n```\nInstead of `pip install ipympl` you can also try:\n```\nconda update --all\nconda install -c defaults -c conda-forge ipympl\nconda update --all\n```\n\n\n## Usage example\n\nUsage example that works both in Atom+Hydrogen and in Pandoctools+Knitty:\n\n```py\nfrom IPython.display import Markdown\nimport matplotlibhelper as mh\nmh.ready(font_size=14) # should be run before import matplotlib.pyplot\nimport matplotlib.pyplot as plt\n\n\nplt.figure(figsize=mh.figsize(w=6)) # height is automatic via the golden ration\nplt.plot([1, 2, 3, 4])\nplt.ylabel(mh.stex('\u02ce\u2207 \u22c5 [ \u20d7E]\u02ce, V/m')) # using SugarTeX\n\n# this code in Knitty would be parsed by Pandoc,\n# in Atom/Hydrogen or Jupyter it would be displayed:\nMarkdown(f'![My beautiful figure]({mh.img(plt)}){{#fig:1}}')\n```\n\nQt backend gives [interactive plots in Atom/Hydrogen](https://nteract.gitbooks.io/hydrogen/docs/Usage/Examples.html#interactive-plots-using-matplotlib).\n\n\n## Hints\n\n1. Delete `fontList.cache`, `fontList.py3k.cache` or `fontList.json` from `%USERPROFILE%\\.matplotlib` folder after installing a new font.\n2. If font becomes bold without a reason try ([source](https://github.com/matplotlib/matplotlib/issues/5574)):\n\n```py\nfrom matplotlib import font_manager\nif 'roman' in font_manager.weight_dict:\n del font_manager.weight_dict['roman']\n # noinspection PyProtectedMember\n font_manager._rebuild()\n```\n\n3. Install [Computer Modern Unicode](https://sourceforge.net/projects/cm-unicode/) for bold-italic unicode support: `\"mathtext.sf\": \"CMU Serif:bold:italic\"`. Sans-serif command `\\mathsf{}` is reassigned because sans-serif font is rarely used in serif docs.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kiwi0fruit/matplotlibhelper", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "matplotlibhelper", "package_url": "https://pypi.org/project/matplotlibhelper/", "platform": "", "project_url": "https://pypi.org/project/matplotlibhelper/", "project_urls": { "Homepage": "https://github.com/kiwi0fruit/matplotlibhelper" }, "release_url": "https://pypi.org/project/matplotlibhelper/0.0.8/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Matplotlib Helper is my custom helper to tune Matplotlib experience in Atom/Hydrogen and Pandoctools/Knitty.", "version": "0.0.8" }, "last_serial": 5096746, "releases": { "0.0.4": [ { "comment_text": "", "digests": { "md5": "c45679992099bc471ee6cc79bbc97aa3", "sha256": "ba5e442ee26d8ba72eda421900745095b89c7156179f4653a3a848cc5fe9d984" }, "downloads": -1, "filename": "matplotlibhelper-0.0.4.tar.gz", "has_sig": false, "md5_digest": "c45679992099bc471ee6cc79bbc97aa3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2750617, "upload_time": "2019-01-19T13:07:31", "url": "https://files.pythonhosted.org/packages/33/0d/105419a925b8b641a4f3a5a637229f1d4d46914147abc98377b514e67777/matplotlibhelper-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "076117e197280281783710575e81e2f4", "sha256": "ec693f3c0295d9b78efdd6c9445a450f5409e4335fa914ef840ef3bf1750ee9f" }, "downloads": -1, "filename": "matplotlibhelper-0.0.5.tar.gz", "has_sig": false, "md5_digest": "076117e197280281783710575e81e2f4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2751066, "upload_time": "2019-01-22T08:26:54", "url": "https://files.pythonhosted.org/packages/bc/69/963787b98f5ced16e35222fca8e5e8389e32ab7a62c3a44b43741aa50234/matplotlibhelper-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "6906686636df241fecfe1c28fb900fb1", "sha256": "7b6215e0085895c23d4929dc4fd8054639eb8a6830bb6ec2ac596506d043fd94" }, "downloads": -1, "filename": "matplotlibhelper-0.0.6.tar.gz", "has_sig": false, "md5_digest": "6906686636df241fecfe1c28fb900fb1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2751042, "upload_time": "2019-01-22T08:36:21", "url": "https://files.pythonhosted.org/packages/d8/2c/ab3474cd23da4b3096e4061f375dc0e6837e56cd7540ea491492c879bdaf/matplotlibhelper-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "2b483345ad5743a55574ba92141c46f3", "sha256": "9ea924b5c83c61c1a88b72dd2c6a4565cff60fda81ad9d6e0e235b3ece37815a" }, "downloads": -1, "filename": "matplotlibhelper-0.0.7.tar.gz", "has_sig": false, "md5_digest": "2b483345ad5743a55574ba92141c46f3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2401542, "upload_time": "2019-04-04T06:24:09", "url": "https://files.pythonhosted.org/packages/10/80/eebeaa4392109573ac86f45780b42ac6bab07d44a3ec6c987198080d2dbb/matplotlibhelper-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "d61fb94a9ba1ccf7d88dfd0d7e5db64f", "sha256": "4d24ccd18c4ea3122654e41aef160fb4f21581f6d03c16fbed8f150b53e316c5" }, "downloads": -1, "filename": "matplotlibhelper-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d61fb94a9ba1ccf7d88dfd0d7e5db64f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1672428, "upload_time": "2019-04-04T11:51:07", "url": "https://files.pythonhosted.org/packages/78/25/00ec033e9b155828d3cebc95bca61d67f4c2c8adbe4e42063afd1442cb52/matplotlibhelper-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d61fb94a9ba1ccf7d88dfd0d7e5db64f", "sha256": "4d24ccd18c4ea3122654e41aef160fb4f21581f6d03c16fbed8f150b53e316c5" }, "downloads": -1, "filename": "matplotlibhelper-0.0.8.tar.gz", "has_sig": false, "md5_digest": "d61fb94a9ba1ccf7d88dfd0d7e5db64f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1672428, "upload_time": "2019-04-04T11:51:07", "url": "https://files.pythonhosted.org/packages/78/25/00ec033e9b155828d3cebc95bca61d67f4c2c8adbe4e42063afd1442cb52/matplotlibhelper-0.0.8.tar.gz" } ] }