galore.plot module¶
Plotting routines with Matplotlib
-
galore.plot.
add_overlay
(plt, overlay, overlay_scale=None, overlay_offset=0.0, overlay_style='o', overlay_label=None)[source]¶ Overlay data points from file over existing plot
- Parameters
plt (matplotlib.pyplot) – Pyplot object with target figure/axes active
overlay (str) – Path to overlay data file
overlay_scale (float) – y-axis scale factor for overlay data. If None, scale to match maximum and print this value.
overlay_offset (float) – x-xaxis offset for overlay data
overlay_style (str) – Matplotlib short code for marker/line style
overlay_label (str) – Legend label for data overlay (default: filename)
-
galore.plot.
guess_xlabel
(units=None, flipx=False, energy_label=None)[source]¶ Infer a decent x-xaxis label from available information
- Parameters
units (str) – Energy or frequency unit string
flipx (bool) – Is energy scale negated to form binding energy
energy_label (str) – Header from .dat file if used
-
galore.plot.
plot_pdos
(pdos_data, ax=None, total=True, show_orbitals=True, offset=0.0, flipx=False, **kwargs)[source]¶ Plot a projected density of states (PDOS)
- Parameters
pdos_data (dict) –
Data for pdos plot in format:
{'el1': {'energy': values, 's': values, 'p': values ...}, 'el2': {'energy': values, 's': values, ...}, ...}
where DOS values are 1D numpy arrays. For deterministic plots, use ordered dictionaries!
ax (matplotlib.Axes) – Use existing Axes object for plot. If None, a new figure and axes will be created.
total (bool) – Include total DOS. This is sum over all others. Input x-values must be consistent, no further resampling is done.
show_orbitals (bool) – Show orbital contributions. If False, they will not be plotted but are still used to calculate the total DOS.
offset (float) – Bias x-axis values (e.g. to account for XPS E-Fermi),
flipx (bool) – Negate x-axis values to express negative VB energies as positive binding energies.
- Returns
The pyplot state machine. Can be queried to access current figure and axes.
- Return type
(matplotlib.pyplot)
-
galore.plot.
plot_tdos
(xdata, ydata, ax=None, offset=0.0, **kwargs)[source]¶ Plot a total DOS (i.e. 1D dataset)
- Parameters
xdata (iterable) – x-values (energy, frequency etc.)
ydata (iterable) – Corresponding y-values (DOS or measurement intensity)
show (bool) – Display plot
offset (float) – Energy shift to x-axis
ax (matplotlib.Axes) – If provided, plot onto existing Axes object. If None, a new Figure will be created and the pyplot instance will be returned.
- Returns
The pyplot state machine. Can be queried to access current figure and axes.
- Return type
(matplotlib.pyplot)