VS Code Copilot customization kit · figure skills · By Majid Mazouchi
Copilot Plotting Kit Plate Gallery
Every figure below was rendered by the kit's own scripts on
synthetic data — fourteen skills, one style root. Warm cream canvas, deep ink,
saturated accents; units in every axis label; semantic colors that never
change meaning.
ok / healthywarn / degradedfail / alarmcontext / de-emphasized
IMatplotlib conventions
Templates and annotation helpers every static figure is built from. Object-oriented API, preset sizes, direct labeling, semantic reference bands.
Plate C-01fig_templates.py::stacked
Aligned subplot stack. Three quantities, one shared time axis, one physical unit per axes. Warn and fail bands shaded with semantic tokens; the key moment carries a callout rather than a legend entry.
Plate C-02fig_templates.py::comparison_bars
Comparison bars. Highlight-one, grey-the-rest: the proposed detector in house blue, alternatives in neutral. Values labeled at the bar tip, zero baseline, no vertical gridlines.
IIDiagnostics plots
Fault detection and isolation visuals: spectra, time-frequency maps, residuals against thresholds, and classifier evaluation under class imbalance.
Plate D-01spectral.py::plot_spectrum
Welch spectrum with fault markers. dB magnitude with the expected 6th-harmonic location marked as a labeled stem — hypotheses on the plot, not in the legend.
Plate D-02spectral.py::plot_spectrogram
Spectrogram. Sequential cream-to-blue colormap on the light canvas; the event of interest framed by an ink box. Mesh rasterized inside the SVG to keep files small.
Plate D-03spectral.py::plot_residual_threshold
Residual and threshold. The three mandatory layers: residual, dashed threshold, alarm flags — plus the fault-injection window shaded and first-alarm time called out. Detection delay is THE number.
Plate D-04classifier_eval.py::plot_confusion
Confusion matrix. Raw count and row-normalized recall in every cell; diagonal readable at a glance, text color flips for legibility on dark cells.
Plate D-05classifier_eval.py::plot_roc_pr
ROC and precision-recall pair. Always shown as a pair — at 6% fault prevalence an excellent ROC can hide useless precision. The deployed operating point is marked on both.
Plate D-06fault_heatmap.py::plot_signature_matrix
FDI signature matrix. Ternary fault-symptom structure: up/down/none glyphs, the isolability of each fault mode visible by row pattern.
Plate D-07fault_heatmap.py::plot_dtc_occurrence
DTC occurrence heatmap. Fleet DTC counts over weeks; the peak cell auto-framed and annotated — the figure points at its own anomaly.
IIIPrognostics plots
Remaining useful life, degradation, and reliability. Uncertainty is the product: no bare point estimates, ever.
Plate P-01rul_fan.py::plot_rul_fan
RUL fan. Median trajectory with nested 50% and 90% bands against ground truth; end-of-life is the dashed crimson floor.
Plate P-02rul_fan.py::plot_alpha_lambda
Alpha-lambda accuracy. The standard PHM accuracy view: predictions inside the ±20% cone in blue, violations in crimson, in-cone fraction graded in the title.
Plate P-03degradation.py::plot_health_index
Health index with P-F interval. Green-amber-red zones as quiet background shading; the P-F window — the maintenance opportunity, and the business case — measured and annotated.
Plate P-04degradation.py::plot_fleet_spaghetti
Fleet spaghetti. Twenty-five units in neutral grey with a percentile band; one unit of interest in blue. Narrative view of “this vehicle versus the fleet.”
Plate P-05survival.py::plot_weibull_survival
Weibull survival. Empirical steps with the fitted curve; B10 and B50 lives dropped to the axes with shape and scale reported in the legend.
Plate P-06survival.py::plot_hazard
Hazard rate. The bathtub, with infant, useful-life, and wear-out phases labeled in place.
IVTime-series telemetry
Vehicle logs at scale. This 400,000-sample log is min-max decimated to ~4,000 points per signal — note the single-sample 140 A spike at t ≈ 90 s that naive striding would have erased.
Plate T-01multisignal.py::plot_signal_stack
Decimated signal stack. Aligned stack with a mode lane (enum states as a step plot, not numeric lines) and a DTC event marker spanning all axes. The preserved spike is the proof of the decimator.
VDistributions & SPC
Population comparisons and drift monitoring: the shift-readable ECDF, sorted violins, ridgeline drift, Q-Q honesty checks, and EWMA/CUSUM control charts for fleet features.
Plate X-01dist_plots.py::plot_ecdf
ECDF comparison. The whole-population answer to “did the fix work?” — every percentile of the after-fix curve sits left of before; P90 marked for the spec conversation.
Plate X-02dist_plots.py::plot_violin_panel
Violin panel. Groups sorted by median with n under each violin and the overall median as a dashed reference — plant C is genuinely tighter, plant D genuinely worse.
Plate X-03dist_plots.py::plot_ridgeline
Ridgeline drift. Distribution evolution across five software releases, oldest at the bottom; the tail above 4 A visibly disappears.
Plate X-04dist_plots.py::plot_qq
Q-Q normality check. Heavy tails depart from the fitted line at both ends — a Gaussian threshold on these residuals would over-alarm. The honesty companion to any threshold figure.
Plate X-05control_charts.py::plot_ewma
EWMA control chart. A 0.9σ sustained shift, invisible in the raw samples, signaled 13 points after onset; first violation called out, rule parameters in the title.
Plate X-06control_charts.py::plot_cusum
CUSUM chart. Both one-sided sums against the decision interval h — the upward sum climbs steadily after the shift while the downward stays flat.
VIMaps & 2D fields
The native visuals of machine calibration and operating analysis — and the home of the kit’s 3D policy: surfaces only where the surface IS the object, always with a contour twin.
Plate M-01efficiency_map.py::plot_efficiency_map
Efficiency map. Iso-efficiency lines labeled at the business-relevant levels, torque envelope in ink, MTPA→MTPV trajectory direct-labeled, drive-cycle points sized by dwell.
Plate M-02flux_maps.py::plot_flux_surface
Flux map surface. Policy-compliant 3D: ψd over the current plane with saturation droop toward the viewer, contour projection on the floor, measurement grid as light edge lines.
Plate M-03flux_maps.py::plot_flux_contour
Contour twin. Same data, measurable form — reviewers read values here. The twin is mandatory for any 3D figure that ships.
Plate M-04dwell_density.py::plot_dwell_hexbin
Dwell density. 80,000 fleet operating points as a log-scaled hexbin against the capability envelope; the dashed crimson box flags a region the fleet uses but testing doesn’t cover.
VIIML insights
Model understanding for fault classifiers and fleet segmentation — embeddings that state their method, clustering claims with their silhouette honesty check, and calibration for probabilities that feed maintenance decisions.
Plate L-01embeddings.py::plot_embedding_clusters
Embedding clusters. PCA scatter with convex hulls and per-cluster n; axes labeled with explained variance so the projection is falsifiable.
Plate L-02embeddings.py::plot_silhouette
Silhouette plot. Per-cluster coefficient profiles against the mean — the mandatory companion to any clustering claim; thin or negative clusters are visible immediately.
Plate L-03correlation.py::plot_corr_clustered
Clustered correlation. Features reordered by hierarchical clustering so correlated blocks emerge — the electrical-signature block and the thermal block separate cleanly; weak cells washed out.
Plate L-04importance.py::plot_feature_importance
Feature importance. Sorted bars with cross-fold spread, top-5 in blue, the rest neutral; the method is named because gain, permutation, and SHAP rank differently.
Plate L-05importance.py::plot_calibration
Calibration diagram. Reliability curve with ECE self-graded in the title and the prediction histogram as a quiet strip — for probabilities driving maintenance, calibration beats AUC.
VIIIFlows & relations
How totals decompose, volumes flow, and faults propagate. The waterfall is the canonical executive ROI exhibit; the DAG renderer refuses cycles by design.
Plate F-01waterfall.py::plot_waterfall
ROI waterfall. Gains in green largest-first, costs in crimson, net anchored in slate — the one-figure version of a program pitch. Exec-polish checklist applies by default.
Plate F-02dag_graph.py::plot_layered_dag
Layered causal DAG. Root causes → symptoms → effects, layered by causal depth; edge width encodes occurrence. Accent semantics match the rest of the kit.
Plate F-03parallel_coords.py::plot_parallel
Parallel coordinates. Failed units in blue against a subsampled grey fleet across five normalized axes with real-unit endpoints — the failure population runs hotter, harder, and charges faster.
IXSVG diagrams
Conceptual figures — built from grid-snapped primitives, text stays selectable text. Accent semantics match the charts: blue plant, teal estimation, orange evaluation, crimson decision.
Plate S-01svg_primitives.py::Diagram
Model-based FDI loop. Blocks, labeled arrows, and consistent color meaning. Data charts get matplotlib; structure gets this.
XTables and KPI cards
Live HTML, not screenshots — the same tokens as the charts. Status cells use tinted fills with a colored left border; one heat-shaded column ranks the table.
Table 1 — Detector performance by fault mode (validation fleet).
Fault mode
Detection rate
FAR [1/Mh]
Median horizon [h]
Status
Bearing wear
0.96
1.20
310
Pass
Stator ITSC
0.91
3.40
120
Pass
Resolver offset
0.99
0.40
540
Pass
DC-link cap
0.83
6.80
45
Review
Executive KPI strip and detector table. Seven-row ceiling, right-aligned tabular numerals, em-dash for missing values, caption under the table.
XIInteractive (plotly)
These plates degrade gracefully: a static SVG twin renders everywhere (including offline file previews); when the page is online and plotly.js loads, each upgrades in place to the fully interactive chart — hover, zoom, unified tooltips.
Interactive telemetry. Unified hover with units, overspeed limit as a labeled semantic line. Shown as its static twin until plotly.js loads, then upgraded in place.
Plate I-02sankey_flow.py::build_sankey
DTC resolution Sankey. Stage-colored nodes, links at 30% alpha of their source, volumes in the hover. Flows under 2% of total are grouped before plotting.
Plate I-03fleet_geo.py::plot_state_choropleth
Fleet DTC rate choropleth. Rates normalized by vehicles in operation — never raw counts; states under the minimum-n threshold greyed out. The cold-climate pattern is the hypothesis on display.