{ "info": { "author": "Floris Laporte", "author_email": "floris.laporte@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "\n# MPLPPT\n`mplppt` is a simple library made from some hacky scripts I used to use to convert matplotlib figures to powerpoint figures. Which makes this a hacky library, I guess \ud83d\ude00.\n\n## Goal\n\n`mplppt` seeks to implement an alternative `savefig` function for `matplotlib` figures. This `savefig` function saves a `matplotlib` figure with a single axis to a powerpoint presentation with a single slide containing the figure. \n\n## Installation\n```bash\npip install mplppt\n```\n\n## Supported Conversions\n\n`mplppt` supports [partly] conversion of the following matplotlib objects:\n* Lines [`matplotlib.lines.Line2D`]\n* Rectangles [`matplotlib.patches.Rectangle`]\n* Polygons [`matplotlib.patches.Polygon`]\n* pcolormesh [`matplotlib.collections.QuadMesh`]\n* text [`matplotlib.text.Text`]\n\nso far `mplppt` does not (yet) support (out of many other things):\n* markers (including tick marks)\n* linestyle\n\n\n## Simple Example\nAn example of all different conversions available for mplppt. Below we give an example of how all these objects can be combined into a single plot, which can then be exported to powerpoint:\n\n\n```python\n# plot [Line2D]\nx = np.linspace(-1,5)\ny = np.sin(x)\nplt.plot(x,y,color='C1')\n\n# rectangle\nplt.gca().add_patch(mpl.patches.Rectangle((0, 0), 3, 0.5))\n\n# polygon\nplt.gca().add_patch(mpl.patches.Polygon(np.array([[5.0,1.0],[4.0,-0.2],[2.0,0.6]]), color=\"red\"))\n\n# pcolormesh\nx = np.linspace(0,1, 100)\ny = np.linspace(0,1, 100)\nX, Y = np.meshgrid(x,y)\nZ = X**2 + Y**2\nplt.pcolormesh(X,Y,Z)\n\n# text\ntext = plt.text(0,0,'hello')\n\n# set limits\nplt.ylim(-0.5,1)\n\n# Save figure to pptx\nmplppt.savefig('first_example.pptx')\n\n# show figure\nplt.show()\n```\n\n\n![png](img/plot.png)\n\n\nWhich results in a powerpoint slide which looks as follows:\n\n![simple powerpoint export screenshot](img/slide.png)\n\n## Cool! What else can I do with this?\n\nYou are not bound to using matplotlib! The `mplppt` repository contains some standard powerpoint shapes that you can use. Try something like:\n\n\n```python\nppt = mplppt.Group() # Create a new group of objects\nppt += mplppt.Rectangle(name='rect', x=0, y=0, cx=100, cy=100, slidesize=(10,5)) # add an object to the group\nppt.save('second_example.pptx') # export the group as a ppt slide\n```\n\n## Is any of this documented?\n\nNo.\n\n## How does this work?\n\nThe repository contains a template folder, which is nothing more than an empty powerpoint presentation which is unzipped. After making a copy of the template folder and adding some `xml` code for the shapes, the modified folder is zipped into a `.pptx` file.\n\n## Copyright\n\n\u00a9 Floris Laporte - MIT License\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/flaport/mplppt", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mplppt", "package_url": "https://pypi.org/project/mplppt/", "platform": "", "project_url": "https://pypi.org/project/mplppt/", "project_urls": { "Homepage": "http://github.com/flaport/mplppt" }, "release_url": "https://pypi.org/project/mplppt/0.0.0/", "requires_dist": null, "requires_python": "", "summary": "Convert a matplotlib figure to a powerpoint slide", "version": "0.0.0" }, "last_serial": 5524414, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "c742384c9218962c15732acccc0fd784", "sha256": "d58b2d919c5f0d64e6199d923f9747c53e1a147b0f77698b56ea98cfb474d957" }, "downloads": -1, "filename": "mplppt-0.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "c742384c9218962c15732acccc0fd784", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 25917, "upload_time": "2019-07-12T18:17:23", "url": "https://files.pythonhosted.org/packages/f4/a0/c39aa10f8453eadc174c0e3c05819810a9059a9f03ecb98644fa10a7ff8b/mplppt-0.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17ad1c262d9fb395b08ca49999af7b06", "sha256": "8be560453761d5761eb6b55a5533632967e6bd0a39bf0fc7f363edbf9b142e1e" }, "downloads": -1, "filename": "mplppt-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "17ad1c262d9fb395b08ca49999af7b06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25921, "upload_time": "2019-07-12T18:16:32", "url": "https://files.pythonhosted.org/packages/6b/0e/636d46d4e99be7f00c9a1266353589ad79a96d68a2d64bcd9dcab9bae9c2/mplppt-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f23f8ad9f38885d004a4565fe6fcf2d", "sha256": "895404a4de41a6e9aa7d46ce72672ef01a0e8fe2f7c0120b642a7d2be93b621e" }, "downloads": -1, "filename": "mplppt-0.0.0.tar.gz", "has_sig": false, "md5_digest": "9f23f8ad9f38885d004a4565fe6fcf2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17926, "upload_time": "2019-07-12T18:16:34", "url": "https://files.pythonhosted.org/packages/84/98/f1da00d22a37adf04b1a08ea90f8245393f5041b8b27f0c62950b7b9cc22/mplppt-0.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c742384c9218962c15732acccc0fd784", "sha256": "d58b2d919c5f0d64e6199d923f9747c53e1a147b0f77698b56ea98cfb474d957" }, "downloads": -1, "filename": "mplppt-0.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "c742384c9218962c15732acccc0fd784", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 25917, "upload_time": "2019-07-12T18:17:23", "url": "https://files.pythonhosted.org/packages/f4/a0/c39aa10f8453eadc174c0e3c05819810a9059a9f03ecb98644fa10a7ff8b/mplppt-0.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "17ad1c262d9fb395b08ca49999af7b06", "sha256": "8be560453761d5761eb6b55a5533632967e6bd0a39bf0fc7f363edbf9b142e1e" }, "downloads": -1, "filename": "mplppt-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "17ad1c262d9fb395b08ca49999af7b06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25921, "upload_time": "2019-07-12T18:16:32", "url": "https://files.pythonhosted.org/packages/6b/0e/636d46d4e99be7f00c9a1266353589ad79a96d68a2d64bcd9dcab9bae9c2/mplppt-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f23f8ad9f38885d004a4565fe6fcf2d", "sha256": "895404a4de41a6e9aa7d46ce72672ef01a0e8fe2f7c0120b642a7d2be93b621e" }, "downloads": -1, "filename": "mplppt-0.0.0.tar.gz", "has_sig": false, "md5_digest": "9f23f8ad9f38885d004a4565fe6fcf2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17926, "upload_time": "2019-07-12T18:16:34", "url": "https://files.pythonhosted.org/packages/84/98/f1da00d22a37adf04b1a08ea90f8245393f5041b8b27f0c62950b7b9cc22/mplppt-0.0.0.tar.gz" } ] }