pymatviz


Namepymatviz JSON
Version 0.15.1 PyPI version JSON
download
home_pageNone
SummaryA toolkit for visualizations in materials informatics
upload_time2025-01-28 18:42:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2021 Janosh Riebesell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
keywords chemistry data visualization materials discovery materials informatics matplotlib plotly science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
<img src="https://github.com/janosh/pymatviz/raw/main/site/static/favicon.svg" alt="Logo" height="60px">
<br class="hide-in-docs">
pymatviz
</h1>

<h4 align="center" class="toc-exclude">

A toolkit for visualizations in materials informatics.

[![Tests](https://github.com/janosh/pymatviz/actions/workflows/test.yml/badge.svg)](https://github.com/janosh/pymatviz/actions/workflows/test.yml)
[![This project supports Python 3.10+](https://img.shields.io/badge/Python-3.10+-blue.svg?logo=python&logoColor=white)](https://python.org/downloads)
[![PyPI](https://img.shields.io/pypi/v/pymatviz?logo=pypi&logoColor=white)](https://pypi.org/project/pymatviz)
[![PyPI Downloads](https://img.shields.io/pypi/dm/pymatviz?logo=icloud&logoColor=white)](https://pypistats.org/packages/pymatviz)
[![Zenodo](https://img.shields.io/badge/DOI-10.5281/zenodo.10456384-blue?logo=Zenodo&logoColor=white)](https://zenodo.org/records/10456384)

</h4>

<slot name="how-to-cite">

> If you use `pymatviz` in your research, [see how to cite](#how-to-cite-pymatviz).

</slot>

## Installation

```sh
pip install pymatviz
```

## API Docs

See the [/api][/api] page.

[/api]: https://janosh.github.io/pymatviz/api

## Usage

See the Jupyter notebooks under [`examples/`](examples) for how to use `pymatviz`. PRs with additional examples are welcome! 🙏

|                                                                                                                        |                                                                                                                                                             |                                   |
| ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| [mlff_phonons.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb)                         | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb)             | [Launch Codespace][codespace url] |
| [matbench_dielectric_eda.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/matbench_dielectric_eda.ipynb)   | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/matbench_dielectric_eda.ipynb)  | [Launch Codespace][codespace url] |
| [mp_bimodal_e_form.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mp_bimodal_e_form.ipynb)               | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mp_bimodal_e_form.ipynb)        | [Launch Codespace][codespace url] |
| [matbench_perovskites_eda.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/matbench_perovskites_eda.ipynb) | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/matbench_perovskites_eda.ipynb) | [Launch Codespace][codespace url] |
| [mprester_ptable.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb)                   | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb)          | [Launch Codespace][codespace url] |

[Open in Google Colab]: https://colab.research.google.com/assets/colab-badge.svg
[codespace url]: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=340898532

## Periodic Table

See [`pymatviz/ptable/ptable_matplotlib.py`](pymatviz/ptable/ptable_matplotlib.py) and [`pymatviz/ptable/ptable_plotly.py`](pymatviz/ptable/ptable_plotly.py). `matplotlib` supports heatmaps, heatmap ratios, heatmap splits (multiple values per element), histograms, scatter plots and line plots. `plotly` currently only supports heatmaps (PRs to port over other `matplotlib` `ptable` variants to `plotly` are very welcome!). The `plotly` heatmap supports displaying additional data on hover or full interactivity through [Dash](https://plotly.com/dash).

|                       [`ptable_heatmap(compositions, log=True)`](assets/scripts/ptable_matplotlib/ptable_heatmap.py)                        |                    [`ptable_heatmap_ratio(comps_a, comps_b)`](assets/scripts/ptable_matplotlib/ptable_heatmap_ratio.py)                    |
| :-----------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: |
|                                                              ![ptable-heatmap]                                                              |                                                          ![ptable-heatmap-ratio]                                                           |
|                       [`ptable_heatmap_plotly(atomic_masses)`](assets/scripts/ptable_plotly/ptable_heatmap_plotly.py)                       |                  [`ptable_heatmap_plotly(compositions, log=True)`](assets/scripts/ptable_plotly/ptable_heatmap_plotly.py)                  |
|                                                  ![ptable-heatmap-plotly-more-hover-data]                                                   |                                                        ![ptable-heatmap-plotly-log]                                                        |
|                        [`ptable_hists(data, colormap="coolwarm")`](assets/scripts/ptable_matplotlib/ptable_hists.py)                        |                             [`ptable_hists_plotly(data)`](assets/scripts/ptable_plotly/ptable_hists_plotly.py)                             |
|                                                               ![ptable-hists]                                                               |                                                           ![ptable-hists-plotly]                                                           |
|                   [`ptable_scatters_plotly(data, mode="markers")`](assets/scripts/ptable_plotly/ptable_scatter_plotly.py)                   |                    [`ptable_scatter_plotly(data, mode="lines")`](assets/scripts/ptable_plotly/ptable_scatter_plotly.py)                    |
|                                                      ![ptable-scatter-plotly-markers]                                                       |                                                       ![ptable-lines-mace-diatomic]                                                        |
| [`ptable_heatmap_splits(2_vals_per_elem, colormap="coolwarm", start_angle=135)`](assets/scripts/ptable_matplotlib/ptable_heatmap_splits.py) | [`ptable_heatmap_splits(3_vals_per_elem, colormap="coolwarm", start_angle=90)`](assets/scripts/ptable_matplotlib/ptable_heatmap_splits.py) |
|                                                         ![ptable-heatmap-splits-2]                                                          |                                                         ![ptable-heatmap-splits-3]                                                         |
|               [`ptable_heatmap_splits_plotly(2_vals_per_elem)`](assets/scripts/ptable_plotly/ptable_heatmap_splits_plotly.py)               |              [`ptable_heatmap_splits_plotly(3_vals_per_elem)`](assets/scripts/ptable_plotly/ptable_heatmap_splits_plotly.py)               |
|                                                      ![ptable-heatmap-splits-plotly-2]                                                      |                                                     ![ptable-heatmap-splits-plotly-3]                                                      |

[ptable-hists]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-hists.svg
[ptable-lines-mace-diatomic]: https://github.com/janosh/pymatviz/raw/main/assets/svg/homo-nuclear-mace-medium.svg
[ptable-scatters-parity]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatters-parity.svg
[ptable-scatters-parabola]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatters-parabola.svg
[ptable-heatmap-splits-2]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-2.svg
[ptable-heatmap-splits-3]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-3.svg
[ptable-heatmap-splits-plotly-2]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-plotly-2.svg
[ptable-heatmap-splits-plotly-3]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-plotly-3.svg
[ptable-hists-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-hists-plotly.svg
[ptable-scatter-plotly-lines]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatter-plotly-lines.svg
[ptable-scatter-plotly-markers]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatter-plotly-markers.svg

### Dash app using `ptable_heatmap_plotly()`

See [`examples/mprester_ptable.ipynb`](https://github.com/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb).

[https://user-images.githubusercontent.com/30958850/181644052-b330f0a2-70fc-451c-8230-20d45d3af72f.mp4](https://user-images.githubusercontent.com/30958850/181644052-b330f0a2-70fc-451c-8230-20d45d3af72f.mp4)

## Phonons

See [`examples/mlff_phonons.ipynb`](https://github.com/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb) for usage example.

|               [`phonon_bands(bands_dict)`](assets/scripts/phonons/phonon_bands.py)               |                  [`phonon_dos(doses_dict)`](assets/scripts/phonons/phonon_dos.py)                  |
| :----------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: |
|                                         ![phonon-bands]                                          |                                           ![phonon-dos]                                            |
| [`phonon_bands_and_dos(bands_dict, doses_dict)`](assets/scripts/phonons/phonon_bands_and_dos.py) | [`phonon_bands_and_dos(single_bands, single_dos)`](assets/scripts/phonons/phonon_bands_and_dos.py) |
|                                 ![phonon-bands-and-dos-mp-2758]                                  |                                  ![phonon-bands-and-dos-mp-23907]                                  |

[phonon-bands]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-mp-2758.svg
[phonon-dos]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-dos-mp-2758.svg
[phonon-bands-and-dos-mp-2758]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-and-dos-mp-2758.svg
[phonon-bands-and-dos-mp-23907]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-and-dos-mp-23907.svg

## Structure

See [`pymatviz/structure_viz/plotly.py`](pymatviz/structure_viz/plotly.py). Currently structure plotting is only supported with `matplotlib` in 2d. 3d interactive plots (probably with `plotly`) are on the road map.

|                 [`structure_2d(mp_19017)`](pymatviz/structure_viz/mpl.py)                 |                 [`structure_2d(mp_12712)`](pymatviz/structure_viz/mpl.py)                 |
| :---------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |
|                  ![struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered]                  |                        ![struct-2d-mp-12712-Hf9Zr9Pd24-disordered]                        |
| [`structure_2d_plotly(six_structs)`](assets/scripts/structure_viz/structure_2d_plotly.py) | [`structure_3d_plotly(six_structs)`](assets/scripts/structure_viz/structure_3d_plotly.py) |
|                         ![matbench-phonons-structures-2d-plotly]                          |                         ![matbench-phonons-structures-3d-plotly]                          |

[matbench-phonons-structures-2d-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/matbench-phonons-structures-2d-plotly.svg
[matbench-phonons-structures-3d-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/matbench-phonons-structures-3d-plotly.svg

## Brillouin Zone

See [`pymatviz/brillouin.py`](pymatviz/brillouin.py).

|   [`brillouin_zone_3d(cubic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py)    |  [`brillouin_zone_3d(hexagonal_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py)   |
| :-------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |
|                               ![brillouin-cubic-mp-10018]                               |                             ![brillouin-hexagonal-mp-862690]                              |
| [`brillouin_zone_3d(monoclinic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py) | [`brillouin_zone_3d(orthorhombic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py) |
|                           ![brillouin-monoclinic-mp-1183089]                            |                           ![brillouin-orthorhombic-mp-1183085]                            |

[brillouin-cubic-mp-10018]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-cubic-mp-10018.svg
[brillouin-hexagonal-mp-862690]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-hexagonal-mp-862690.svg
[brillouin-monoclinic-mp-1183089]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-monoclinic-mp-1183089.svg
[brillouin-orthorhombic-mp-1183085]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-orthorhombic-mp-1183085.svg

## X-Ray Diffraction

See [`pymatviz/xrd.py`](pymatviz/xrd.py).

|             [`xrd_pattern(pattern)`](assets/scripts/xrd/xrd_pattern.py)             |  [`xrd_pattern({key1: patt1, key2: patt2})`](assets/scripts/xrd/xrd_pattern.py)   |
| :---------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------: |
|                                   ![xrd-pattern]                                    |                              ![xrd-pattern-multiple]                              |
| [`xrd_pattern(struct_dict, stack="horizontal")`](assets/scripts/xrd/xrd_pattern.py) | [`xrd_pattern(struct_dict, stack="vertical")`](assets/scripts/xrd/xrd_pattern.py) |
|                           ![xrd-pattern-horizontal-stack]                           |                           ![xrd-pattern-vertical-stack]                           |

[xrd-pattern]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern.svg
[xrd-pattern-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-multiple.svg
[xrd-pattern-horizontal-stack]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-horizontal-stack.svg
[xrd-pattern-vertical-stack]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-vertical-stack.svg

## Radial Distribution Functions

See [`pymatviz/rdf/plotly.py`](pymatviz/rdf/plotly.py).

| [`element_pair_rdfs(pmg_struct)`](assets/scripts/rdf/element_pair_rdfs.py) | [`element_pair_rdfs({"A": struct1, "B": struct2})`](assets/scripts/rdf/element_pair_rdfs.py) |
| :------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: |
|                       ![element-pair-rdfs-Na8Nb8O24]                       |                          ![element-pair-rdfs-crystal-vs-amorphous]                           |

[element-pair-rdfs-Na8Nb8O24]: https://github.com/janosh/pymatviz/raw/main/assets/svg/element-pair-rdfs-Na8Nb8O24.svg
[element-pair-rdfs-crystal-vs-amorphous]: https://github.com/janosh/pymatviz/raw/main/assets/svg/element-pair-rdfs-crystal-vs-amorphous.svg

## Coordination

See [`pymatviz/coordination/plotly.py`](pymatviz/coordination/plotly.py).

|                  [`coordination_hist(struct_dict)`](assets/scripts/coordination/coordination_hist.py)                   |          [`coordination_hist(struct_dict, by_element=True)`](assets/scripts/coordination/coordination_hist.py)          |
| :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: |
|                                               ![coordination-hist-single]                                               |                                      ![coordination-hist-by-structure-and-element]                                      |
| [`coordination_vs_cutoff_line(struct_dict, strategy=None)`](assets/scripts/coordination/coordination_vs_cutoff_line.py) | [`coordination_vs_cutoff_line(struct_dict, strategy=None)`](assets/scripts/coordination/coordination_vs_cutoff_line.py) |
|                                            ![coordination-vs-cutoff-single]                                             |                                           ![coordination-vs-cutoff-multiple]                                            |

[coordination-hist-single]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-hist-single.svg
[coordination-hist-by-structure-and-element]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-hist-by-structure-and-element.svg
[coordination-vs-cutoff-single]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-vs-cutoff-single.svg
[coordination-vs-cutoff-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-vs-cutoff-multiple.svg

## Sunburst

See [`pymatviz/sunburst.py`](pymatviz/sunburst.py).

| [`spacegroup_sunburst([65, 134, 225, ...])`](assets/scripts/symmetry/spacegroup_sunburst.py) | [`spacegroup_sunburst(["C2/m", "P-43m", "Fm-3m", ...])`](assets/scripts/symmetry/spacegroup_sunburst.py) |
| :------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |
|                                     ![spg-num-sunburst]                                      |                                          ![spg-symbol-sunburst]                                          |

## Rainclouds

See [`pymatviz/rainclouds.py`](pymatviz/rainclouds.py).

| [`rainclouds(two_key_dict)`](assets/scripts/rainclouds/rainclouds.py) | [`rainclouds(three_key_dict)`](assets/scripts/rainclouds/rainclouds.py) |
| :-------------------------------------------------------------------: | :---------------------------------------------------------------------: |
|                         ![rainclouds-bimodal]                         |                         ![rainclouds-trimodal]                          |

[rainclouds-bimodal]: https://github.com/janosh/pymatviz/raw/main/assets/svg/rainclouds-bimodal.svg
[rainclouds-trimodal]: https://github.com/janosh/pymatviz/raw/main/assets/svg/rainclouds-trimodal.svg

## Sankey

See [`pymatviz/sankey.py`](pymatviz/sankey.py).

| [`sankey_from_2_df_cols(df_perovskites)`](assets/scripts/sankey/sankey_from_2_df_cols.py) | [`sankey_from_2_df_cols(df_space_groups)`](assets/scripts/sankey/sankey_from_2_df_cols.py) |
| :---------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------: |
|                           ![sankey-spglib-vs-aflow-spacegroups]                           |                            ![sankey-crystal-sys-to-spg-symbol]                             |

[sankey-spglib-vs-aflow-spacegroups]: https://github.com/janosh/pymatviz/raw/main/assets/svg/sankey-spglib-vs-aflow-spacegroups.svg
[sankey-crystal-sys-to-spg-symbol]: https://github.com/janosh/pymatviz/raw/main/assets/svg/sankey-crystal-sys-to-spg-symbol.svg

## Bar Plots

See [`pymatviz/bar.py`](pymatviz/bar.py).

| [`spacegroup_bar([65, 134, 225, ...], backend="matplotlib")`](assets/scripts/bar/spacegroup_bar.py) | [`spacegroup_bar(["C2/m", "P-43m", "Fm-3m", ...], backend="matplotlib")`](assets/scripts/bar/spacegroup_bar.py) |
| :-------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: |
|                                     ![spg-num-hist-matplotlib]                                      |                                          ![spg-symbol-hist-matplotlib]                                          |
|   [`spacegroup_bar([65, 134, 225, ...], backend="plotly")`](assets/scripts/bar/spacegroup_bar.py)   |   [`spacegroup_bar(["C2/m", "P-43m", "Fm-3m", ...], backend="plotly")`](assets/scripts/bar/spacegroup_bar.py)   |
|                                       ![spg-num-hist-plotly]                                        |                                            ![spg-symbol-hist-plotly]                                            |

[spg-symbol-hist-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-hist-plotly.svg
[spg-num-hist-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-hist-plotly.svg
[spg-num-hist-matplotlib]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-hist-matplotlib.svg
[spg-symbol-hist-matplotlib]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-hist-matplotlib.svg

## Histograms

See [`pymatviz/histogram.py`](pymatviz/histogram.py).

| [`elements_hist(compositions, log=True, bar_values='count')`](assets/scripts/histogram/elements_hist.py) | [`histogram({'key1': values1, 'key2': values2})`](assets/scripts/histogram/histogram.py) |
| :------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: |
|                                             ![elements-hist]                                             |                                    ![histogram-ecdf]                                     |

[histogram-ecdf]: https://github.com/janosh/pymatviz/raw/main/assets/svg/histogram-ecdf.svg

## Scatter Plots

See [`pymatviz/scatter.py`](pymatviz/scatter.py).

| [`density_scatter_plotly(df, x=x_col, y=y_col, ...)`](assets/scripts/scatter/density_scatter_plotly.py) | [`density_scatter_plotly(df, x=x_col, y=y_col, ...)`](assets/scripts/scatter/density_scatter_plotly.py) |
| :-----------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: |
|                                        ![density-scatter-plotly]                                        |                                     ![density-scatter-plotly-blobs]                                     |
|               [`density_scatter(xs, ys, ...)`](assets/scripts/scatter/density_scatter.py)               |     [`density_scatter_with_hist(xs, ys, ...)`](assets/scripts/scatter/density_scatter_with_hist.py)     |
|                                           ![density-scatter]                                            |                                      ![density-scatter-with-hist]                                       |
|                [`density_hexbin(xs, ys, ...)`](assets/scripts/scatter/density_hexbin.py)                |      [`density_hexbin_with_hist(xs, ys, ...)`](assets/scripts/scatter/density_hexbin_with_hist.py)      |
|                                            ![density-hexbin]                                            |                                       ![density-hexbin-with-hist]                                       |

[density-scatter-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-plotly.svg
[density-scatter-plotly-blobs]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-plotly-blobs.svg
[density-hexbin-with-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-hexbin-with-hist.svg
[density-hexbin]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-hexbin.svg
[density-scatter-with-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-with-hist.svg
[density-scatter]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter.svg

## Uncertainty

See [`pymatviz/uncertainty.py`](pymatviz/uncertainty.py).

|             [`qq_gaussian(y_true, y_pred, y_std)`](assets/scripts/uncertainty/qq_gaussian.py)             |             [`qq_gaussian(y_true, y_pred, y_std: dict)`](assets/scripts/uncertainty/qq_gaussian.py)             |
| :-------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: |
|                                            ![normal-prob-plot]                                            |                                          ![normal-prob-plot-multiple]                                           |
| [`error_decay_with_uncert(y_true, y_pred, y_std)`](assets/scripts/uncertainty/error_decay_with_uncert.py) | [`error_decay_with_uncert(y_true, y_pred, y_std: dict)`](assets/scripts/uncertainty/error_decay_with_uncert.py) |
|                                        ![error-decay-with-uncert]                                         |                                       ![error-decay-with-uncert-multiple]                                       |

## Classification

See [`pymatviz/classify/confusion_matrix.py`](pymatviz/classify/confusion_matrix.py).

| [`confusion_matrix(conf_mat, ...)`](assets/scripts/classify/confusion_matrix.py) | [`confusion_matrix(y_true, y_pred, ...)`](assets/scripts/classify/confusion_matrix.py) |
| :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: |
|                          ![stability-confusion-matrix]                           |                           ![crystal-system-confusion-matrix]                           |

See [`pymatviz/classify/curves.py`](pymatviz/classify/curves.py).

| [`roc_curve_plotly(targets, probs_positive)`](assets/scripts/classify/roc_curve.py) | [`precision_recall_curve_plotly(targets, probs_positive)`](assets/scripts/classify/precision_recall_curve.py) |
| :---------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------: |
|                            ![roc-curve-plotly-multiple]                             |                                   ![precision-recall-curve-plotly-multiple]                                   |

[roc-curve-plotly-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/roc-curve-plotly-multiple.svg
[precision-recall-curve-plotly-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/precision-recall-curve-plotly-multiple.svg
[stability-confusion-matrix]: https://github.com/janosh/pymatviz/raw/main/assets/svg/stability-confusion-matrix.svg
[crystal-system-confusion-matrix]: https://github.com/janosh/pymatviz/raw/main/assets/svg/crystal-system-confusion-matrix.svg
[error-decay-with-uncert-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/error-decay-with-uncert-multiple.svg
[error-decay-with-uncert]: https://github.com/janosh/pymatviz/raw/main/assets/svg/error-decay-with-uncert.svg
[elements-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/elements-hist.svg
[normal-prob-plot-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/normal-prob-plot-multiple.svg
[normal-prob-plot]: https://github.com/janosh/pymatviz/raw/main/assets/svg/normal-prob-plot.svg
[ptable-heatmap-plotly-log]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-plotly-log.svg
[ptable-heatmap-plotly-more-hover-data]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-plotly-more-hover-data.svg
[ptable-heatmap-ratio]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-ratio.svg
[ptable-heatmap]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap.svg
[spg-num-sunburst]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-sunburst.svg
[spg-symbol-sunburst]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-sunburst.svg
[struct-2d-mp-12712-Hf9Zr9Pd24-disordered]: https://github.com/janosh/pymatviz/raw/main/assets/svg/struct-2d-mp-12712-Hf9Zr9Pd24-disordered.svg
[struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered]: https://github.com/janosh/pymatviz/raw/main/assets/svg/struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered.svg

## How to cite `pymatviz`

See [`citation.cff`](citation.cff) or cite the [Zenodo record](https://zenodo.org/badge/latestdoi/340898532) using the following BibTeX entry:

```bib
@software{riebesell_pymatviz_2022,
  title = {Pymatviz: visualization toolkit for materials informatics},
  author = {Riebesell, Janosh and Yang, Haoyu and Goodall, Rhys and Baird, Sterling G.},
  date = {2022-10-01},
  year = {2022},
  doi = {10.5281/zenodo.7486816},
  url = {https://github.com/janosh/pymatviz},
  note = {10.5281/zenodo.7486816 - https://github.com/janosh/pymatviz},
  urldate = {2023-01-01}, % optional, replace with your date of access
  version = {0.8.2}, % replace with the version you use
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pymatviz",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "chemistry, data visualization, materials discovery, materials informatics, matplotlib, plotly, science",
    "author": null,
    "author_email": "Janosh Riebesell <janosh.riebesell@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a0/ca/eb270bd89c8fa6df8778ba71864a27c8a7139a58ab61f1224ef7e84d1be3/pymatviz-0.15.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\n<img src=\"https://github.com/janosh/pymatviz/raw/main/site/static/favicon.svg\" alt=\"Logo\" height=\"60px\">\n<br class=\"hide-in-docs\">\npymatviz\n</h1>\n\n<h4 align=\"center\" class=\"toc-exclude\">\n\nA toolkit for visualizations in materials informatics.\n\n[![Tests](https://github.com/janosh/pymatviz/actions/workflows/test.yml/badge.svg)](https://github.com/janosh/pymatviz/actions/workflows/test.yml)\n[![This project supports Python 3.10+](https://img.shields.io/badge/Python-3.10+-blue.svg?logo=python&logoColor=white)](https://python.org/downloads)\n[![PyPI](https://img.shields.io/pypi/v/pymatviz?logo=pypi&logoColor=white)](https://pypi.org/project/pymatviz)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/pymatviz?logo=icloud&logoColor=white)](https://pypistats.org/packages/pymatviz)\n[![Zenodo](https://img.shields.io/badge/DOI-10.5281/zenodo.10456384-blue?logo=Zenodo&logoColor=white)](https://zenodo.org/records/10456384)\n\n</h4>\n\n<slot name=\"how-to-cite\">\n\n> If you use `pymatviz` in your research, [see how to cite](#how-to-cite-pymatviz).\n\n</slot>\n\n## Installation\n\n```sh\npip install pymatviz\n```\n\n## API Docs\n\nSee the [/api][/api] page.\n\n[/api]: https://janosh.github.io/pymatviz/api\n\n## Usage\n\nSee the Jupyter notebooks under [`examples/`](examples) for how to use `pymatviz`. PRs with additional examples are welcome! \ud83d\ude4f\n\n|                                                                                                                        |                                                                                                                                                             |                                   |\n| ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |\n| [mlff_phonons.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb)                         | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb)             | [Launch Codespace][codespace url] |\n| [matbench_dielectric_eda.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/matbench_dielectric_eda.ipynb)   | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/matbench_dielectric_eda.ipynb)  | [Launch Codespace][codespace url] |\n| [mp_bimodal_e_form.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mp_bimodal_e_form.ipynb)               | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mp_bimodal_e_form.ipynb)        | [Launch Codespace][codespace url] |\n| [matbench_perovskites_eda.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/matbench_perovskites_eda.ipynb) | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/matbench_perovskites_eda.ipynb) | [Launch Codespace][codespace url] |\n| [mprester_ptable.ipynb](https://github.com/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb)                   | [![Open in Google Colab][Open in Google Colab]](https://colab.research.google.com/github/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb)          | [Launch Codespace][codespace url] |\n\n[Open in Google Colab]: https://colab.research.google.com/assets/colab-badge.svg\n[codespace url]: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=340898532\n\n## Periodic Table\n\nSee [`pymatviz/ptable/ptable_matplotlib.py`](pymatviz/ptable/ptable_matplotlib.py) and [`pymatviz/ptable/ptable_plotly.py`](pymatviz/ptable/ptable_plotly.py). `matplotlib` supports heatmaps, heatmap ratios, heatmap splits (multiple values per element), histograms, scatter plots and line plots. `plotly` currently only supports heatmaps (PRs to port over other `matplotlib` `ptable` variants to `plotly` are very welcome!). The `plotly` heatmap supports displaying additional data on hover or full interactivity through [Dash](https://plotly.com/dash).\n\n|                       [`ptable_heatmap(compositions, log=True)`](assets/scripts/ptable_matplotlib/ptable_heatmap.py)                        |                    [`ptable_heatmap_ratio(comps_a, comps_b)`](assets/scripts/ptable_matplotlib/ptable_heatmap_ratio.py)                    |\n| :-----------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: |\n|                                                              ![ptable-heatmap]                                                              |                                                          ![ptable-heatmap-ratio]                                                           |\n|                       [`ptable_heatmap_plotly(atomic_masses)`](assets/scripts/ptable_plotly/ptable_heatmap_plotly.py)                       |                  [`ptable_heatmap_plotly(compositions, log=True)`](assets/scripts/ptable_plotly/ptable_heatmap_plotly.py)                  |\n|                                                  ![ptable-heatmap-plotly-more-hover-data]                                                   |                                                        ![ptable-heatmap-plotly-log]                                                        |\n|                        [`ptable_hists(data, colormap=\"coolwarm\")`](assets/scripts/ptable_matplotlib/ptable_hists.py)                        |                             [`ptable_hists_plotly(data)`](assets/scripts/ptable_plotly/ptable_hists_plotly.py)                             |\n|                                                               ![ptable-hists]                                                               |                                                           ![ptable-hists-plotly]                                                           |\n|                   [`ptable_scatters_plotly(data, mode=\"markers\")`](assets/scripts/ptable_plotly/ptable_scatter_plotly.py)                   |                    [`ptable_scatter_plotly(data, mode=\"lines\")`](assets/scripts/ptable_plotly/ptable_scatter_plotly.py)                    |\n|                                                      ![ptable-scatter-plotly-markers]                                                       |                                                       ![ptable-lines-mace-diatomic]                                                        |\n| [`ptable_heatmap_splits(2_vals_per_elem, colormap=\"coolwarm\", start_angle=135)`](assets/scripts/ptable_matplotlib/ptable_heatmap_splits.py) | [`ptable_heatmap_splits(3_vals_per_elem, colormap=\"coolwarm\", start_angle=90)`](assets/scripts/ptable_matplotlib/ptable_heatmap_splits.py) |\n|                                                         ![ptable-heatmap-splits-2]                                                          |                                                         ![ptable-heatmap-splits-3]                                                         |\n|               [`ptable_heatmap_splits_plotly(2_vals_per_elem)`](assets/scripts/ptable_plotly/ptable_heatmap_splits_plotly.py)               |              [`ptable_heatmap_splits_plotly(3_vals_per_elem)`](assets/scripts/ptable_plotly/ptable_heatmap_splits_plotly.py)               |\n|                                                      ![ptable-heatmap-splits-plotly-2]                                                      |                                                     ![ptable-heatmap-splits-plotly-3]                                                      |\n\n[ptable-hists]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-hists.svg\n[ptable-lines-mace-diatomic]: https://github.com/janosh/pymatviz/raw/main/assets/svg/homo-nuclear-mace-medium.svg\n[ptable-scatters-parity]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatters-parity.svg\n[ptable-scatters-parabola]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatters-parabola.svg\n[ptable-heatmap-splits-2]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-2.svg\n[ptable-heatmap-splits-3]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-3.svg\n[ptable-heatmap-splits-plotly-2]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-plotly-2.svg\n[ptable-heatmap-splits-plotly-3]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-splits-plotly-3.svg\n[ptable-hists-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-hists-plotly.svg\n[ptable-scatter-plotly-lines]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatter-plotly-lines.svg\n[ptable-scatter-plotly-markers]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-scatter-plotly-markers.svg\n\n### Dash app using `ptable_heatmap_plotly()`\n\nSee [`examples/mprester_ptable.ipynb`](https://github.com/janosh/pymatviz/blob/main/examples/mprester_ptable.ipynb).\n\n[https://user-images.githubusercontent.com/30958850/181644052-b330f0a2-70fc-451c-8230-20d45d3af72f.mp4](https://user-images.githubusercontent.com/30958850/181644052-b330f0a2-70fc-451c-8230-20d45d3af72f.mp4)\n\n## Phonons\n\nSee [`examples/mlff_phonons.ipynb`](https://github.com/janosh/pymatviz/blob/main/examples/mlff_phonons.ipynb) for usage example.\n\n|               [`phonon_bands(bands_dict)`](assets/scripts/phonons/phonon_bands.py)               |                  [`phonon_dos(doses_dict)`](assets/scripts/phonons/phonon_dos.py)                  |\n| :----------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: |\n|                                         ![phonon-bands]                                          |                                           ![phonon-dos]                                            |\n| [`phonon_bands_and_dos(bands_dict, doses_dict)`](assets/scripts/phonons/phonon_bands_and_dos.py) | [`phonon_bands_and_dos(single_bands, single_dos)`](assets/scripts/phonons/phonon_bands_and_dos.py) |\n|                                 ![phonon-bands-and-dos-mp-2758]                                  |                                  ![phonon-bands-and-dos-mp-23907]                                  |\n\n[phonon-bands]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-mp-2758.svg\n[phonon-dos]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-dos-mp-2758.svg\n[phonon-bands-and-dos-mp-2758]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-and-dos-mp-2758.svg\n[phonon-bands-and-dos-mp-23907]: https://github.com/janosh/pymatviz/raw/main/assets/svg/phonon-bands-and-dos-mp-23907.svg\n\n## Structure\n\nSee [`pymatviz/structure_viz/plotly.py`](pymatviz/structure_viz/plotly.py). Currently structure plotting is only supported with `matplotlib` in 2d. 3d interactive plots (probably with `plotly`) are on the road map.\n\n|                 [`structure_2d(mp_19017)`](pymatviz/structure_viz/mpl.py)                 |                 [`structure_2d(mp_12712)`](pymatviz/structure_viz/mpl.py)                 |\n| :---------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |\n|                  ![struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered]                  |                        ![struct-2d-mp-12712-Hf9Zr9Pd24-disordered]                        |\n| [`structure_2d_plotly(six_structs)`](assets/scripts/structure_viz/structure_2d_plotly.py) | [`structure_3d_plotly(six_structs)`](assets/scripts/structure_viz/structure_3d_plotly.py) |\n|                         ![matbench-phonons-structures-2d-plotly]                          |                         ![matbench-phonons-structures-3d-plotly]                          |\n\n[matbench-phonons-structures-2d-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/matbench-phonons-structures-2d-plotly.svg\n[matbench-phonons-structures-3d-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/matbench-phonons-structures-3d-plotly.svg\n\n## Brillouin Zone\n\nSee [`pymatviz/brillouin.py`](pymatviz/brillouin.py).\n\n|   [`brillouin_zone_3d(cubic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py)    |  [`brillouin_zone_3d(hexagonal_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py)   |\n| :-------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------: |\n|                               ![brillouin-cubic-mp-10018]                               |                             ![brillouin-hexagonal-mp-862690]                              |\n| [`brillouin_zone_3d(monoclinic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py) | [`brillouin_zone_3d(orthorhombic_struct)`](assets/scripts/brillouin/brillouin_zone_3d.py) |\n|                           ![brillouin-monoclinic-mp-1183089]                            |                           ![brillouin-orthorhombic-mp-1183085]                            |\n\n[brillouin-cubic-mp-10018]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-cubic-mp-10018.svg\n[brillouin-hexagonal-mp-862690]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-hexagonal-mp-862690.svg\n[brillouin-monoclinic-mp-1183089]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-monoclinic-mp-1183089.svg\n[brillouin-orthorhombic-mp-1183085]: https://github.com/janosh/pymatviz/raw/main/assets/svg/brillouin-orthorhombic-mp-1183085.svg\n\n## X-Ray Diffraction\n\nSee [`pymatviz/xrd.py`](pymatviz/xrd.py).\n\n|             [`xrd_pattern(pattern)`](assets/scripts/xrd/xrd_pattern.py)             |  [`xrd_pattern({key1: patt1, key2: patt2})`](assets/scripts/xrd/xrd_pattern.py)   |\n| :---------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------: |\n|                                   ![xrd-pattern]                                    |                              ![xrd-pattern-multiple]                              |\n| [`xrd_pattern(struct_dict, stack=\"horizontal\")`](assets/scripts/xrd/xrd_pattern.py) | [`xrd_pattern(struct_dict, stack=\"vertical\")`](assets/scripts/xrd/xrd_pattern.py) |\n|                           ![xrd-pattern-horizontal-stack]                           |                           ![xrd-pattern-vertical-stack]                           |\n\n[xrd-pattern]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern.svg\n[xrd-pattern-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-multiple.svg\n[xrd-pattern-horizontal-stack]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-horizontal-stack.svg\n[xrd-pattern-vertical-stack]: https://github.com/janosh/pymatviz/raw/main/assets/svg/xrd-pattern-vertical-stack.svg\n\n## Radial Distribution Functions\n\nSee [`pymatviz/rdf/plotly.py`](pymatviz/rdf/plotly.py).\n\n| [`element_pair_rdfs(pmg_struct)`](assets/scripts/rdf/element_pair_rdfs.py) | [`element_pair_rdfs({\"A\": struct1, \"B\": struct2})`](assets/scripts/rdf/element_pair_rdfs.py) |\n| :------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: |\n|                       ![element-pair-rdfs-Na8Nb8O24]                       |                          ![element-pair-rdfs-crystal-vs-amorphous]                           |\n\n[element-pair-rdfs-Na8Nb8O24]: https://github.com/janosh/pymatviz/raw/main/assets/svg/element-pair-rdfs-Na8Nb8O24.svg\n[element-pair-rdfs-crystal-vs-amorphous]: https://github.com/janosh/pymatviz/raw/main/assets/svg/element-pair-rdfs-crystal-vs-amorphous.svg\n\n## Coordination\n\nSee [`pymatviz/coordination/plotly.py`](pymatviz/coordination/plotly.py).\n\n|                  [`coordination_hist(struct_dict)`](assets/scripts/coordination/coordination_hist.py)                   |          [`coordination_hist(struct_dict, by_element=True)`](assets/scripts/coordination/coordination_hist.py)          |\n| :---------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: |\n|                                               ![coordination-hist-single]                                               |                                      ![coordination-hist-by-structure-and-element]                                      |\n| [`coordination_vs_cutoff_line(struct_dict, strategy=None)`](assets/scripts/coordination/coordination_vs_cutoff_line.py) | [`coordination_vs_cutoff_line(struct_dict, strategy=None)`](assets/scripts/coordination/coordination_vs_cutoff_line.py) |\n|                                            ![coordination-vs-cutoff-single]                                             |                                           ![coordination-vs-cutoff-multiple]                                            |\n\n[coordination-hist-single]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-hist-single.svg\n[coordination-hist-by-structure-and-element]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-hist-by-structure-and-element.svg\n[coordination-vs-cutoff-single]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-vs-cutoff-single.svg\n[coordination-vs-cutoff-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/coordination-vs-cutoff-multiple.svg\n\n## Sunburst\n\nSee [`pymatviz/sunburst.py`](pymatviz/sunburst.py).\n\n| [`spacegroup_sunburst([65, 134, 225, ...])`](assets/scripts/symmetry/spacegroup_sunburst.py) | [`spacegroup_sunburst([\"C2/m\", \"P-43m\", \"Fm-3m\", ...])`](assets/scripts/symmetry/spacegroup_sunburst.py) |\n| :------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: |\n|                                     ![spg-num-sunburst]                                      |                                          ![spg-symbol-sunburst]                                          |\n\n## Rainclouds\n\nSee [`pymatviz/rainclouds.py`](pymatviz/rainclouds.py).\n\n| [`rainclouds(two_key_dict)`](assets/scripts/rainclouds/rainclouds.py) | [`rainclouds(three_key_dict)`](assets/scripts/rainclouds/rainclouds.py) |\n| :-------------------------------------------------------------------: | :---------------------------------------------------------------------: |\n|                         ![rainclouds-bimodal]                         |                         ![rainclouds-trimodal]                          |\n\n[rainclouds-bimodal]: https://github.com/janosh/pymatviz/raw/main/assets/svg/rainclouds-bimodal.svg\n[rainclouds-trimodal]: https://github.com/janosh/pymatviz/raw/main/assets/svg/rainclouds-trimodal.svg\n\n## Sankey\n\nSee [`pymatviz/sankey.py`](pymatviz/sankey.py).\n\n| [`sankey_from_2_df_cols(df_perovskites)`](assets/scripts/sankey/sankey_from_2_df_cols.py) | [`sankey_from_2_df_cols(df_space_groups)`](assets/scripts/sankey/sankey_from_2_df_cols.py) |\n| :---------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------: |\n|                           ![sankey-spglib-vs-aflow-spacegroups]                           |                            ![sankey-crystal-sys-to-spg-symbol]                             |\n\n[sankey-spglib-vs-aflow-spacegroups]: https://github.com/janosh/pymatviz/raw/main/assets/svg/sankey-spglib-vs-aflow-spacegroups.svg\n[sankey-crystal-sys-to-spg-symbol]: https://github.com/janosh/pymatviz/raw/main/assets/svg/sankey-crystal-sys-to-spg-symbol.svg\n\n## Bar Plots\n\nSee [`pymatviz/bar.py`](pymatviz/bar.py).\n\n| [`spacegroup_bar([65, 134, 225, ...], backend=\"matplotlib\")`](assets/scripts/bar/spacegroup_bar.py) | [`spacegroup_bar([\"C2/m\", \"P-43m\", \"Fm-3m\", ...], backend=\"matplotlib\")`](assets/scripts/bar/spacegroup_bar.py) |\n| :-------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: |\n|                                     ![spg-num-hist-matplotlib]                                      |                                          ![spg-symbol-hist-matplotlib]                                          |\n|   [`spacegroup_bar([65, 134, 225, ...], backend=\"plotly\")`](assets/scripts/bar/spacegroup_bar.py)   |   [`spacegroup_bar([\"C2/m\", \"P-43m\", \"Fm-3m\", ...], backend=\"plotly\")`](assets/scripts/bar/spacegroup_bar.py)   |\n|                                       ![spg-num-hist-plotly]                                        |                                            ![spg-symbol-hist-plotly]                                            |\n\n[spg-symbol-hist-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-hist-plotly.svg\n[spg-num-hist-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-hist-plotly.svg\n[spg-num-hist-matplotlib]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-hist-matplotlib.svg\n[spg-symbol-hist-matplotlib]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-hist-matplotlib.svg\n\n## Histograms\n\nSee [`pymatviz/histogram.py`](pymatviz/histogram.py).\n\n| [`elements_hist(compositions, log=True, bar_values='count')`](assets/scripts/histogram/elements_hist.py) | [`histogram({'key1': values1, 'key2': values2})`](assets/scripts/histogram/histogram.py) |\n| :------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: |\n|                                             ![elements-hist]                                             |                                    ![histogram-ecdf]                                     |\n\n[histogram-ecdf]: https://github.com/janosh/pymatviz/raw/main/assets/svg/histogram-ecdf.svg\n\n## Scatter Plots\n\nSee [`pymatviz/scatter.py`](pymatviz/scatter.py).\n\n| [`density_scatter_plotly(df, x=x_col, y=y_col, ...)`](assets/scripts/scatter/density_scatter_plotly.py) | [`density_scatter_plotly(df, x=x_col, y=y_col, ...)`](assets/scripts/scatter/density_scatter_plotly.py) |\n| :-----------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: |\n|                                        ![density-scatter-plotly]                                        |                                     ![density-scatter-plotly-blobs]                                     |\n|               [`density_scatter(xs, ys, ...)`](assets/scripts/scatter/density_scatter.py)               |     [`density_scatter_with_hist(xs, ys, ...)`](assets/scripts/scatter/density_scatter_with_hist.py)     |\n|                                           ![density-scatter]                                            |                                      ![density-scatter-with-hist]                                       |\n|                [`density_hexbin(xs, ys, ...)`](assets/scripts/scatter/density_hexbin.py)                |      [`density_hexbin_with_hist(xs, ys, ...)`](assets/scripts/scatter/density_hexbin_with_hist.py)      |\n|                                            ![density-hexbin]                                            |                                       ![density-hexbin-with-hist]                                       |\n\n[density-scatter-plotly]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-plotly.svg\n[density-scatter-plotly-blobs]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-plotly-blobs.svg\n[density-hexbin-with-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-hexbin-with-hist.svg\n[density-hexbin]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-hexbin.svg\n[density-scatter-with-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter-with-hist.svg\n[density-scatter]: https://github.com/janosh/pymatviz/raw/main/assets/svg/density-scatter.svg\n\n## Uncertainty\n\nSee [`pymatviz/uncertainty.py`](pymatviz/uncertainty.py).\n\n|             [`qq_gaussian(y_true, y_pred, y_std)`](assets/scripts/uncertainty/qq_gaussian.py)             |             [`qq_gaussian(y_true, y_pred, y_std: dict)`](assets/scripts/uncertainty/qq_gaussian.py)             |\n| :-------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: |\n|                                            ![normal-prob-plot]                                            |                                          ![normal-prob-plot-multiple]                                           |\n| [`error_decay_with_uncert(y_true, y_pred, y_std)`](assets/scripts/uncertainty/error_decay_with_uncert.py) | [`error_decay_with_uncert(y_true, y_pred, y_std: dict)`](assets/scripts/uncertainty/error_decay_with_uncert.py) |\n|                                        ![error-decay-with-uncert]                                         |                                       ![error-decay-with-uncert-multiple]                                       |\n\n## Classification\n\nSee [`pymatviz/classify/confusion_matrix.py`](pymatviz/classify/confusion_matrix.py).\n\n| [`confusion_matrix(conf_mat, ...)`](assets/scripts/classify/confusion_matrix.py) | [`confusion_matrix(y_true, y_pred, ...)`](assets/scripts/classify/confusion_matrix.py) |\n| :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: |\n|                          ![stability-confusion-matrix]                           |                           ![crystal-system-confusion-matrix]                           |\n\nSee [`pymatviz/classify/curves.py`](pymatviz/classify/curves.py).\n\n| [`roc_curve_plotly(targets, probs_positive)`](assets/scripts/classify/roc_curve.py) | [`precision_recall_curve_plotly(targets, probs_positive)`](assets/scripts/classify/precision_recall_curve.py) |\n| :---------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------: |\n|                            ![roc-curve-plotly-multiple]                             |                                   ![precision-recall-curve-plotly-multiple]                                   |\n\n[roc-curve-plotly-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/roc-curve-plotly-multiple.svg\n[precision-recall-curve-plotly-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/precision-recall-curve-plotly-multiple.svg\n[stability-confusion-matrix]: https://github.com/janosh/pymatviz/raw/main/assets/svg/stability-confusion-matrix.svg\n[crystal-system-confusion-matrix]: https://github.com/janosh/pymatviz/raw/main/assets/svg/crystal-system-confusion-matrix.svg\n[error-decay-with-uncert-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/error-decay-with-uncert-multiple.svg\n[error-decay-with-uncert]: https://github.com/janosh/pymatviz/raw/main/assets/svg/error-decay-with-uncert.svg\n[elements-hist]: https://github.com/janosh/pymatviz/raw/main/assets/svg/elements-hist.svg\n[normal-prob-plot-multiple]: https://github.com/janosh/pymatviz/raw/main/assets/svg/normal-prob-plot-multiple.svg\n[normal-prob-plot]: https://github.com/janosh/pymatviz/raw/main/assets/svg/normal-prob-plot.svg\n[ptable-heatmap-plotly-log]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-plotly-log.svg\n[ptable-heatmap-plotly-more-hover-data]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-plotly-more-hover-data.svg\n[ptable-heatmap-ratio]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap-ratio.svg\n[ptable-heatmap]: https://github.com/janosh/pymatviz/raw/main/assets/svg/ptable-heatmap.svg\n[spg-num-sunburst]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-num-sunburst.svg\n[spg-symbol-sunburst]: https://github.com/janosh/pymatviz/raw/main/assets/svg/spg-symbol-sunburst.svg\n[struct-2d-mp-12712-Hf9Zr9Pd24-disordered]: https://github.com/janosh/pymatviz/raw/main/assets/svg/struct-2d-mp-12712-Hf9Zr9Pd24-disordered.svg\n[struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered]: https://github.com/janosh/pymatviz/raw/main/assets/svg/struct-2d-mp-19017-Li4Mn0.8Fe1.6P4C1.6O16-disordered.svg\n\n## How to cite `pymatviz`\n\nSee [`citation.cff`](citation.cff) or cite the [Zenodo record](https://zenodo.org/badge/latestdoi/340898532) using the following BibTeX entry:\n\n```bib\n@software{riebesell_pymatviz_2022,\n  title = {Pymatviz: visualization toolkit for materials informatics},\n  author = {Riebesell, Janosh and Yang, Haoyu and Goodall, Rhys and Baird, Sterling G.},\n  date = {2022-10-01},\n  year = {2022},\n  doi = {10.5281/zenodo.7486816},\n  url = {https://github.com/janosh/pymatviz},\n  note = {10.5281/zenodo.7486816 - https://github.com/janosh/pymatviz},\n  urldate = {2023-01-01}, % optional, replace with your date of access\n  version = {0.8.2}, % replace with the version you use\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2021 Janosh Riebesell\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        The software is provided \"as is\", without warranty of any kind, express or\n        implied, including but not limited to the warranties of merchantability,\n        fitness for a particular purpose and noninfringement. In no event shall the\n        authors or copyright holders be liable for any claim, damages or other\n        liability, whether in an action of contract, tort or otherwise, arising from,\n        out of or in connection with the software or the use or other dealings in the\n        software.\n        ",
    "summary": "A toolkit for visualizations in materials informatics",
    "version": "0.15.1",
    "project_urls": {
        "Homepage": "https://github.com/janosh/pymatviz"
    },
    "split_keywords": [
        "chemistry",
        " data visualization",
        " materials discovery",
        " materials informatics",
        " matplotlib",
        " plotly",
        " science"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5fcf62a159091fa2f375d84f8171c2a3a01a77908be82df5a17f6666fea1ff43",
                "md5": "aede3b4a704d70f02d63e64daf55fd06",
                "sha256": "ee3a072a2c008054bf329d9b484cd622547bceae395adcbfaa91beb5efcd3ae3"
            },
            "downloads": -1,
            "filename": "pymatviz-0.15.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aede3b4a704d70f02d63e64daf55fd06",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 179804,
            "upload_time": "2025-01-28T18:42:29",
            "upload_time_iso_8601": "2025-01-28T18:42:29.375508Z",
            "url": "https://files.pythonhosted.org/packages/5f/cf/62a159091fa2f375d84f8171c2a3a01a77908be82df5a17f6666fea1ff43/pymatviz-0.15.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a0caeb270bd89c8fa6df8778ba71864a27c8a7139a58ab61f1224ef7e84d1be3",
                "md5": "996a1b79950727c26e77da47b244f988",
                "sha256": "8f3d60147fbd334a698ab9ded3398357f2cdd90b9c4072cae3c8e9ad06a1adf5"
            },
            "downloads": -1,
            "filename": "pymatviz-0.15.1.tar.gz",
            "has_sig": false,
            "md5_digest": "996a1b79950727c26e77da47b244f988",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 191656,
            "upload_time": "2025-01-28T18:42:32",
            "upload_time_iso_8601": "2025-01-28T18:42:32.115324Z",
            "url": "https://files.pythonhosted.org/packages/a0/ca/eb270bd89c8fa6df8778ba71864a27c8a7139a58ab61f1224ef7e84d1be3/pymatviz-0.15.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-28 18:42:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "janosh",
    "github_project": "pymatviz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymatviz"
}
        
Elapsed time: 0.45534s