\(\newcommand{\AA}{\text{Å}}\)
Plotting CLI: lmodea-k-plot#
lmodea-k-plot reads an existing lmodea.h5 file and produces one plot
per command. The command now follows a simple flow:
determine the requested plot and command-line/configuration parameters,
fetch only the required HDF5 datasets and slices,
process the selected data for the requested colouring method,
produce the plot and any standalone legend.
The plotting command no longer loads all possible plotting data up front. Instead, each plot function receives a small HDF5-backed data accessor and reads only what it needs.
Usage#
lmodea-k-plot plot_type [options]
Available plot types are:
dispersionPhonon dispersion coloured by local-mode character.
character_evolutionStacked-area plot showing how selected normal-mode character evolves along the k-point path.
barStacked bar chart of local-mode character for normal modes at one k-point.
similarity_matrixHeatmap of the mass-weighted cosine similarity between internal-coordinate rows of the Wilson B matrix.
fc_dispersionEffective force constants as a function of k-point.
Colouring schemes#
The following colour schemes are accepted by --color-by.
Code |
Name |
Main use |
|---|---|---|
|
|
Dispersion coloured by the summed contribution of selected coordinates. |
|
|
Dispersion coloured by the symmetry key of the dominant coordinate. |
|
|
Dispersion coloured by the dominant coordinate. |
|
|
Dispersion coloured by the symmetry key with the largest summed contribution. |
|
|
Dispersion coloured by selected-coordinate contribution divided by total contribution. |
|
|
Character evolution coloured by coordinate. |
|
|
Character evolution coloured by symmetry key. |
|
|
Bar plot grouped by symmetry key. |
|
|
Bar plot coloured by coordinate. |
|
|
Force-constant dispersion with one colour per coordinate. |
|
|
Reserved for force-constant magnitude colouring. |
Data read by each plot#
lmodea-k-plot opens the HDF5 file once and passes an HDF5-backed
PlotData accessor to the selected plotting function. Dataset shapes are used
for validation where possible, so validation does not require reading full
arrays.
Plot |
Data read |
|---|---|
|
Selected rows from |
|
Selected rows from |
|
One k-point slice from |
|
One k-point slice from |
|
Selected rows from |
Required datasets#
The plotting command can only produce plots for datasets that were written by
the original lmodea-k run.
dispersionRequires
--write-normaland--cnmin the analysis run.character_evolutionandbarRequire
--cnm.similarity_matrixRequires
--write-wilson.fc_dispersionRequires the local-mode force-constant datasets written by the main analysis.
Palette files#
Palette files use one colour rule per line:
coord 1 "#DC267F"
coord 2 "#648FFF"
sym 1 "#FFB000"
Coordinate indices in palette files are 1-based. Trailing # comments are
allowed.
Examples#
lmodea-k-plot dispersion --color-by 3 --coords 1-3
lmodea-k-plot dispersion --color-by coord_contribution --coords 4,5 --xmin 2 --xmax 20
lmodea-k-plot character_evolution --modes 1,2,3 --color-by 7 --sym-keys 2
lmodea-k-plot bar --kpoint 2 --color-by 8 --palette
lmodea-k-plot similarity_matrix --kpoint 1 --coords 1-30
lmodea-k-plot fc_dispersion --coords 1-5 --cmap tol
Configuration#
plotting.conf is optional. It must contain a Python literal dictionary. For
example:
{
"global": {"dpi": 300, "font_size": 9},
"dispersion": {"scatter_size": 5, "output": "dispersion_custom.png"},
"bar": {"threshold": 0.02},
}
Command-line options override the relevant configuration values.