Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, scholar.google, wiley.com, nature.com, rsc.org, acs.org, zenodo.org -
✓Committers with academic emails
2 of 11 committers (18.2%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.8%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A toolkit for visualizations in materials informatics.
Basic Info
- Host: GitHub
- Owner: janosh
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://janosh.github.io/pymatviz
- Size: 16.3 MB
Statistics
- Stars: 259
- Watchers: 6
- Forks: 31
- Open Issues: 11
- Releases: 38
Topics
Metadata Files
readme.md
pymatviz
A toolkit for visualizations in materials informatics. [](https://github.com/janosh/pymatviz/actions/workflows/test.yml) [](https://python.org/downloads) [](https://pypi.org/project/pymatviz) [](https://codecov.io/gh/janosh/pymatviz) [](https://pypistats.org/packages/pymatviz) [](https://zenodo.org/records/10456384)
If you use
pymatvizin your research, see how to cite. Check out 23 existing papers usingpymatvizfor inspiration!
Installation
sh
pip install pymatviz
See pyproject.toml for available extras like pip install 'pymatviz[brillouin]' to render 3d Brillouin zones.
API Docs
See the /api page.
Usage
See the Jupyter notebooks under examples/ for how to use pymatviz. PRs with additional examples are welcome! 🙏
| | | |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| matbenchdielectriceda.ipynb | | Launch Codespace |
| mpbimodale_form.ipynb |
| Launch Codespace |
| matbenchperovskiteseda.ipynb |
| Launch Codespace |
| mprester_ptable.ipynb |
| Launch Codespace |
Periodic Table
See pymatviz/ptable/plotly.py. The module supports heatmaps, heatmap splits (multiple values per element), histograms, scatter plots and line plots. All visualizations are interactive through Plotly and support displaying additional data on hover.
[!WARNING] Version 0.16.0 of
pymatvizdropped the matplotlib-based functions inptable_matplotlib.pyin https://github.com/janosh/pymatviz/pull/270. Please use theplotly-based functions shown below instead which have feature parity, interactivity and better test coverage.
| ptable_heatmap_plotly(atomic_masses) | ptable_heatmap_plotly(compositions, log=True) |
| :----------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
ptable_hists_plotly(data) |
ptable_scatter_plotly(data, mode="markers") |
|
|
|
|
ptable_heatmap_splits_plotly(2_vals_per_elem) |
ptable_heatmap_splits_plotly(3_vals_per_elem) |
| |
|
Dash app using ptable_heatmap_plotly()
See examples/mprester_ptable.ipynb.
Phonons
| phonon_bands(bands_dict) |
phonon_dos(doses_dict) |
| :----------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
phonon_bands_and_dos(bands_dict, doses_dict) | phonon_bands_and_dos(single_bands, single_dos) |
|
|
|
Composition Clustering
| cluster_compositions(compositions, properties, embedding_method, projection_method, n_components=2) |
cluster_compositions(compositions, properties, embedding_method, projection_method, n_components=3) |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: |
| |
|
Visualize 2D or 3D relationships between compositions and properties using multiple embedding and dimensionality reduction techniques:
Embedding methods: One-hot encoding of element fractions, Magpie features (elemental properties), Matscholar element embeddings, MEGNet element embeddings
Dimensionality reduction methods: PCA (linear), t-SNE (non-linear), UMAP (non-linear), Isomap (non-linear), Kernel PCA (non-linear)
Example usage:
```py import pymatviz as pmv from pymatgen.core import Composition
compositions = ("Fe2O3", "Al2O3", "SiO2", "TiO2")
Create embeddings
embeddings = pmv.cluster.composition.onehotencode(compositions) compembmap = dict(zip(compositions, embeddings, strict=True))
Plot with optional property coloring
fig = pmv.clustercompositions( compositions=compembmap, properties=[1.0, 2.0, 3.0, 4.0], # Optional property values propname="Property", # Optional property label embeddingmethod="one-hot", # or "magpie", "matscholarel", "megnetel", etc. projectionmethod="pca", # or "tsne", "umap", "isomap", "kernelpca", etc. showchemsys="shape", # works best for small number of compositions; "color" | "shape" | "color+shape" | None ncomponents=2, # or 3 for 3D plots ) fig.show() ```
Structure Clustering
On the roadmap but no ETA yet.
Structure
See pymatviz/structure/plotly.py.
| structure_3d(hea_structure) | structure_3d(lco_supercell) |
| :---------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
structure_2d(six_structs) |
structure_3d(six_structs) |
|
|
|
Interactive Widgets
See pymatviz/widgets. Interactive 3D structure, molecular dynamics trajectory and composition visualization widgets for Jupyter, Marimo, and VSCode notebooks, powered by anywidget and MatterViz (https://github.com/janosh/matterviz). Supports pymatgen Structure, ASE Atoms, and PhonopyAtoms, as well as ASE, pymatgen and plain Python trajectory formats.
```py from pymatviz import StructureWidget, CompositionWidget, TrajectoryWidget from pymatgen.core import Structure, Composition
Interactive 3D structure visualization
structure = Structure.fromfile("structure.cif") structwidget = StructureWidget(structure=structure)
Interactive composition visualization
composition = Composition("Fe2O3") comp_widget = CompositionWidget(composition=composition)
Interactive trajectory visualization
trajectory1 = [struct1, struct2, struct3] # List of structures traj_widget1 = TrajectoryWidget(trajectory=trajectory1)
trajectory2 = [{"structure": struct1, "energy": 1.0}, {"structure": struct2, "energy": 2.0}, {"structure": struct3, "energy": 3.0}] # dicts with "structure" and property values traj_widget2 = TrajectoryWidget(trajectory=trajectory2) ```
Examples:
[!TIP] Checkout the ✅ MatterViz VSCode extension for using the same viewers directly in VSCode/Cursor editor tabs for rendering local and remote files: marketplace.visualstudio.com/items?itemName=janosh.matterviz
Importing pymatviz auto-registers all widgets for their respective sets of supported objects via register_matterviz_widgets(). To customize the registration, use set_renderer().
Brillouin Zone
| brillouin_zone_3d(cubic_struct) |
brillouin_zone_3d(hexagonal_struct) |
| :------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------: |
| |
|
|
brillouin_zone_3d(monoclinic_struct) |
brillouin_zone_3d(orthorhombic_struct) |
| |
|
X-Ray Diffraction
See pymatviz/xrd.py.
| xrd_pattern(pattern) |
xrd_pattern({key1: patt1, key2: patt2}) |
| :--------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------: |
| |
|
|
xrd_pattern(struct_dict, stack="horizontal") |
xrd_pattern(struct_dict, stack="vertical") |
| |
|
Radial Distribution Functions
| element_pair_rdfs(pmg_struct) | element_pair_rdfs({"A": struct1, "B": struct2}) |
| :-----------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
Coordination
See pymatviz/coordination/plotly.py.
| coordination_hist(struct_dict) | coordination_hist(struct_dict, by_element=True) |
| :-----------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
coordination_vs_cutoff_line(struct_dict, strategy=None) | coordination_vs_cutoff_line(struct_dict, strategy=None) |
|
|
|
Sunburst
See pymatviz/sunburst.py.
| spacegroup_sunburst([65, 134, 225, ...]) |
chem_sys_sunburst(["FeO", "Fe2O3", "LiPO4", ...]) |
| :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
chem_env_sunburst(single_struct) | chem_env_sunburst(multiple_structs) |
| |
|
Treemap
See pymatviz/treemap/chem_sys.py.
| chem_sys_treemap(["FeO", "Fe2O3", "LiPO4", ...]) |
chem_sys_treemap(["FeO", "Fe2O3", "LiPO4", ...], group_by="formula") |
| :----------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------: |
| |
|
|
chem_env_treemap(structures) |
chem_env_treemap(structures, max_cells_cn=3, max_cells_ce=4) |
| |
|
|
py_pkg_treemap("pymatviz") |
py_pkg_treemap(["pymatviz", "torch_sim", "pymatgen"]) |
| |
|
|
py_pkg_treemap("pymatviz", color_by="coverage") |
py_pkg_treemap("pymatgen", color_by="coverage", color_range=(0, 100)) |
| |
|
Note: For
color_by="coverage"the package must have coverage data (e.g. runpytest --cov=<pkg> --cov-report=xmland pass the resulting.coveragefile tocoverage_data_file).
Rainclouds
| rainclouds(two_key_dict) |
rainclouds(three_key_dict) |
| :-------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------: |
| |
|
Sankey
See pymatviz/sankey.py.
| sankey_from_2_df_cols(df_perovskites) |
sankey_from_2_df_cols(df_space_groups) |
| :-----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------: |
| |
|
Bar Plots
See pymatviz/bar.py.
| spacegroup_bar([65, 134, 225, ...]) |
spacegroup_bar(["C2/m", "P-43m", "Fm-3m", ...]) |
| :--------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------: |
| |
|
Histograms
| elements_hist(compositions, log=True, bar_values='count') |
histogram({'key1': values1, 'key2': values2}) |
| :-----------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
Scatter Plots
See pymatviz/scatter.py.
| density_scatter_plotly(df, x=x_col, y=y_col, ...) | density_scatter_plotly(df, x=x_col, y=y_col, ...) |
| :----------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
|
density_scatter(xs, ys, ...) |
density_scatter_with_hist(xs, ys, ...) |
|
|
|
|
density_hexbin(xs, ys, ...) |
density_hexbin_with_hist(xs, ys, ...) |
|
|
|
Uncertainty
| qq_gaussian(y_true, y_pred, y_std) |
qq_gaussian(y_true, y_pred, y_std: dict) |
| :---------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: |
| |
|
|
error_decay_with_uncert(y_true, y_pred, y_std) |
error_decay_with_uncert(y_true, y_pred, y_std: dict) |
| |
|
Classification
See pymatviz/classify/confusion_matrix.py.
| confusion_matrix(conf_mat, ...) | confusion_matrix(y_true, y_pred, ...) |
| :----------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
See pymatviz/classify/curves.py.
| roc_curve_plotly(targets, probs_positive) |
precision_recall_curve_plotly(targets, probs_positive) |
| :--------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
|
How to cite pymatviz
See citation.cff or cite the Zenodo record 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
}
Papers using pymatviz
Sorted by number of citations, then year. Last updated 2025-05-07. Auto-generated from Google Scholar. Manual additions via PR welcome.
- C Zeni, R Pinsler, D Zügner et al. (2023). Mattergen: a generative model for inorganic materials design (cited by 134)
- J Riebesell, REA Goodall, P Benner et al. (2023). Matbench Discovery--A framework to evaluate machine learning crystal stability predictions (cited by 53)
- L Barroso-Luque, M Shuaibi, X Fu et al. (2024). Open materials 2024 (omat24) inorganic materials dataset and models (cited by 48)
- C Chen, DT Nguyen, SJ Lee et al. (2024). Accelerating computational materials discovery with machine learning and cloud high-performance computing: from large-scale screening to experimental validation (cited by 43)
- M Giantomassi, G Materzanini (2024). Systematic assessment of various universal machine‐learning interatomic potentials (cited by 22)
- AA Naik, C Ertural, P Benner et al. (2023). A quantum-chemical bonding database for solid-state materials (cited by 15)
- K Li, AN Rubungo, X Lei et al. (2025). Probing out-of-distribution generalization in machine learning for materials (cited by 9)
- A Kapeliukha, RA Mayo (2025). MOSAEC-DB: a comprehensive database of experimental metal–organic frameworks with verified chemical accuracy suitable for molecular simulations (cited by 3)
- N Tuchinda, CA Schuh (2025). Grain Boundary Segregation and Embrittlement of Aluminum Binary Alloys from First Principles (cited by 2)
- A Onwuli, KT Butler, A Walsh (2024). Ionic species representations for materials informatics (cited by 2)
- A Peng, MY Guo (2025). The OpenLAM Challenges (cited by 1)
- F Therrien, JA Haibeh (2025). OBELiX: A curated dataset of crystal structures and experimentally measured ionic conductivities for lithium solid-state electrolytes (cited by 1)
- Aaron D. Kaplan, Runze Liu, Ji Qi et al. (2025). A Foundational Potential Energy Surface Dataset for Materials
- Fei Shuang, Zixiong Wei, Kai Liu et al. (2025). Universal machine learning interatomic potentials poised to supplant DFT in modeling general defects in metals and random alloys
- Yingheng Tang, Wenbin Xu, Jie Cao et al. (2025). MatterChat: A Multi-Modal LLM for Material Science
- Liming Wu, Wenbing Huang, Rui Jiao et al. (2025). Siamese Foundation Models for Crystal Structure Prediction
- K Yan, M Bohde, A Kryvenko (2025). A Materials Foundation Model via Hybrid Invariant-Equivariant Architectures
- N Tuchinda, CA Schuh (2025). A Grain Boundary Embrittlement Genome for Substitutional Cubic Alloys
- Daniel W. Davies, Keith T. Butler, Adam J. Jackson et al. (2024). SMACT: Semiconducting Materials by Analogy and Chemical Theory
- Hui Zheng, Eric Sivonxay, Rasmus Christensen et al. (2024). The ab initio non-crystalline structure database: empowering machine learning to decode diffusivity
- HH Li, Q Chen, G Ceder (2024). Voltage Mining for (De) lithiation-Stabilized Cathodes and a Machine Learning Model for Li-Ion Cathode Voltage
- Janosh Riebesell, Ilyes Batatia, Philipp Benner et al. (2023). A foundation model for atomistic materials chemistry
- Jack Douglas Sundberg (2022). A New Framework for Material Informatics and Its Application Toward Electride-Halide Material Systems
Owner
- Name: Janosh Riebesell
- Login: janosh
- Kind: user
- Location: GitHub
- Website: https://janosh.dev
- Repositories: 62
- Profile: https://github.com/janosh
Working on computational chemistry with pre-trained ML force fields
Citation (citation.cff)
cff-version: 1.2.0
title: Pymatviz
message: If you use this software, please cite it as below.
authors:
- family-names: Riebesell
given-names: Janosh
affiliation: University of Cambridge
email: janosh.riebesell@gmail.com
orcid: https://orcid.org/0000-0001-5233-3462
github: janosh
- family-names: Yang
given-names: Haoyu (Daniel)
email: yanghaoyu97@outlook.com
github: DanielYang59
- family-names: Goodall
given-names: Rhys
affiliation: University of Cambridge
orcid: https://orcid.org/0000-0002-6589-1700
github: comprhys
- family-names: Baird
given-names: Sterling G.
affiliation: University of Utah
orcid: https://orcid.org/0000-0002-4491-6876
github: sgbaird
license: MIT
license-url: https://github.com/janosh/pymatviz/blob/main/license"
repository-code: https://github.com/janosh/pymatviz
type: software
url: https://github.com/janosh/pymatviz
doi: 10.5281/zenodo.7486816
version: 0.17.0 # replace with whatever version you use
date-released: 2025-07-22
GitHub Events
Total
- Create event: 67
- Issues event: 27
- Release event: 7
- Watch event: 95
- Delete event: 57
- Issue comment event: 106
- Push event: 317
- Pull request review event: 60
- Pull request review comment event: 68
- Pull request event: 121
- Fork event: 21
Last Year
- Create event: 67
- Issues event: 27
- Release event: 7
- Watch event: 95
- Delete event: 57
- Issue comment event: 106
- Push event: 317
- Pull request review event: 60
- Pull request review comment event: 68
- Pull request event: 121
- Fork event: 21
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Janosh Riebesell | j****l@g****m | 415 |
| Haoyu (Daniel) | y****7@o****m | 23 |
| pre-commit-ci[bot] | 6****] | 8 |
| Rhys Goodall | r****l@o****m | 7 |
| Sterling Baird | 4****d | 2 |
| Theo Keane | 2****o | 1 |
| Min-Hsueh chiu | m****h@u****u | 1 |
| Jiacheng Wang | 6****7 | 1 |
| J. George | J****o | 1 |
| Hui Zheng | h****1@e****u | 1 |
| GKarbon | u****y@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 61
- Total pull requests: 280
- Average time to close issues: 3 months
- Average time to close pull requests: 3 days
- Total issue authors: 13
- Total pull request authors: 12
- Average comments per issue: 2.54
- Average comments per pull request: 0.96
- Merged pull requests: 261
- Bot issues: 0
- Bot pull requests: 22
Past Year
- Issues: 22
- Pull requests: 133
- Average time to close issues: about 2 months
- Average time to close pull requests: 4 days
- Issue authors: 8
- Pull request authors: 8
- Average comments per issue: 2.09
- Average comments per pull request: 1.12
- Merged pull requests: 118
- Bot issues: 0
- Bot pull requests: 4
Top Authors
Issue Authors
- DanielYang59 (24)
- janosh (20)
- sgbaird (7)
- Asif-Iqbal-Bhatti (2)
- CompRhys (2)
- fperez (1)
- theochemtheo (1)
- rkingsbury (1)
- edaniels (1)
- JaGeo (1)
- KingaMas (1)
- keeganq (1)
- Pepe-Marquez (1)
- kaueltzen (1)
Pull Request Authors
- janosh (276)
- DanielYang59 (50)
- pre-commit-ci[bot] (24)
- CompRhys (9)
- jcwang587 (2)
- theochemtheo (2)
- minhsueh (2)
- GKarbon (2)
- sgbaird (2)
- JaGeo (1)
- bmaranville (1)
- Tinaatucsd (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/deploy-pages v1 composite
- actions/setup-node v3 composite
- actions/setup-python v4 composite
- actions/upload-pages-artifact v1 composite
- actions/checkout v3 composite
- gaurav-nelson/github-action-markdown-link-check v1 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- @iconify/svelte ^3.1.0 development
- @sveltejs/adapter-static ^1.0.5 development
- @sveltejs/kit ^1.3.9 development
- @sveltejs/vite-plugin-svelte ^2.0.2 development
- @typescript-eslint/eslint-plugin ^5.50.0 development
- @typescript-eslint/parser ^5.50.0 development
- eslint ^8.33.0 development
- eslint-plugin-svelte3 ^4.0.0 development
- hastscript ^7.2.0 development
- highlight.js ^11.7.0 development
- mdsvex ^0.10.6 development
- prettier ^2.8.3 development
- prettier-plugin-svelte ^2.9.0 development
- rehype-autolink-headings ^6.1.1 development
- rehype-slug ^5.1.0 development
- svelte ^3.55.1 development
- svelte-check ^3.0.3 development
- svelte-preprocess ^5.0.1 development
- svelte-toc ^0.5.2 development
- svelte-zoo ^0.2.4 development
- svelte2tsx ^0.6.1 development
- tslib ^2.5.0 development
- typescript ^4.9.5 development
- vite ^4.0.4 development
- matplotlib >= 3.6.2
- numpy >= 1.21.0
- pandas >= 2.0.0
- plotly *
- pymatgen *
- scikit-learn *
- scipy *