Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Sdv dev SDV Get Column Pair Plot

From Leeroopedia
Knowledge Sources
Domains Visualization, Data_Quality
Last Updated 2026-02-14 00:00 GMT

Overview

Wrapper for SDMetrics column pair visualization, producing 2D bivariate distribution comparison plots within SDV workflows.

Description

The get_column_pair_plot function creates a Plotly figure comparing real and synthetic data for a pair of columns. Auto-selects plot type based on column sdtypes.

Usage

Call with real data, synthetic data, metadata, and a pair of column names.

Code Reference

Source Location

  • Repository: SDV
  • File: sdv/evaluation/single_table.py (L111-167), sdv/evaluation/multi_table.py (L91-131)

Signature

def get_column_pair_plot(
    real_data, synthetic_data, metadata, column_names, plot_type=None, sample_size=None
):
    """Get a plot comparing real and synthetic data for a column pair.

    Args:
        real_data (pd.DataFrame): Real data.
        synthetic_data (pd.DataFrame): Synthetic data.
        metadata (Metadata): Table metadata.
        column_names (list[str]): Pair of columns to plot.
        plot_type (str or None): 'box', 'heatmap', 'scatter', 'violin', or None.
        sample_size (int or None): Subsample size for large datasets.

    Returns:
        plotly.graph_objects.Figure: 2D bivariate comparison plot.
    """

Import

from sdv.evaluation.single_table import get_column_pair_plot

I/O Contract

Inputs

Name Type Required Description
real_data pd.DataFrame or dict Yes Real data
synthetic_data pd.DataFrame or dict Yes Synthetic data
metadata Metadata Yes Metadata
column_names list[str] Yes Pair of column names to plot
plot_type str or None No 'box', 'heatmap', 'scatter', 'violin', or None
sample_size int or None No Subsample size (None = all data)

Outputs

Name Type Description
return value plotly.graph_objects.Figure 2D bivariate comparison plot

Usage Examples

from sdv.evaluation.single_table import get_column_pair_plot

fig = get_column_pair_plot(
    real_data, synthetic_data, metadata,
    column_names=['age', 'room_rate']
)
fig.show()

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment