Plotting
Visualization utilities for calibration and validation data.
Plotting utilities for EyeLink calibration and validation data.
- class syelink.plotting.CalibrationPlotStyle(color_left='cyan', color_right='magenta', marker='+', marker_size=300, marker_linewidth=2, show_grid=True, grid_alpha=0.3, figsize=(16, 7), dpi=150, title_fontsize=14, label_fontsize=12)[source]
Bases:
objectStyle configuration for calibration plots.
Example
>>> style = CalibrationPlotStyle( ... color_left="green", ... color_right="purple", ... ) >>> plot_calibration_raw(session, style=style)
- Parameters:
- class syelink.plotting.ValidationPlotStyle(color_left='#00FFFF', color_right='#4169E1', color_target='#000000', color_screen='#888888', marker='+', marker_size=200, marker_linewidth=2, line_style='--', line_width=1.5, line_alpha=0.8, label_fontsize=11, label_fontweight='bold', show_labels=True, figsize=(12, 10), dpi=150, title_fontsize=14, show_legend=True, legend_loc='upper right', legend_fontsize=10)[source]
Bases:
objectStyle configuration for validation plots.
All colors can be any matplotlib-compatible color string (hex, named colors, RGB tuples, etc.)
Example
>>> style = ValidationPlotStyle( ... color_left="red", ... color_right="blue", ... marker_size=300, ... ) >>> plot_validation(session, style=style)
- Parameters:
color_left (str)
color_right (str)
color_target (str)
color_screen (str)
marker (str)
marker_size (float)
marker_linewidth (float)
line_style (str)
line_width (float)
line_alpha (float)
label_fontsize (float)
label_fontweight (str)
show_labels (bool)
dpi (int)
title_fontsize (float)
show_legend (bool)
legend_loc (str)
legend_fontsize (float)
- syelink.plotting.plot_calibration_raw(session, cal_index=0, save_path=None, style=None)[source]
Plot RAW calibration points for both eyes on single plot.
- Parameters:
session (
SessionData) – SessionData object containing calibration datacal_index (
int) – Which calibration to plot (0-based index)save_path (
str|Path|None) – Optional path to save the figurestyle (
CalibrationPlotStyle|None) – Optional CalibrationPlotStyle for customizing colors, markers, etc.
- Return type:
- Returns:
matplotlib Figure object
Example
>>> from syelink.plotting import plot_calibration_raw, CalibrationPlotStyle >>> style = CalibrationPlotStyle(color_left="green", color_right="orange") >>> fig = plot_calibration_raw(session, style=style)
- syelink.plotting.plot_validation(session, validation_index=0, save_path=None, target_scale=0.015, target_image_path=None, style=None, show_connectors=False)[source]
Plot a single validation showing left and right eye data.
- Parameters:
session (
SessionData) – SessionData object containing validation datavalidation_index (
int) – Index of validation to plot (0-based)save_path (
str|Path|None) – Optional path to save the plottarget_scale (
float) – Scaling factor for target image size (default: 0.015)target_image_path (
str|Path|None) – Optional path to custom target imagestyle (
ValidationPlotStyle|None) – Optional ValidationPlotStyle for customizing colors, markers, etc.show_connectors (
bool) – Whether to draw connector lines from original label positions to adjusted label positions (default: False)
- Return type:
- Returns:
matplotlib Figure object
Example
>>> from syelink.plotting import plot_validation, ValidationPlotStyle >>> style = ValidationPlotStyle(color_left="red", color_right="green") >>> fig = plot_validation(session, style=style, show_connectors=True)
calibration
Plot calibration points (P-CR in HREF angular space) for both eyes.
Shows the polynomial input — the P-CR feature in HREF coordinates — at each cal target.
- syelink.plotting.calibration.plot_calibration_raw(session, cal_index=0, save_path=None, style=None)[source]
Plot RAW calibration points for both eyes on single plot.
- Parameters:
session (
SessionData) – SessionData object containing calibration datacal_index (
int) – Which calibration to plot (0-based index)save_path (
str|Path|None) – Optional path to save the figurestyle (
CalibrationPlotStyle|None) – Optional CalibrationPlotStyle for customizing colors, markers, etc.
- Return type:
- Returns:
matplotlib Figure object
Example
>>> from syelink.plotting import plot_calibration_raw, CalibrationPlotStyle >>> style = CalibrationPlotStyle(color_left="green", color_right="orange") >>> fig = plot_calibration_raw(session, style=style)
validation
Create validation plots showing target positions and gaze offsets.
Shows left and right eye data with error vectors and offset labels.
- syelink.plotting.validation.plot_validation(session, validation_index=0, save_path=None, target_scale=0.015, target_image_path=None, style=None, show_connectors=False)[source]
Plot a single validation showing left and right eye data.
- Parameters:
session (
SessionData) – SessionData object containing validation datavalidation_index (
int) – Index of validation to plot (0-based)save_path (
str|Path|None) – Optional path to save the plottarget_scale (
float) – Scaling factor for target image size (default: 0.015)target_image_path (
str|Path|None) – Optional path to custom target imagestyle (
ValidationPlotStyle|None) – Optional ValidationPlotStyle for customizing colors, markers, etc.show_connectors (
bool) – Whether to draw connector lines from original label positions to adjusted label positions (default: False)
- Return type:
- Returns:
matplotlib Figure object
Example
>>> from syelink.plotting import plot_validation, ValidationPlotStyle >>> style = ValidationPlotStyle(color_left="red", color_right="green") >>> fig = plot_validation(session, style=style, show_connectors=True)
style
Plot styling configuration for syelink visualizations.
- class syelink.plotting.style.ValidationPlotStyle(color_left='#00FFFF', color_right='#4169E1', color_target='#000000', color_screen='#888888', marker='+', marker_size=200, marker_linewidth=2, line_style='--', line_width=1.5, line_alpha=0.8, label_fontsize=11, label_fontweight='bold', show_labels=True, figsize=(12, 10), dpi=150, title_fontsize=14, show_legend=True, legend_loc='upper right', legend_fontsize=10)[source]
Bases:
objectStyle configuration for validation plots.
All colors can be any matplotlib-compatible color string (hex, named colors, RGB tuples, etc.)
Example
>>> style = ValidationPlotStyle( ... color_left="red", ... color_right="blue", ... marker_size=300, ... ) >>> plot_validation(session, style=style)
- Parameters:
color_left (str)
color_right (str)
color_target (str)
color_screen (str)
marker (str)
marker_size (float)
marker_linewidth (float)
line_style (str)
line_width (float)
line_alpha (float)
label_fontsize (float)
label_fontweight (str)
show_labels (bool)
dpi (int)
title_fontsize (float)
show_legend (bool)
legend_loc (str)
legend_fontsize (float)
- class syelink.plotting.style.CalibrationPlotStyle(color_left='cyan', color_right='magenta', marker='+', marker_size=300, marker_linewidth=2, show_grid=True, grid_alpha=0.3, figsize=(16, 7), dpi=150, title_fontsize=14, label_fontsize=12)[source]
Bases:
objectStyle configuration for calibration plots.
Example
>>> style = CalibrationPlotStyle( ... color_left="green", ... color_right="purple", ... ) >>> plot_calibration_raw(session, style=style)
- Parameters: