Pywayne Plot

v0.1.0

Enhanced spectrogram visualization tools for time-frequency analysis. Use when creating spectrograms, spectral analysis, or time-frequency plots for signals...

0· 680·4 current·4 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wangyendt/plot.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Pywayne Plot" (wangyendt/plot) from ClawHub.
Skill page: https://clawhub.ai/wangyendt/plot
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install wangyendt/plot

ClawHub CLI

Package manager switcher

npx clawhub@latest install plot
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
high confidence
!
Purpose & Capability
The skill's name and description promise a Python plotting package (pywayne.plot) with functions to register projections and compute spectrograms, but the bundle contains no code files, no pip/npm/go install spec, and no declared dependencies. A consumer would reasonably expect either the package code or installation instructions (e.g., 'pip install pywayne' or a repository URL). The requested resources (none) are insufficient for the stated purpose.
Instruction Scope
The runtime instructions (SKILL.md) are limited to API usage examples and parameter explanations for spectrogram plotting. They do not instruct the agent to read unrelated files, access environment variables, or send data to external endpoints. The scope of instructions themselves is appropriate for a usage guide.
!
Install Mechanism
There is no install specification and no code files. For a skill that appears to provide a library, the absence of an install mechanism or link to a package/repository is incoherent: users and agents have no way to obtain the implementation referenced by the examples. This is a risk for usability and may be accidental or indicate the skill is purely documentation rather than an executable integration.
Credentials
The skill requests no environment variables, credentials, or config paths. Given it only documents plotting APIs, this is proportionate. There are no secret or unrelated credential requests.
Persistence & Privilege
The skill does not request always-on presence and uses platform defaults for invocation. It does not attempt to modify other skills or system-wide settings. Persistence/privilege requests are minimal and appropriate.
What to consider before installing
This skill reads like documentation for a Python package (pywayne.plot) but contains no package code or install instructions. Before installing or enabling it: 1) Ask the publisher where the actual implementation is (PyPI package name or repository URL) or request an install spec (e.g., pip install). 2) If you expect the agent to run these examples, understand it will fail unless the package is already available in the runtime environment. 3) If you plan to manually install a package named 'pywayne' or similar, review that package's source/release location for authenticity. The mismatch could be harmless (just a docs-only skill) or a packaging omission — treat it as untrusted until you can verify the real code or installation source.

Like a lobster shell, security has layers — review code before you run it.

latestvk97dr7pd6bmx7364g673fhn469818cw9
680downloads
0stars
1versions
Updated 2mo ago
v0.1.0
MIT-0

Pywayne Plot

Enhanced spectrogram visualization tools for professional time-frequency analysis.

Quick Start

import matplotlib.pyplot as plt
from pywayne.plot import regist_projection, parula_map
import numpy as np

# Register custom projection
regist_projection()

# Create spectrogram
fig, ax = plt.subplots(subplot_kw={'projection': 'z_norm'})
spec, freqs, t, im = ax.specgram(
    x=signal_data,
    Fs=100,
    NFFT=128,
    noverlap=96,
    cmap=parula_map,
    scale='dB'
)
ax.set_ylabel('Frequency (Hz)')
plt.colorbar(im, label='Magnitude (dB)')
plt.show()

Functions

regist_projection

Register the custom SpecgramAxes projection. Must be called before using the enhanced specgram functionality.

from pywayne.plot import regist_projection
regist_projection()

SpecgramAxes.specgram

Enhanced spectrogram with advanced features.

Key Parameters:

ParameterDescriptionDefault
NFFTFFT window length (points)256
FsSampling frequency (Hz)2
noverlapOverlap points between windows128
cmapColormap (use parula_map)-
mode'psd', 'magnitude', 'angle', 'phase''psd'
scale'dB' or 'linear''dB'
normalize'global', 'local', 'none''global'
freq_scaleFrequency scaling factor1.0
FcCenter frequency offset (Hz)0

Returns:

  • spec - 2D spectrogram array (n_freqs, n_times)
  • freqs - Frequency axis array
  • t - Time axis array
  • im - matplotlib image object (for colorbar)

get_specgram_params

Auto-recommend STFT parameters based on signal characteristics.

from pywayne.plot import get_specgram_params

params = get_specgram_params(
    signal_length=10000,
    sampling_rate=100,
    time_resolution=0.1  # or freq_resolution=0.5
)
# Returns: NFFT, noverlap, actual_freq_res, actual_time_res, n_segments

parula_map

MATLAB-style perceptually uniform colormap for scientific visualization.

from pywayne.plot import parula_map
plt.imshow(data, cmap=parula_map)

Usage Examples

IMU Signal Analysis

fs = 100  # Sampling rate
win_time, step_time = 1, 0.1

fig, ax = plt.subplots(subplot_kw={'projection': 'z_norm'})
spec, freqs, t, im = ax.specgram(
    x=acc_data,
    Fs=fs,
    NFFT=int(win_time * fs),
    noverlap=int((win_time - step_time) * fs),
    scale='dB',
    cmap=parula_map
)
ax.set_ylabel('Frequency (Hz)')
ax.set_ylim(0, 30)

Physiological Signals (PPG - Heart Rate)

# Convert Hz to bpm for heart rate visualization
fig, ax = plt.subplots(subplot_kw={'projection': 'z_norm'})
spec, freqs, t, im = ax.specgram(
    x=ppg_signal,
    Fs=100,
    NFFT=400,
    noverlap=300,
    freq_scale=60,  # Hz -> bpm
    scale='dB'
)
ax.set_ylabel('Heart Rate (bpm)')
ax.set_ylim(40, 180)

Vibration Analysis with Global Normalization

fig, ax = plt.subplots(subplot_kw={'projection': 'z_norm'})
spec, freqs, t, im = ax.specgram(
    x=vibration_data,
    Fs=1000,
    NFFT=1024,
    noverlap=512,
    scale='linear',
    normalize='global'
)
plt.colorbar(im, label='Normalized Magnitude')

High-Resolution Analysis with Zero-Padding

fig, ax = plt.subplots(subplot_kw={'projection': 'z_norm'})
spec, freqs, t, im = ax.specgram(
    x=signal,
    Fs=100,
    NFFT=100,
    pad_to=512,  # Zero-pad for smoother spectrum
    noverlap=80,
    scale='dB'
)

Scale and Normalization Modes

Scale Modes

ModeDescriptionUse Case
dBLogarithmic (10log10 for PSD, 20log10 for magnitude)Large dynamic range signals
linearLinear amplitudeDirect amplitude comparison

Normalization Modes (only for scale='linear')

ModeDescriptionUse Case
globalZ/max(Z), preserves relative intensityCompare intensity across time
localPer-column normalization to [0,1]Focus on frequency content over time
noneNo normalizationRaw spectrogram values

Frequency Scaling

freq_scaleUnitUse Case
1.0HzDefault, most signals
60bpmHeart rate, respiration rate
0.001kHzAudio signals

Example: freq_scale=60 converts 2 Hz → 120 bpm

Resolution Guidelines

  • Frequency resolution: Δf = Fs / NFFT
  • Time resolution: Δt = (NFFT - noverlap) / Fs
  • Trade-off: Cannot simultaneously achieve high frequency and time resolution

Use get_specgram_params() to auto-calculate optimal parameters.

Interactive Analysis

spec, freqs, t, im = ax.specgram(...)

def on_click(event):
    if event.xdata and event.inaxes == ax:
        time_idx = np.argmin(np.abs(t - event.xdata))
        plt.figure()
        plt.plot(freqs, spec[:, time_idx])
        plt.title(f'FFT at t={event.xdata:.2f}s')
        plt.show()

fig.canvas.mpl_connect('button_press_event', on_click)

Application Areas

  • IMU data: Accelerometer and gyroscope analysis
  • Physiological signals: PPG (heart rate), ECG, respiration
  • Vibration analysis: Machinery fault diagnosis
  • Audio processing: Speech and audio spectrum analysis

Notes

  • Always call regist_projection() before using projection='z_norm'
  • parula_map is recommended for best perceptual uniformity
  • dB mode automatically handles log(0) issues
  • For better FFT efficiency, set NFFT to power of 2

Comments

Loading comments...