gemdat.plots
This module contains all the plots that Gemdat can generate.
arrhenius(*, fit, show_std=True)
Plot Arrhenius fit.
Parameters:
-
fit(ArrheniusFit) โArrheniusFit instance.
-
show_std(bool, default:True) โIf True, show error bars (from diffusivities_std) and a ยฑ1ฯ fit band (from cov).
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_arrhenius.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
autocorrelation(*, orientations, show_traces=True, show_shaded=True)
Plot the autocorrelation function of the unit vectors series.
Parameters:
-
orientations(Orientations) โThe unit vector trajectories
-
show_traces(bool, default:True) โIf True, show traces of individual trajectories
-
show_shaded(bool, default:True) โIf True, show standard deviation as shaded area
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_autocorrelation.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
bond_length_distribution(*, orientations, bins=50)
Plot the bond length probability distribution.
Parameters:
-
orientations(Orientations) โThe unit vector trajectories
-
bins(int, default:50) โThe number of bins
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_bond_length_distribution.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
collective_jumps(*, jumps)
Plot collective jumps per jump-type combination.
Parameters:
-
jumps(Jumps) โInput data
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_collective_jumps.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
density(volume, *, structure=None, force_lattice=None)
Create density plot from volume and structure.
Uses plotly as plotting backend.
Arguments
volume : Volume
Input volume
structure : Structure, optional
Input structure
force_lattice : Lattice | None
Plot volume and structure using this lattice as a basis.
Overrides the default, which is to use volume.lattice
and structure.lattice where applicable.
Returns:
-
fig(Figure) โOutput as plotly figure
Source code in src/gemdat/plots/plotly/_density.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
displacement_histogram(trajectory, n_parts=1)
Plot histogram of total displacement at final timestep.
Parameters:
-
trajectory(Trajectory) โInput trajectory, i.e. for the diffusing atom
-
n_parts(int, default:1) โPlot error bars by dividing data into n parts
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_displacement_histogram.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
displacement_per_atom(*, trajectory)
Plot displacement per atom.
Parameters:
-
trajectory(Trajectory) โInput trajectory, i.e. for the diffusing atom
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_displacement_per_atom.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
displacement_per_element(*, trajectory)
Plot displacement per element.
Parameters:
-
trajectory(Trajectory) โInput trajectory
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_displacement_per_element.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
energy_along_path(path, *, structure=None, other_paths=None)
Plot energy along specified path.
Parameters:
-
path(Pathway) โPathway object containing the energy along the path
-
structure(Structure, default:None) โStructure object to get the site information
-
other_paths(Pathway | list[Pathway], default:None) โOptional list of alternative paths to plot
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_energy_along_path.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
frequency_vs_occurence(*, trajectory)
Plot attempt frequency vs occurence.
Parameters:
-
trajectory(Trajectory) โInput trajectory, i.e. for the diffusing atom
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_frequency_vs_occurence.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
jumps_3d(*, jumps)
Plot jumps in 3D.
Parameters:
-
jumps(Jumps) โInput data
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_jumps_3d.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
jumps_3d_animation(*, jumps, t_start, t_stop, decay=0.05, skip=5, interval=20)
Plot jumps in 3D as an animation over time.
Parameters:
-
jumps(Jumps) โInput data
-
t_start(int) โTime step to start animation (relative to equilibration time)
-
t_stop(int) โTime step to stop animation (relative to equilibration time)
-
decay(float, default:0.05) โControls the decay of the line width (higher = faster decay)
-
skip(float, default:5) โSkip frames (increase for faster, but less accurate rendering)
-
interval(int, default:20) โDelay between frames in milliseconds.
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/matplotlib/_jumps_3d_animation.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
jumps_vs_distance(*, jumps, jump_res=0.1, n_parts=1)
Plot jumps vs distance histogram.
Parameters:
-
jumps(Jumps) โInput jumps data
-
jump_res(float, default:0.1) โResolution of the bins in Angstrom
-
n_parts(int, default:1) โNumber of parts for error analysis
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_jumps_vs_distance.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
jumps_vs_time(*, jumps, bins=8, n_parts=1)
Plot jumps vs distance histogram.
Parameters:
-
jumps(Jumps) โInput jumps data
-
bins(int, default:8) โNumber of bins
-
n_parts(int, default:1) โNumber of parts for error analysis
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_jumps_vs_time.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
msd_kinisi(trajectory, specie, *, diffusion_analyzer=None, step_skip=1, dt=None, dimension='xyz', distance_unit='angstrom', specie_indices=None, masses=None, progress=True, save_cache=True, return_cache=True, show_shaded=True)
Plot mean-squared displacement (MSD) with uncertainties from a kinisi DiffusionAnalyzer.
Parameters:
-
trajectory(Trajectory) โGEMDAT trajectory
-
specie(str) โSpecie to calculate diffusivity for, e.g.
"Li". -
diffusion_analyzer(Optional['DiffusionAnalyzer'], default:None) โA kinisi DiffusionAnalyzer instance.
-
step_skip(int, default:1) โNumber of MD integrator time steps between stored frames.
-
dt('sc.Variable | None', default:None) โTime intervals to calculate displacements over. Optional; if
None, kinisi defaults to a regular grid from the smallest interval (time_step * step_skip) to the full trajectory length. -
dimension(str, default:'xyz') โSubset of
"xyz"indicating displacement axes of interest. -
distance_unit(str, default:'angstrom') โUnit of distance in the input structures, as a string understood by
scipp.Unit(...)(default:"angstrom"). -
specie_indices('sc.Variable | None', default:None) โIndices of the specie to calculate the diffusivity for. Optional; if
None, kinisi selects indices based onspecie. -
masses('sc.Variable | None', default:None) โMasses for centre-of-mass handling. Optional.
-
progress(bool, default:True) โShow progress bars during parsing and MSD evaluation.
-
save_cache(bool, default:True) โCache the populated analyzer on this trajectory instance.
-
return_cache(bool, default:True) โUse cached data.
-
show_shaded(bool, default:True) โIf True, plot ยฑ1ฯ uncertainties as a shaded region.
Returns:
-
fig(Figure) โOutput figure.
Source code in src/gemdat/plots/plotly/_msd_kinisi.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
msd_per_element(*, trajectory)
Plot mean squared displacement per element.
Parameters:
-
trajectory(Trajectory) โInput trajectory
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_msd_per_element.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
plot_3d(*, volume=None, structure=None, paths=None, jumps=None, lattice=None, title='3D plot')
Plot 3d.
Source code in src/gemdat/plots/plotly/_plot3d.py
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
plot_3d_points(points, labels, *, fig, point_size=5, colors=None)
Plot points using plotly.
Parameters:
-
points(ndarray) โInput points
-
labels(Sequence) โLabels for points. Length must match points.
-
fig(Figure) โPlotly figure to add traces to
-
point_size(int, default:5) โSize of the points
-
colors(Optional[dict[str, str]], default:None) โMapping of colors for the each label. See the following link for a list of accepted colours: https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
Source code in src/gemdat/plots/plotly/_plot3d.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
polar(*, orientations, shape=(90, 360), normalize_histo=True)
Plot a polar projection of a spherical function.
This function uses the transformed trajectory.
Parameters:
-
orientations(Orientations) โThe unit vector trajectories
-
shape(tuple, default:(90, 360)) โThe shape of the spherical sector in which the trajectory is plotted
-
normalize_histo(bool, default:True) โIf True, normalize the histogram by the area of the bins, by default True
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/matplotlib/_polar.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
radial_distribution(rdfs)
Plot radial distribution function.
Parameters:
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_radial_distribution.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
rectilinear(*, orientations, shape=(90, 360), normalize_histo=True)
Plot a rectilinear projection of a spherical function.
This function uses the transformed trajectory.
Parameters:
-
orientations(Orientations) โThe unit vector trajectories
-
shape(tuple, default:(90, 360)) โThe shape of the spherical sector in which the trajectory is plotted
-
normalize_histo(bool, default:True) โIf True, normalize the histogram by the area of the bins, by default True
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_rectilinear.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
shape(shape, bins=50, sites=None, cmap=None)
Plot site cluster shapes.
Parameters:
-
shape(ShapeData) โShape data to plot
-
bins(int | Sequence[float], default:50) โNumber of bins or sequence of bin edges. See hist() for more info.
-
sites(Collection[PeriodicSite] | None, default:None) โPlot these sites on the shape density
-
cmap(Colormap | str, default:None) โColormap for the 2D histogram
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/matplotlib/_shape.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
vibrational_amplitudes(*, trajectory, bins=50, n_parts=1)
Plot histogram of vibrational amplitudes with fitted Gaussian.
Parameters:
-
trajectory(Trajectory) โInput trajectory, i.e. for the diffusing atom
-
n_parts(int, default:1) โNumber of parts for error analysis
Returns:
-
fig(Figure) โOutput figure
Source code in src/gemdat/plots/plotly/_vibrational_amplitudes.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |