ternary-diagram


Nameternary-diagram JSON
Version 3.1.0 PyPI version JSON
download
home_page
SummaryThis package makes it easier for you to draw beautiful ternary diagram without pymatgen.
upload_time2023-09-16 12:18:14
maintaineryu9824
docs_urlNone
authoryu9824
requires_python
licenseMIT
keywords ternarydiagram phasediagram chemistry
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Ternary Diagram

[![python_badge](https://img.shields.io/pypi/pyversions/ternary-diagram)](https://pypi.org/project/ternary-diagram/)
[![license_badge](https://img.shields.io/pypi/l/ternary-diagram)](https://pypi.org/project/ternary-diagram/)
[![PyPI version](https://badge.fury.io/py/ternary-diagram.svg)](https://pypi.org/project/ternary-diagram/)
[![Downloads](https://static.pepy.tech/badge/ternary-diagram)](https://pepy.tech/project/ternary-diagram)

[![Test on each version](https://github.com/yu9824/ternary_diagram/actions/workflows/pytest-on-each-version.yaml/badge.svg)](https://github.com/yu9824/ternary_diagram/actions/workflows/pytest-on-each-version.yaml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![conda_badge](https://anaconda.org/conda-forge/ternary-diagram/badges/version.svg)](https://anaconda.org/conda-forge/ternary-diagram/)
[![arch_badge](https://anaconda.org/conda-forge/ternary-diagram/badges/platforms.svg)](https://anaconda.org/conda-forge/ternary-diagram)

This package makes it easier for you to draw beautiful ternary diagram **without** [pymatgen](https://pymatgen.org).

Meaningly, only need `numpy` and `matplotlib`.

## What you will be able to do with this package

- Create beautiful contour maps easily
- Creating a scatter plot
- Draw tie lines
- Automatically format chemical composition using subscripts
- Most of the matplotlib options are available

![/example/contour/example_contour.png](https://github.com/yu9824/ternary_diagram/blob/main/example/contour/example_contour.png?raw=true "example")

## How to install

### PyPI

```bash
pip install ternary-diagram
```

PyPI project is [here](https://pypi.org/project/ternary-diagram/).

### Anaconda

```bash
conda install -c conda-forge ternary-diagram
```

Anaconda (conda-forge) package site is [here](https://anaconda.org/conda-forge/ternary-diagram).

## Usage

See [Examples](#examples) and the [documentation](https://yu9824.github.io/ternary_diagram/).

### Examples

An easy example is here.

```python
import matplotlib.pyplot as plt
from ternary_diagram import TernaryDiagram

# You can set `ax` to select which axes to draw. If not, the current axes will be used.
td = TernaryDiagram(["Li2O", "La2O3", "TiO2"])

# scatter
td.scatter(vector=[[1, 1, 1], [1, 2, 3]], z=[0, 1])
# You can set some options in `plt.scatter` like `marker`, `c` etc.
td.scatter(vector=[[2, 1, 3], [3, 2, 1]], marker="s", c="#022c5e", s=30)

# line plot
# You can set some options in `plt.plot` like `lw`, `c`, and so on.
td.plot([[1, 1, 1], [1, 2, 3]], color="black")

# save figure
td.fig.savefig("figure.png", dpi=144)

```

![/example/example_on_readme/figure.png](https://github.com/yu9824/ternary_diagram/blob/main/example/example_on_readme/figure.png?raw=true)

It can be written like this.
```python
# The background color is sometimes transparent in jupyter notebooks, so set facecolor 'white'.
fig, ax = plt.subplots(facecolor="w")

# You can set `ax` to select which axes to draw. If not, the current axes will be used.
td = TernaryDiagram(["Li2O", "La2O3", "TiO2"], ax=ax)

# scatter
td.scatter(vector=[[1, 1, 1], [1, 2, 3]], z=[0, 1])
# You can set some options in `plt.scatter` like `marker`, `c` etc.
td.scatter(vector=[[2, 1, 3], [3, 2, 1]], marker="s", c="#022c5e", s=30)

# line plot
# You can set some options in `plt.plot` like `lw`, `c`, and so on.
td.plot([[1, 1, 1], [1, 2, 3]], color="black")

# save figure
fig.savefig("figure.png", dpi=144)

```

It means that you can draw multiple figures in one figure object.

See also the [example](https://github.com/yu9824/ternary_diagram/tree/main/example) folder.

## Histories

### v3.1.0

- Delete `.utils._BasePlotter.get_x_y` (we should access directly).



## LICENSE

See [LICENSE](https://github.com/yu9824/ternary_diagram/tree/main/LICENSE).

MIT Licence

Copyright (c) 2021 yu9824

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ternary-diagram",
    "maintainer": "yu9824",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "yu.9824.job@gmail.com",
    "keywords": "ternarydiagram phasediagram chemistry",
    "author": "yu9824",
    "author_email": "yu.9824.job@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0a/b1/bb80901045075322e370b3633832d9ecff25373890b3279338e526862e80/ternary_diagram-3.1.0.tar.gz",
    "platform": null,
    "description": "# Ternary Diagram\n\n[![python_badge](https://img.shields.io/pypi/pyversions/ternary-diagram)](https://pypi.org/project/ternary-diagram/)\n[![license_badge](https://img.shields.io/pypi/l/ternary-diagram)](https://pypi.org/project/ternary-diagram/)\n[![PyPI version](https://badge.fury.io/py/ternary-diagram.svg)](https://pypi.org/project/ternary-diagram/)\n[![Downloads](https://static.pepy.tech/badge/ternary-diagram)](https://pepy.tech/project/ternary-diagram)\n\n[![Test on each version](https://github.com/yu9824/ternary_diagram/actions/workflows/pytest-on-each-version.yaml/badge.svg)](https://github.com/yu9824/ternary_diagram/actions/workflows/pytest-on-each-version.yaml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![conda_badge](https://anaconda.org/conda-forge/ternary-diagram/badges/version.svg)](https://anaconda.org/conda-forge/ternary-diagram/)\n[![arch_badge](https://anaconda.org/conda-forge/ternary-diagram/badges/platforms.svg)](https://anaconda.org/conda-forge/ternary-diagram)\n\nThis package makes it easier for you to draw beautiful ternary diagram **without** [pymatgen](https://pymatgen.org).\n\nMeaningly, only need `numpy` and `matplotlib`.\n\n## What you will be able to do with this package\n\n- Create beautiful contour maps easily\n- Creating a scatter plot\n- Draw tie lines\n- Automatically format chemical composition using subscripts\n- Most of the matplotlib options are available\n\n![/example/contour/example_contour.png](https://github.com/yu9824/ternary_diagram/blob/main/example/contour/example_contour.png?raw=true \"example\")\n\n## How to install\n\n### PyPI\n\n```bash\npip install ternary-diagram\n```\n\nPyPI project is [here](https://pypi.org/project/ternary-diagram/).\n\n### Anaconda\n\n```bash\nconda install -c conda-forge ternary-diagram\n```\n\nAnaconda (conda-forge) package site is [here](https://anaconda.org/conda-forge/ternary-diagram).\n\n## Usage\n\nSee [Examples](#examples) and the [documentation](https://yu9824.github.io/ternary_diagram/).\n\n### Examples\n\nAn easy example is here.\n\n```python\nimport matplotlib.pyplot as plt\nfrom ternary_diagram import TernaryDiagram\n\n# You can set `ax` to select which axes to draw. If not, the current axes will be used.\ntd = TernaryDiagram([\"Li2O\", \"La2O3\", \"TiO2\"])\n\n# scatter\ntd.scatter(vector=[[1, 1, 1], [1, 2, 3]], z=[0, 1])\n# You can set some options in `plt.scatter` like `marker`, `c` etc.\ntd.scatter(vector=[[2, 1, 3], [3, 2, 1]], marker=\"s\", c=\"#022c5e\", s=30)\n\n# line plot\n# You can set some options in `plt.plot` like `lw`, `c`, and so on.\ntd.plot([[1, 1, 1], [1, 2, 3]], color=\"black\")\n\n# save figure\ntd.fig.savefig(\"figure.png\", dpi=144)\n\n```\n\n![/example/example_on_readme/figure.png](https://github.com/yu9824/ternary_diagram/blob/main/example/example_on_readme/figure.png?raw=true)\n\nIt can be written like this.\n```python\n# The background color is sometimes transparent in jupyter notebooks, so set facecolor 'white'.\nfig, ax = plt.subplots(facecolor=\"w\")\n\n# You can set `ax` to select which axes to draw. If not, the current axes will be used.\ntd = TernaryDiagram([\"Li2O\", \"La2O3\", \"TiO2\"], ax=ax)\n\n# scatter\ntd.scatter(vector=[[1, 1, 1], [1, 2, 3]], z=[0, 1])\n# You can set some options in `plt.scatter` like `marker`, `c` etc.\ntd.scatter(vector=[[2, 1, 3], [3, 2, 1]], marker=\"s\", c=\"#022c5e\", s=30)\n\n# line plot\n# You can set some options in `plt.plot` like `lw`, `c`, and so on.\ntd.plot([[1, 1, 1], [1, 2, 3]], color=\"black\")\n\n# save figure\nfig.savefig(\"figure.png\", dpi=144)\n\n```\n\nIt means that you can draw multiple figures in one figure object.\n\nSee also the [example](https://github.com/yu9824/ternary_diagram/tree/main/example) folder.\n\n## Histories\n\n### v3.1.0\n\n- Delete `.utils._BasePlotter.get_x_y` (we should access directly).\n\n\n\n## LICENSE\n\nSee [LICENSE](https://github.com/yu9824/ternary_diagram/tree/main/LICENSE).\n\nMIT Licence\n\nCopyright (c) 2021 yu9824\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This package makes it easier for you to draw beautiful ternary diagram without pymatgen.",
    "version": "3.1.0",
    "project_urls": {
        "Documentation": "https://yu9824.github.io/ternary_diagram/",
        "PyPI": "https://pypi.org/project/ternary-diagram/",
        "Source": "http://github.com/yu9824/ternary_diagram/",
        "Tracker": "http://github.com/yu9824/ternary_diagram//issues"
    },
    "split_keywords": [
        "ternarydiagram",
        "phasediagram",
        "chemistry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78551b97ef34496d867b39a44b5b63f1615aafa068959fc5393ae8a2b8d9cba6",
                "md5": "6b01137d2225903ce5eb74ae87d7f802",
                "sha256": "43ac27e43d281a5a5d642585761c38f799858c505da16e120b8dea183b36de33"
            },
            "downloads": -1,
            "filename": "ternary_diagram-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b01137d2225903ce5eb74ae87d7f802",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 11540,
            "upload_time": "2023-09-16T12:18:13",
            "upload_time_iso_8601": "2023-09-16T12:18:13.193008Z",
            "url": "https://files.pythonhosted.org/packages/78/55/1b97ef34496d867b39a44b5b63f1615aafa068959fc5393ae8a2b8d9cba6/ternary_diagram-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ab1bb80901045075322e370b3633832d9ecff25373890b3279338e526862e80",
                "md5": "076fe65950fa4c3725f0a5a7d2957d8c",
                "sha256": "53000a1a67fc4b61bd92f87066294235eae7d6273665c191d43c17bc802ddce2"
            },
            "downloads": -1,
            "filename": "ternary_diagram-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "076fe65950fa4c3725f0a5a7d2957d8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13829,
            "upload_time": "2023-09-16T12:18:14",
            "upload_time_iso_8601": "2023-09-16T12:18:14.696057Z",
            "url": "https://files.pythonhosted.org/packages/0a/b1/bb80901045075322e370b3633832d9ecff25373890b3279338e526862e80/ternary_diagram-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-16 12:18:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yu9824",
    "github_project": "ternary_diagram",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "ternary-diagram"
}
        
Elapsed time: 0.11173s