{ "info": { "author": "Alex Hagen", "author_email": "alexhagen6@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# pyg - A graphics class\n\nBy Alex Hagen\n\n``pyg`` started as a simple wrapper around ``matplotlib`` to help me keep my style the same in plotting, but now it's expanded to a full graphics suite. If you get bored reading through the first two examples, skip to the bottom. Those examples are a bit cooler.\n\n## Installation\n\nFor ``pyg``, we need quite a few requirements. Installation right now is pretty manual, but this should do the trick on unix systems:\n\n```bash\npip install numpy scipy matplotlib colours\nmkdir ~/util\ncd ~/util\ngit clone https://github.com/alexhagen/pyg -b master pyg\nsudo echo \"export PYTHONPATH=${PYTHONPATH}:~/util\" >> ~/.bashrc\nsource ~/.bashrc\n```\n\nand then we can just import pyg whenever with\n\n\n```python\nfrom pyg import twod as pyg2d\n```\n\n## Usage\n\n``pyg`` has one main class, a ``twod`` plot type, and it has several other classes. The ``table`` module has some table printing help for Jupyter notebooks and some LaTeX publication helper functions. The ``threed`` module has some ``matplotlib`` three dimensional plotting (this is good for surface plotting, if you're doing geometric visualization, use my [``pyb``](github.com/alexhagen/pyb) class, which I'll include into ``pyg`` soon), ``three2twod`` is a class for annotating three dimensional plotting (if you have the transformation matrix from 3-d to 2-d). I've created some informative examples of these below. I've put interesting examples first, but they're a little complex. If you want to get started, skip to the \"[Boring Examples](#Boring-Examples)\" section.\n\n### Interesting Examples\n\n#### Three Dimensional Plotting\n\nThe following shows an example for 3d plotting using ``pyg``, which is generally simple except for the conversion from matrix data into a form that can be plotted. Below shows a simple example for a power fit, but an API is soon coming for converting data into the right formats.\n\n\n```python\nfrom pyg import threed as pyg3d\nimport numpy as np\n\nplot = pyg3d.pyg3d()\nx = np.linspace(0.0, 5.0)\ny = np.linspace(0.0, 5.0)\nX, Y = np.meshgrid(x, y)\nz = np.power(X, 2.0) - np.power(Y, 3.0)\nplot.surf(x, y, z)\nplot.export('_static/threed_surf')\nplot.show(caption='An arbitrary three dimensional surface')\n```\n\n\n\n\t\t\t\t