|
2 | 2 |
|
3 | 3 | from typing import Any, Literal, Sequence, get_args
|
4 | 4 |
|
| 5 | +import matplotlib.pyplot as plt |
5 | 6 | import numpy as np
|
6 | 7 | import pandas as pd
|
| 8 | +import plotly.express as px |
| 9 | +import plotly.io as pio |
7 | 10 | import scipy.interpolate
|
8 | 11 | import scipy.stats
|
9 | 12 | from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
|
10 | 13 |
|
11 |
| -from mb_discovery.plot_scripts import plt |
12 |
| - |
13 | 14 | __author__ = "Janosh Riebesell"
|
14 | 15 | __date__ = "2022-08-05"
|
15 | 16 |
|
16 | 17 | StabilityCriterion = Literal["energy", "energy+std", "energy-std"]
|
17 | 18 | WhichEnergy = Literal["true", "pred"]
|
18 | 19 |
|
19 | 20 |
|
| 21 | +# --- define global plot settings |
| 22 | +px.defaults.labels = { |
| 23 | + "n_atoms": "Atom Count", |
| 24 | + "n_elems": "Element Count", |
| 25 | + "crystal_sys": "Crystal system", |
| 26 | + "spg_num": "Space group", |
| 27 | + "n_wyckoff": "Number of Wyckoff positions", |
| 28 | + "n_sites": "Lattice site count", |
| 29 | + "energy_per_atom": "Energy (eV/atom)", |
| 30 | + "e_form": "Formation energy (eV/atom)", |
| 31 | + "e_above_hull": "Energy above convex hull (eV/atom)", |
| 32 | + "e_above_hull_pred": "Predicted energy above convex hull (eV/atom)", |
| 33 | + "e_above_mp_hull": "Energy above MP convex hull (eV/atom)", |
| 34 | + "e_above_hull_error": "Error in energy above convex hull (eV/atom)", |
| 35 | +} |
| 36 | + |
| 37 | +pio.templates.default = "plotly_white" |
| 38 | + |
| 39 | +# https://github.com/plotly/Kaleido/issues/122#issuecomment-994906924 |
| 40 | +# when seeing MathJax "loading" message in exported PDFs, try: |
| 41 | +# pio.kaleido.scope.mathjax = None |
| 42 | + |
| 43 | + |
| 44 | +plt.rc("font", size=14) |
| 45 | +plt.rc("savefig", bbox="tight", dpi=200) |
| 46 | +plt.rc("figure", dpi=200, titlesize=16) |
| 47 | +plt.rcParams["figure.constrained_layout.use"] = True |
| 48 | +# --- end global plot settings |
| 49 | + |
| 50 | + |
20 | 51 | def hist_classified_stable_as_func_of_hull_dist(
|
21 | 52 | e_above_hull_pred: pd.Series,
|
22 | 53 | e_above_hull_true: pd.Series,
|
|
0 commit comments