\(\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:
dispersionUnified dispersion-style plot. Use
--quantityto choose normal-mode, local-mode, force-constant, or normal/local overlay data.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.
Colouring schemes#
The following named colour schemes are accepted by --color-by:
black— plot all branches in black.continuous— normal-mode dispersion coloured continuously by selected CNM amplitudes. Use--cnm-aggregateto choose averaging or maximum aggregation.dominant_coord— normal-mode dispersion coloured by the coordinate with the largest CNM amplitude.dominant_group— normal-mode dispersion coloured by the group with the largest aggregate CNM amplitude. Use--group-byto select the grouping source.coord— local-mode, force-constant, or normal/local dispersion coloured by coordinate.group— local-mode, force-constant, or normal/local dispersion coloured by a group selected with--group-by.char_coord— character evolution coloured by coordinate.char_symkey— character evolution coloured by symmetry key.bar_symkey— bar plot grouped by symmetry key.bar_coord— bar plot coloured by coordinate.
For dispersion --quantity normal, the valid colour schemes are black,
continuous, dominant_coord, and dominant_group. For local,
force_constant, and normal_local, the valid colour schemes are
black, coord, and group. Grouped dispersion schemes use
--group-by coord|symkey|type|custom.
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 |
|---|---|
|
For
columns are read. For |
|
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.
dispersionWith
--quantity normal, requires--write-normal. CNM data is required only for CNM-based colouring schemes. With--quantity localornormal_local, requires the local-mode frequency datasets written by the main analysis. With--quantity force_constant, requires the local-mode force-constant datasets written by the main analysis.character_evolutionandbarRequire
--cnm.similarity_matrixRequires
--write-wilson.fc_dispersionRequires the local-mode force-constant datasets written by the main analysis. This is an alias for
dispersion --quantity force_constant.
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 dominant_coord --coords 1-3
lmodea-k-plot dispersion --quantity normal --color-by black
lmodea-k-plot dispersion --quantity local --color-by group --group-by type --coords 1-10
lmodea-k-plot dispersion --quantity force_constant --color-by group --group-by symkey
lmodea-k-plot dispersion --quantity normal_local --color-by coord
lmodea-k-plot dispersion --color-by continuous --coords 4,5 --xmin 2 --xmax 20
lmodea-k-plot dispersion --color-by dominant_group --group-by symkey
lmodea-k-plot character_evolution --modes 1,2,3 --color-by char_symkey --sym-keys 2
lmodea-k-plot bar --kpoint 2 --color-by bar_symkey --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.