{ "info": { "author": "Nico Schl\u00f6mer", "author_email": "nico.schloemer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering" ], "description": "

\n \"cplot\"\n

Plot complex-valued functions with style.

\n

\n\n[![CircleCI](https://img.shields.io/circleci/project/github/nschloe/cplot/master.svg?style=flat-square)](https://circleci.com/gh/nschloe/cplot/tree/master)\n[![codecov](https://img.shields.io/codecov/c/github/nschloe/cplot.svg?style=flat-square)](https://codecov.io/gh/nschloe/cplot)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/ambv/black)\n[![PyPi Version](https://img.shields.io/pypi/v/cplot.svg?style=flat-square)](https://pypi.python.org/pypi/cplot)\n[![GitHub stars](https://img.shields.io/github/stars/nschloe/cplot.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/cplot)\n\ncplot helps plotting complex-valued functions in a visually appealing manner. The\ngeneral idea is to map the absolute value to lightness and the complex argument (the\n\"angle\") to the chroma of the representing color. This follows the [domain\ncoloring](https://en.wikipedia.org/wiki/Domain_coloring) approach, also described by\n[John D. Cook](https://www.johndcook.com/blog/2017/11/09/visualizing-complex-functions/)\nand Elias Wegert in the book [Visual Complex\nFunctions](https://www.springer.com/gp/book/9783034801799) (with some tweaks).\n\nInstall with\n```\npip3 install cplot --user\n```\nand use as\n```python\nimport cplot\nimport numpy\n\ncplot.show(numpy.tan, -5, +5, -5, +5, 100, 100)\n\ncplot.save_fig(\"out.png\", numpy.tan, -5, +5, -5, +5, 100, 100)\ncplot.save_img(\"out.png\", numpy.tan, -5, +5, -5, +5, 100, 100)\n\n# There is a tripcolor function as well for triangulated 2D domains\n# cplot.tripcolor(triang, z)\n\n# The function get_srgb1 returns the SRGB1 triple for every complex input value.\n# (Accepts arrays, too.)\nz = 2 + 5j\nval = cplot.get_srgb1(z)\n```\nAll functions have the optional arguments (with their default values)\n```python\nalpha=1 # >= 0\ncolorspace=\"cam16\" # \"cielab\", \"hsl\"\n```\n\n* `alpha` can be used to adjust the use of colors. A value less than 1 adds more color\n which can help isolating the roots and poles (which are still black and white,\n respectively). `alpha=0` ignores the magnitude of `f(z)` completely.\n\n* `colorspace` can be set to `hsl` to get the common fully saturated, vibrant\n colors. This is usually a bad idea since it creates artifacts which are not related\n with the underlying data. From [Wikipedia](https://en.wikipedia.org/wiki/Domain_coloring):\n\n > Since the HSL color space is not perceptually uniform, one can see streaks of\n > perceived brightness at yellow, cyan, and magenta (even though their absolute values\n > are the same as red, green, and blue) and a halo around L = 1 / 2 . Use of the Lab\n > color space corrects this, making the images more accurate, but also makes them more\n > drab/pastel.\n\n Default is [`\"cam16\"`](http://onlinelibrary.wiley.com/doi/10.1002/col.22131/abstract);\n very similar is `\"cielab\"` (not shown here).\n\nConsider the test function `(z ** 2 - 1) * (z - 2 - 1j) ** 2 / (z ** 2 + 2 + 2j)`:\n\n| `alpha = 1` | `alpha = 0.5` | `alpha = 0.0` |\n| :----------: | :---------: | :--------: |\n| | | |\n| | | |\n\nThe representation is chosen such that\n\n * values around **0** are **black**,\n * values around **infinity** are **white**,\n * values around **+1** are **green**,\n * values around **-1** are [**deep purple**](https://youtu.be/zUwEIt9ez7M),\n * values around **+i** are **blue**,\n * values around **-i** are **orange**.\n\n(Compare to the z1 reference plot below.)\n\nWith this, it is easy to see where a function has very small and very large values, and\nthe multiplicty of zeros and poles is instantly identified by counting the color wheel\npasses around a black or white point.\n\n#### Gallery\n\nAll plots are created with default settings.\n\n |\n |\n\n:-------------------:|:------------------:|:----------:|\n`z**1` | `z**2` | `z**3` |\n\n |\n |\n |\n:-------------------:|:------------------:|:----------:|\n`1/z` | `z / abs(z)` | `(z+1) / (z-1)` |\n\n |\n |\n\n:-------------------:|:------------------:|:-------------------------:|\n`numpy.sqrt` | `x**(1/3)` | `x**(1/4)` |\n\n |\n\n\n:-------------------:|:------------------:|:-------------------------:|\n`numpy.log` | `numpy.exp` | `exp(1/x)` |\n\n |\n |\n\n:-------------------:|:------------------:|:-------------------------:|\n`numpy.sin` | `numpy.cos` | `numpy.tan` |\n\n |\n |\n\n:-------------------:|:------------------:|:-------------------------:|\n`numpy.sinh` | `numpy.cosh` | `numpy.tanh` |\n\n |\n |\n\n:-------------------:|:------------------:|:-------------------------:|\n`numpy.arcsin` | `numpy.arccos` | `numpy.arctan` |\n\n |\n |\n\n:-------------------:|:------------------:|:-------------------------:|\n`scipy.special.gamma` | `scipy.special.digamma` | `mpmath.zeta` |\n\n\n### Testing\n\nTo run the cplot unit tests, check out this repository and type\n```\npytest\n```\n\n### License\n\ncplot is published under the [MIT license](https://en.wikipedia.org/wiki/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": "https://github.com/nschloe/cplot", "keywords": "", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "cplot", "package_url": "https://pypi.org/project/cplot/", "platform": "any", "project_url": "https://pypi.org/project/cplot/", "project_urls": { "Homepage": "https://github.com/nschloe/cplot" }, "release_url": "https://pypi.org/project/cplot/0.2.0/", "requires_dist": [ "colorio", "matplotlib", "numpy" ], "requires_python": ">=3", "summary": "Plotting tools for complex-valued functions", "version": "0.2.0" }, "last_serial": 5522969, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6b293ce7b5c9e03cdbbebedc443a3c71", "sha256": "e5f9e5a360a3ce71967053223473d388ebcc78358befdf3f695727c302000359" }, "downloads": -1, "filename": "cplot-0.0.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "6b293ce7b5c9e03cdbbebedc443a3c71", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6249, "upload_time": "2018-01-29T20:31:56", "url": "https://files.pythonhosted.org/packages/ab/d9/c6ae0ee263dbcba6ca446acc9e637c19792685363b38264af298c5ba9998/cplot-0.0.1-py2.py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0d17c676cfa5057b4bab2298434de8ef", "sha256": "99db3c7305b2e48a0c32f80b1f5f6e1ff28c0ffaff473f437bbeb9a87514b41c" }, "downloads": -1, "filename": "cplot-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d17c676cfa5057b4bab2298434de8ef", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4737, "upload_time": "2018-09-18T11:19:44", "url": "https://files.pythonhosted.org/packages/05/cc/0b41f5e196d093c1f9ef5f1117d98a8e0106138223a1014043d97a6c0880/cplot-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71bc72fc09302243a442d11d03a9cfe9", "sha256": "39af93bef4bc2d216572c75e8195fdf15f09120ffb5aa9ec5bda8a5c82b62d60" }, "downloads": -1, "filename": "cplot-0.0.2.tar.gz", "has_sig": false, "md5_digest": "71bc72fc09302243a442d11d03a9cfe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4608, "upload_time": "2018-09-18T11:19:45", "url": "https://files.pythonhosted.org/packages/81/75/4b0b284fca568d8cc831b1618d4d2670ebfe80027078642a658604979416/cplot-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "ff728dc1b6506e51a05a0a1bca82b9ac", "sha256": "be210912d63400233578bf1c3570eded5de9de6c17cbc9c91ea2b4f56c3de3db" }, "downloads": -1, "filename": "cplot-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ff728dc1b6506e51a05a0a1bca82b9ac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6324, "upload_time": "2018-09-19T19:25:24", "url": "https://files.pythonhosted.org/packages/ae/5d/7057559749b9403bf11f8f308cd1944b0d51218e25e884c64a48bc534167/cplot-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f8074000105367bac08948a07f59738", "sha256": "f4c2cde517e99b17d0561c4f3336525badc660519d08c31c84282a4546ae2a0f" }, "downloads": -1, "filename": "cplot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8f8074000105367bac08948a07f59738", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6295, "upload_time": "2018-09-19T19:25:25", "url": "https://files.pythonhosted.org/packages/3e/5a/e1ebea1332fbd993d3120455ef48c62a6c3209ad19ebb8e02a1b356822cd/cplot-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "dc3321026221e2463afa05887a86f2e6", "sha256": "a38be555db0ee492b0b619f9fdca7db4143861e08e68a10ec8a711d9bc8d5620" }, "downloads": -1, "filename": "cplot-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dc3321026221e2463afa05887a86f2e6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6268, "upload_time": "2018-09-22T18:59:44", "url": "https://files.pythonhosted.org/packages/40/45/e681f34582952a1b8233046685b6fc0ea0fd0bd1cbb8b37a62f8339c454e/cplot-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ec763c85845cd9ea3d66ae1b2ed0639", "sha256": "af964b25d52a152184aefcffd6de5b8aa545dc85907c68e4f827141d9397f8d2" }, "downloads": -1, "filename": "cplot-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9ec763c85845cd9ea3d66ae1b2ed0639", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6351, "upload_time": "2018-09-22T18:59:45", "url": "https://files.pythonhosted.org/packages/0d/cb/0435d40c5bb3f16299ecf57327bbfc9ee17f99611356367b4f15b41815ef/cplot-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "87ddc22e7de9c0ebf96f26908ad5f369", "sha256": "b0177aa183c671af33c473b2931ded1cdeea17578c4953304b60ec654e10274b" }, "downloads": -1, "filename": "cplot-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "87ddc22e7de9c0ebf96f26908ad5f369", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8914, "upload_time": "2019-07-12T12:27:18", "url": "https://files.pythonhosted.org/packages/24/52/d33f838c92816ff55f8168a4a807c86c52c4fb5d7e202b3374e10a63b105/cplot-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b2e4fdca6f4a2c1d284bb6a843f1ba8", "sha256": "8aee2c45b9b9d0e72304d0859bd0097d43768e345c8bb41cf7048889e04d0198" }, "downloads": -1, "filename": "cplot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6b2e4fdca6f4a2c1d284bb6a843f1ba8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9698, "upload_time": "2019-07-12T12:27:20", "url": "https://files.pythonhosted.org/packages/7d/4b/ea68e1a4f2dd3b867067f7b3fdb4bdbf971f04daec065ce7569b9eb08165/cplot-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87ddc22e7de9c0ebf96f26908ad5f369", "sha256": "b0177aa183c671af33c473b2931ded1cdeea17578c4953304b60ec654e10274b" }, "downloads": -1, "filename": "cplot-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "87ddc22e7de9c0ebf96f26908ad5f369", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8914, "upload_time": "2019-07-12T12:27:18", "url": "https://files.pythonhosted.org/packages/24/52/d33f838c92816ff55f8168a4a807c86c52c4fb5d7e202b3374e10a63b105/cplot-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b2e4fdca6f4a2c1d284bb6a843f1ba8", "sha256": "8aee2c45b9b9d0e72304d0859bd0097d43768e345c8bb41cf7048889e04d0198" }, "downloads": -1, "filename": "cplot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6b2e4fdca6f4a2c1d284bb6a843f1ba8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9698, "upload_time": "2019-07-12T12:27:20", "url": "https://files.pythonhosted.org/packages/7d/4b/ea68e1a4f2dd3b867067f7b3fdb4bdbf971f04daec065ce7569b9eb08165/cplot-0.2.0.tar.gz" } ] }