upxo.meshing.gbconformant.fm_steel_abaqus.plots module
Matplotlib figures for the before/after comparison (no pyplot state is used).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.colour(value, default)[source]
valueas a hex colour;defaultwhen it is empty. RaisesValueErrorfor text that is no colour.
- class upxo.meshing.gbconformant.fm_steel_abaqus.plots.PlotStyle(kind: str = 'histogram', bins: int = 40, bin_width: float | None = None, bandwidth: float | None = None, log: bool = False, density: bool = False, colors: tuple = ('#4878CF', '#D65F5F'), show_mean: bool = False, show_std: bool = False, show_median: bool = False)[source]
Bases:
objectHow a distribution is drawn.
- bin_width: float | None = None
Width of a histogram bin in the units of the plotted values;
Noneusesbinsbins.
- class upxo.meshing.gbconformant.fm_steel_abaqus.plots.DrawSeries(label: str, values: ndarray, weights: ndarray | None = None, color: str = '#4878CF', integer: bool = False)[source]
Bases:
objectOne distribution to draw: the legend text, the values, their weights (
Nonefor equal weights) and the colour.
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.weighted_stats(values, weights=None) dict[source]
Weighted mean, standard deviation and median (the median of the weighted distribution).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.silverman_bandwidth(values, weights=None) float[source]
Silverman’s rule of thumb for the bandwidth of a Gaussian KDE (weighted).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.kde_curve(values, weights, bandwidth, grid) ndarray[source]
Gaussian kernel density of weighted values on
grid; it adds up to the total weight (1 without weights).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.bin_edges(series, style: PlotStyle)[source]
Common histogram edges for
seriesand a note: whole numbers for integer data, elsebin_widthorbinsbins.
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.stats_text(series, unit='') str[source]
mean 12.3 +- 4.5, median 11.9 umfor a legend (mathtext plus-minus).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.compare_figure(series, style: PlotStyle, *, xlabel='', ylabel='', title='', subtitle='', footnote='', unit='', note_unit=None)[source]
Distributions of one quantity on the two sides: histogram, KDE, both, CDF, box or violin plot.
seriesareDrawSeries. A box or violin plot cannot show weights, so a weighted quantity falls back to the histogram with the KDE. The legend carries the text of each series, with its mean and standard deviation when those are marked.figure.compare_noteslists what was chosen automatically (bin width, bandwidth).
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.distribution_figure(before, after, kind='histogram', *, bins=40, log=False, density=False, xlabel='', title='', labels=('before', 'after'))[source]
Before/after distribution of one quantity as a histogram, KDE, CDF, box or violin plot.
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.matched_change_figure(rows, *, quantity='value', units='', kind='scatter', bins=40, log=False, labels=('before', 'after'), colors=None, subtitle='', footnote='', noun='items')[source]
Per-item change for items present on both sides: before-vs-after or ratio histogram.
- upxo.meshing.gbconformant.fm_steel_abaqus.plots.texture_figure(eulers_before, eulers_after, settings, titles=('Before', 'After'), noun='features', weights=(None, None), weighted_by='')[source]
Pole figures before and after, and (density modes) the after-minus-before difference.
weightsis(before, after), one weight per orientation orNone(every orientation counts once);weighted_bynames the weight (for examplegrain volume) in the titles.