{ "info": { "author": "Alessandro Molina", "author_email": "amol@turbogears.org", "bugtrack_url": null, "classifiers": [ "Framework :: TurboGears" ], "description": "About tgext.matplotrender\r\n-------------------------\r\n\r\n.. image:: https://travis-ci.org/amol-/tgext.matplotrender.png\r\n :target: https://travis-ci.org/amol-/tgext.matplotrender\r\n\r\n.. image:: https://coveralls.io/repos/amol-/tgext.matplotrender/badge.png\r\n :target: https://coveralls.io/r/amol-/tgext.matplotrender\r\n\r\n.. image:: https://img.shields.io/:license-mit-blue.svg?style=flat-square\r\n :target: https://pypi.python.org/pypi/tgext.matplotrender\r\n\r\ntgext.matplotrender is a TurboGears2 extension that provides a Rendering Engine\r\nfor MatplotLib Figures.\r\n\r\nInstalling\r\n----------\r\n\r\ntgext.matplotrender can be installed from pypi::\r\n\r\n pip install tgext.matplotrender\r\n\r\nshould just work for most of the users.\r\n\r\nEnabling\r\n--------\r\n\r\nTo enable tgext.matplotrender add the ``matplotfig`` renderer to your\r\nconfiguration:\r\n\r\n.. code-block:: python\r\n\r\n base_config.renderers.append('matplotfig')\r\n\r\nand plug the rendering engine inside your ``config/app_cfg.py``:\r\n\r\n.. code-block:: python\r\n\r\n import tgext.matplotrender\r\n tgext.matplotrender.plugme(base_config)\r\n\r\nUsage\r\n-----\r\n\r\nUsing tgext.matplotrender is as simple as exposing an action with\r\nthe ``matplotfig`` template and returning the figure itself inside\r\nthe ``fig`` key of action returned dictionary.\r\n\r\nGiven the following figure:\r\n\r\n.. code-block:: python\r\n\r\n def _make_fig():\r\n fig = matplotlib.figure.Figure(figsize=(9, 6))\r\n fig.Name = \"Sinewave\"\r\n ax = fig.add_subplot(111)\r\n ax.set_xlabel(\"angle\")\r\n ax.set_ylabel(\"amplitude\")\r\n t = numpy.arange(0.0, 2.0, 0.01)\r\n s1 = numpy.sin(2 * numpy.pi * t)\r\n ax.plot(t, s1, color=\"k\")\r\n return fig\r\n\r\nIt can be exposed through TurboGears actions as:\r\n\r\n.. code-block:: python\r\n\r\n class RootController(TGController):\r\n @expose('matplotfig')\r\n def figure(self, *args, **kwargs):\r\n return dict(fig=_make_fig())\r\n\r\n @expose('matplotfig', render_params=dict(dpi=36))\r\n def lowres(self, *args, **kwargs):\r\n return dict(fig=_make_fig())\r\n\r\n @expose('matplotfig')\r\n def customres(self, *args, **kwargs):\r\n options = {}\r\n try:\r\n options['dpi'] = int(kwargs['dpi'])\r\n except:\r\n pass\r\n return dict(fig=_make_fig(), **options)\r\n\r\nAny other value provided in the dictionary will be used as\r\na ``print_figure`` argument in ``matplotlib``", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amol-/tgext.matplotrender", "keywords": "turbogears2.extension", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tgext.matplotrender", "package_url": "https://pypi.org/project/tgext.matplotrender/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tgext.matplotrender/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/amol-/tgext.matplotrender" }, "release_url": "https://pypi.org/project/tgext.matplotrender/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Renderer to expose matplotlib figures", "version": "0.0.1" }, "last_serial": 2243195, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ab21cade25152d7c7c53cd32846959dd", "sha256": "6defa801397021524e25f9b59ed028b61e051f238a8dd5d343569254a97ec67f" }, "downloads": -1, "filename": "tgext.matplotrender-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ab21cade25152d7c7c53cd32846959dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3345, "upload_time": "2016-06-06T20:52:28", "url": "https://files.pythonhosted.org/packages/a2/59/83b6a484ee7fa8e75a1213184e8d44b1892813e6ef27643736ececf7e737/tgext.matplotrender-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab21cade25152d7c7c53cd32846959dd", "sha256": "6defa801397021524e25f9b59ed028b61e051f238a8dd5d343569254a97ec67f" }, "downloads": -1, "filename": "tgext.matplotrender-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ab21cade25152d7c7c53cd32846959dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3345, "upload_time": "2016-06-06T20:52:28", "url": "https://files.pythonhosted.org/packages/a2/59/83b6a484ee7fa8e75a1213184e8d44b1892813e6ef27643736ececf7e737/tgext.matplotrender-0.0.1.tar.gz" } ] }