Skip to content

Building Reusable Templates

You analyze the same type of recording regularly — the same set of signals, the same subplot layout, the same transformations. Instead of setting this up manually every time, create a template that does it in one step.

Set up your ideal plot manually first

Start by loading a representative file and building the plot layout you want to reuse:

  1. Set the subplot grid (e.g., 2x2 for voltage, current, power, frequency)
  2. Drag the relevant series to each subplot
  3. Apply any transformations (e.g., per-unit to percentage)
  4. Add subplot titles and Y-axis labels via right-click → Modify Plot Labels

This manual setup becomes the blueprint for your template.

Manual plot setup as template blueprint

Understand pattern matching

Templates work by matching series names using wildcard patterns. When you apply a template to a new file, Cute Plot looks at each series name and places it in the subplot whose pattern matches.

For example, the pattern *_voltage_a matches:

  • bus1_voltage_a
  • bus2_voltage_a
  • gen_voltage_a

And *Current* matches:

  • Line_Current
  • Load_Current_A
  • Current_Transformer_1

Pattern matching is case-insensitivevoltage matches "Voltage", "VOLTAGE", and "voltage".

Key wildcard rules:

Pattern Meaning Example match
* Any sequence of characters Volt* matches "Voltage_A"
? Any single character Bus_? matches "Bus_1", "Bus_A"
"Exact" Exact match only "Frequency" matches only "Frequency"

See Search Function for the full pattern syntax.

Create the template file

Templates are YAML files stored in ~/.cuteplot/templates/. Here's a complete example for a power system analysis template:

name: "Power System Event Analysis"
description: "2x2 layout for voltage, current, frequency, and power"
version: "1.0"

grid:
  rows: 2
  cols: 2

subplots:
  - position: [0, 0]
    title: "Voltage"
    series_names:
      - "Voltage*"
      - "*_Voltage_*"
      - "V_*"
    y_axis:
      label: "Voltage (pu)"
      auto: true

  - position: [0, 1]
    title: "Current"
    series_names:
      - "*Current*"
      - "I_*"
    y_axis:
      label: "Current (pu)"
      auto: true

  - position: [1, 0]
    title: "Frequency"
    series_names:
      - "Freq*"
      - "Frequency"
    y_axis:
      label: "Frequency (Hz)"
      auto: true

  - position: [1, 1]
    title: "Power"
    series_names:
      - "*Power*"
      - "P_*"
      - "Q_*"
    y_axis:
      label: "Power (MW/Mvar)"
      auto: true

You can also include automatic transformations:

subplots:
  - position: [0, 0]
    series_names:
      - "Voltage*"
    transformations:
      - series_pattern: "Voltage*"
        operation: "multiply_y"
        value: 100.0    # Convert pu to percentage

See Templating System for the full YAML format specification and all available options.

Apply the template

  1. Select your template from the Template dropdown in the plot controls
  2. Load a new data file (or use one already loaded)
  3. Drag the file widget (not individual series) from the sidebar to the plot area
  4. Cute Plot matches series names against your template patterns and distributes them to the correct subplots automatically

A notification tells you how many series were matched. If no series matched, check your patterns against the actual series names in the file.

Applying a template

Template applied with series distributed

Iterate and refine

Common issues and how to fix them:

Patterns too broad — signals ending up in the wrong subplot. Make your patterns more specific. For example, change *Power* to Active_Power* if reactive power series are also matching.

Patterns too narrow — signals not matching at all. Broaden your patterns or add additional patterns to a subplot. Each subplot can have multiple patterns, and a series only needs to match one.

Wrong subplot priority — when a series matches patterns in multiple subplots, the first matching subplot (in template order) wins. Reorder your subplot definitions to prioritize the right placement.

Testing tip: Apply your template to several different files to make sure the patterns work across your typical data. Adjust patterns based on what you find.

Share templates with your team

Template files are portable — copy YAML files from ~/.cuteplot/templates/ to share with colleagues. Teams that use consistent column naming conventions across their simulations get the most value from shared templates.