1import{j as e,L as i}from"./vendor-react-CVijXI0n.js";import{S as s,b as c,h as n,a as d}from"./index-D0o2Sutv.js";import{C as x}from"./ChartBreadcrumb-BOBTh6lg.js";import{C as p,b as m}from"./ChartFAQ-DwXxlpIj.js";const r="https://www.visualizing.org",o=[{q:"What is a pair plot?",a:"A pair plot (also called a scatterplot matrix or SPLOM) arranges scatter plots for every combination of variables in a grid. For n variables, it creates an n à n matrix where each off-diagonal cell shows a scatter plot of two variables, and each diagonal cell shows a univariate distribution (typically a histogram or KDE)."},{q:"When should you use a pair plot?",a:"Use a pair plot when you want to see all pairwise relationships in a multivariate dataset. It also works well when performing EDA before building a model, and when looking for non-linear relationships that a correlogram would miss."},{q:"When should you avoid a pair plot?",a:"Avoid a pair plot when you have more than 10â12 variables â the grid becomes impossibly small. It is also a poor fit when your dataset has millions of rows â each scatter plot will be overplotted, or when you only need one specific pair â make a full-size scatter plot instead."},{q:"What data do you need to make a pair plot?",a:"// Tidy table â each column is a variable"},{q:"How is a pair plot different from a correlogram?",a:"Both a pair plot and a correlogram can look similar at first glance, but they answer different questions. Reach for a pair plot when the comparisons and patterns it was designed to reveal match what you need to communicate, and choose a correlogram when its particular strengths better fit your data and audience."},{q:"What is another name for a pair plot?",a:"Pair Plot is also known as Scatterplot matrix, SPLOM. The name varies between fields, but the visualisation technique is the same."},{q:"What size of dataset works best for a pair plot?",a:"Pair Plot works best for Multivariate exploration. Outside that range the chart either looks empty or becomes too cluttered to read clearly."},{q:"Are pair plots accessible to screen readers?",a:"Yes â a pair plot can be made accessible to screen readers by pairing it with a clear text summary of the key insight, ensuring color choices meet WCAG contrast guidelines, adding descriptive alt text or aria-label to the SVG, and offering the underlying data as an HTML table fallback for assistive technologies."}],h=m("/pair-plot",o),b={"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":`${r}/pair-plot/#webpage`,url:`${r}/pair-plot`,name:"Pair Plot â The Definitive Guide",description:"Learn what a pair plot is, how to read scatter-plot matrices, when to use pair plots, and common mistakes to avoid.",isPartOf:{"@id":`${r}/#website`},breadcrumb:{"@id":`${r}/pair-plot/#breadcrumb`},mainEntity:{"@id":`${r}/pair-plot/#article`},inLanguage:"en"},c({slug:"/pair-plot",caption:"Example pair plot",width:620,height:280}),{"@type":["Article","LearningResource"],"@id":`${r}/pair-plot/#article`,mainEntityOfPage:{"@id":`${r}/pair-plot/#webpage`},headline:"Pair Plot: Definition, How to Read, and When to Use",description:"A complete reference guide to pair plots â what they are, how to read scatter-plot matrices, when to use them, and common mistakes to avoid.",image:{"@id":n("/pair-plot")},datePublished:"2025-03-15",dateModified:"2026-04-08",publisher:{"@id":`${r}/#organization`},inLanguage:"en",educationalLevel:"intermediate",learningResourceType:"reference",teaches:["How to read and interpret pair plots","When to use pair plots for data visualization","Common pair plot mistakes and how to avoid them"],competencyRequired:"Basic understanding of scatter plots and distributions",timeRequired:"PT11M",isAccessibleForFree:!0,audience:{"@type":"EducationalAudience",educationalRole:"student"},about:{"@id":`${r}/pair-plot/#term`},keywords:["pair plot","scatterplot matrix","SPLOM","data visualization","multivariate EDA"]},{"@type":"DefinedTerm","@id":`${r}/pair-plot/#term`,name:"Pair Plot",description:"A matrix of small scatter plots showing every pairwise combination of variables in a dataset, with univariate distributions along the diagonal.",inDefinedTermSet:{"@id":`${r}/chart-types/#termset`},termCode:"pair-plot",url:`${r}/pair-plot`,sameAs:"https://en.wikipedia.org/wiki/Scatter_plot#Scatter_plot_matrices"},{"@type":"DefinedTermSet","@id":`${r}/chart-types/#termset`,name:"Data Visualization Chart Types",url:`${r}/chart-types`},d("/pair-plot"),h]},f=[{id:"the-chart",label:"The chart"},{id:"what-is-it",label:"What is it?"},{id:"anatomy",label:"Anatomy"},{id:"when-to-use",label:"When to use it"},{id:"how-to-read",label:"How to read it"},{id:"data-format",label:"Data format"},{id:"construction",label:"Construction"},{id:"common-mistakes",label:"Common mistakes"},{id:"real-world-examples",label:"Real-world examples"},{id:"key-facts",label:"Quick reference"},{id:"accessibility",label:"Accessibility"},{id:"variations",label:"Variations"},{id:"faqs",label:"FAQs"},{id:"related-charts",label:"Related charts"}];function j(){return e.jsxs(e.Fragment,{children:[e.jsx(s,{title:"Pair Plot: What It Is, How To Read & Examples",description:"Pair Plot reference: definition, when to use it, how to read it, real examples, common mistakes, and tools (Excel, Tableau, D3) to build one.",path:"/pair-plot",ogType:"article",jsonLd:[b]}),e.jsx(x,{slug:"/pair-plot"}),e.jsxs("div",{className:"max-w-[1100px] mx-auto px-6 md:px-12",children:[e.jsxs("div",{className:"py-[56px] pb-[48px] border-b border-[var(--border-color)]",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx("span",{className:"font-mono text-[10px] tracking-[0.12em] uppercase bg-[var(--accent-light)] text-[var(--accent-color)] px-[10px] py-[4px] rounded-[3px] font-medium",children:"Correlation"}),e.jsx("span",{className:"font-mono text-[10px] tracking-[0.10em] uppercase bg-[var(--bg-alt)] text-[var(--ink-muted)] px-[10px] py-[4px] rounded-[3px]",children:"Intermediate"})]}),e.jsx("h1",{className:"font-serif text-[42px] md:text-[52px] font-normal tracking-[-0.025em] leading-[1.1] text-[var(--ink)] mb-4",children:"Pair Plot"}),e.jsx("p",{className:"text-[17px] md:text-[19px] font-light text-[var(--ink-muted)] leading-[1.6] max-w-[640px]",children:"A grid of scatter plots for every variable combination, with distributions on the diagonal â the ultimate EDA tool for multivariate datasets."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_280px] gap-16 pt-12 items-start",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"the-chart",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 01 â The chart"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"What it looks like"}),e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[12px] p-6 md:p-10 mt-8 mb-2",children:[e.jsxs("div",{className:"font-mono text-[10px] tracking-[0.10em] uppercase text-[var(--ink-faint)] mb-6 flex justify-between items-center",children:[e.jsxs("span",{children:["Example â ",e.jsx("em",{className:"not-italic text-[var(--accent-color)] font-medium",children:"Iris dataset"})]}),e.jsx("span",{children:"3 variables à 3"})]}),e.jsxs("svg",{viewBox:"0 0 420 420",xmlns:"http://www.w3.org/2000/svg",className:"w-full block max-w-[420px] mx-auto",children:[e.jsx("text",{x:"70",y:"16",textAnchor:"middle",fill:"#6b6b67",fontSize:"9",fontFamily:"DM Mono, monospace",children:"Sepal len"}),e.jsx("text",{x:"210",y:"16",textAnchor:"middle",fill:"#6b6b67",fontSize:"9",fontFamily:"DM Mono, monospace",children:"Petal len"}),e.jsx("text",{x:"350",y:"16",textAnchor:"middle",fill:"#6b6b67",fontSize:"9",fontFamily:"DM Mono, monospace",children:"Petal wid"}),e.jsx("rect",{x:"20",y:"20",width:"120",height:"120",rx:"4",fill:"var(--bg-alt)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("path",{d:"M30,120 Q50,50 80,80 Q100,100 130,60",fill:"none",stroke:"#c94a2e",strokeWidth:"1.5"}),e.jsx("rect",{x:"150",y:"20",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"170",cy:"110",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"180",cy:"100",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"200",cy:"80",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"220",cy:"60",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"240",cy:"45",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"250",cy:"40",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"195",cy:"90",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"225",cy:"55",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"280",y:"20",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"300",cy:"115",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"320",cy:"95",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"340",cy:"70",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"360",cy:"50",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"375",cy:"40",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"330",cy:"85",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"350",cy:"60",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"20",y:"150",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"50",cy:"240",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"60",cy:"225",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"80",cy:"200",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"100",cy:"180",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"115",cy:"170",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"70",cy:"215",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"90",cy:"190",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"150",y:"150",width:"120",height:"120",rx:"4",fill:"var(--bg-alt)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("path",{d:"M160,250 Q180,160 220,180 Q250,190 260,170",fill:"none",stroke:"#c94a2e",strokeWidth:"1.5"}),e.jsx("rect",{x:"280",y:"150",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"300",cy:"250",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"320",cy:"220",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"350",cy:"190",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"370",cy:"170",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"385",cy:"165",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"335",cy:"210",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"20",y:"280",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"50",cy:"370",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"65",cy:"350",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"85",cy:"325",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"105",cy:"310",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"120",cy:"300",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"75",cy:"340",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"150",y:"280",width:"120",height:"120",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("circle",{cx:"170",cy:"380",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"195",cy:"345",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"220",cy:"320",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"245",cy:"300",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"255",cy:"295",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"205",cy:"335",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("rect",{x:"280",y:"280",width:"120",height:"120",rx:"4",fill:"var(--bg-alt)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("path",{d:"M290,380 Q320,300 360,310 Q380,320 390,295",fill:"none",stroke:"#c94a2e",strokeWidth:"1.5"})]}),e.jsx("p",{className:"text-[13px] text-[var(--ink-muted)] text-center italic mt-4",children:"A 3Ã3 pair plot of Iris measurements. Diagonal cells show distributions; off-diagonal cells show scatter plots for each pair."})]})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"what-is-it",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 02 â Definition"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"What is a pair plot?"}),e.jsxs("div",{className:"text-[16px] font-light text-[var(--ink)] leading-[1.75]",children:[e.jsxs("p",{children:["A pair plot (also called a scatterplot matrix or SPLOM) arranges scatter plots for every combination of variables in a grid. For ",e.jsx("em",{children:"n"})," variables, it creates an ",e.jsx("em",{children:"n à n"}
1)," matrix where each off-diagonal cell shows a scatter plot of two variables, and each diagonal cell shows a univariate distribution (typically a histogram or KDE)."]}),e.jsxs("p",{className:"mt-[18px]",children:["The pair plot is the ",e.jsx("strong",{className:"font-medium",children:"Swiss Army knife of exploratory data analysis (EDA)"}),". In a single view, it reveals correlations, clusters, outliers, and distribution shapes across all variables simultaneously."]}),e.jsx("p",{className:"mt-[18px]",children:"Unlike the correlogram (which reduces each relationship to a single number), the pair plot shows the actual data â non-linear relationships, clusters, and outliers are all visible."})]}),e.jsx("div",{className:"bg-[var(--accent-light)] border-l-[3px] border-l-[var(--accent-color)] rounded-r-[8px] px-5 py-4 mt-6",children:e.jsxs("p",{className:"text-[14px] text-[var(--ink)] leading-[1.65] font-light",children:[e.jsx("strong",{className:"font-medium text-[var(--accent-color)]",children:"Python users:"})," The pair plot was popularized by the ",e.jsx("code",{className:"font-mono text-[13px] bg-[var(--bg-alt)] px-1 rounded",children:"seaborn.pairplot()"})," function, which creates a complete SPLOM with one line of code. R users know it as ",e.jsx("code",{className:"font-mono text-[13px] bg-[var(--bg-alt)] px-1 rounded",children:"pairs()"})," or ",e.jsx("code",{className:"font-mono text-[13px] bg-[var(--bg-alt)] px-1 rounded",children:"GGally::ggpairs()"}),"."]})})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"anatomy",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 03 â Anatomy"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Parts of a pair plot"}),e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[12px] p-6 md:p-10 mt-8",children:[e.jsxs("svg",{viewBox:"0 0 380 280",xmlns:"http://www.w3.org/2000/svg",className:"w-full block max-w-[380px] mx-auto",children:[e.jsx("rect",{x:"30",y:"30",width:"100",height:"100",rx:"4",fill:"var(--bg-alt)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("rect",{x:"140",y:"30",width:"100",height:"100",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("rect",{x:"250",y:"30",width:"100",height:"100",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("rect",{x:"30",y:"140",width:"100",height:"100",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("rect",{x:"140",y:"140",width:"100",height:"100",rx:"4",fill:"var(--bg-alt)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("rect",{x:"250",y:"140",width:"100",height:"100",rx:"4",fill:"var(--bg-card)",stroke:"var(--border-color)",strokeWidth:"1"}),e.jsx("line",{x1:"15",y1:"80",x2:"25",y2:"80",stroke:"#2e7d52",strokeWidth:"1.2"}),e.jsx("circle",{cx:"12",cy:"80",r:"4",fill:"#2e7d52"}),e.jsx("text",{x:"6",y:"78",textAnchor:"end",fill:"#2e7d52",fontSize:"9",fontFamily:"DM Mono, monospace",children:"A"}),e.jsx("line",{x1:"80",y1:"80",x2:"80",y2:"50",stroke:"#c94a2e",strokeWidth:"1.2"}),e.jsx("circle",{cx:"80",cy:"48",r:"4",fill:"#c94a2e"}),e.jsx("text",{x:"80",y:"38",textAnchor:"middle",fill:"#c94a2e",fontSize:"9",fontFamily:"DM Mono, monospace",children:"B"}),e.jsx("circle",{cx:"160",cy:"100",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"175",cy:"80",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"195",cy:"60",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("circle",{cx:"215",cy:"50",r:"2.5",fill:"#c94a2e",opacity:"0.5"}),e.jsx("line",{x1:"190",y1:"80",x2:"210",y2:"50",stroke:"#6b6b67",strokeWidth:"1.2"}),e.jsx("circle",{cx:"212",cy:"46",r:"4",fill:"#6b6b67"}),e.jsx("text",{x:"225",y:"44",fill:"#6b6b67",fontSize:"9",fontFamily:"DM Mono, monospace",children:"C"}),e.jsx("path",{d:"M45,220 Q60,160 80,180 Q100,200 120,170",fill:"none",stroke:"#c94a2e",strokeWidth:"1.5"}),e.jsx("line",{x1:"75",y1:"195",x2:"15",y2:"210",stroke:"#6b6b67",strokeWidth:"1.2"}),e.jsx("circle",{cx:"12",cy:"212",r:"4",fill:"#6b6b67"}),e.jsx("text",{x:"6",y:"210",textAnchor:"end",fill:"#6b6b67",fontSize:"9",fontFamily:"DM Mono, monospace",children:"D"})]}),e.jsx("div",{className:"flex flex-wrap gap-3 mt-7",children:[{color:"#2e7d52",label:"A â Variable labels:",desc:"Each row and column corresponds to one variable in the dataset"},{color:"#c94a2e",label:"B â Diagonal cell:",desc:"Shows the univariate distribution (histogram or KDE) of each variable"},{color:"#6b6b67",label:"C â Off-diagonal cell:",desc:"A scatter plot showing the relationship between two variables"},{color:"#6b6b67",label:"D â Lower triangle:",desc:"Mirror of the upper triangle â some pair plots show different views (e.g., scatter below, correlation above)"}].map((a,t)=>e.jsxs("div",{className:"flex items-center gap-2 bg-[var(--bg-alt)] rounded-[4px] px-[14px] py-2 text-[13px]",children:[e.jsx("span",{className:"w-[10px] h-[10px] rounded-full shrink-0",style:{background:a.color}}),e.jsxs("span",{className:"text-[var(--ink-muted)]",children:[e.jsx("strong",{className:"text-[var(--ink)] font-medium",children:a.label})," ",a.desc]})]},t))})]})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"when-to-use",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 04 â Usage"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"When to use it â and when not to"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5 mt-7",children:[e.jsxs("div",{className:"bg-[var(--green-light)] border border-[var(--green-border)] rounded-[10px] p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 font-medium text-[14px] text-[var(--green)] mb-4",children:[e.jsx("span",{className:"w-[22px] h-[22px] rounded-full bg-[var(--green)] text-white flex items-center justify-center text-[12px] shrink-0",children:"✓"}),"Use a pair plot whenâ¦"]}),e.jsx("ul",{className:"flex flex-col gap-[10px] list-none",children:["You want to see all pairwise relationships in a multivariate dataset","Performing EDA before building a model","Looking for non-linear relationships that a correlogram would miss","Color-coding by a categorical variable to find cluster separability","You have 3â10 numeric variables to compare","Checking for outliers across multiple dimensions simultaneously"].map((a,t)=>e.jsx("li",{className:"text-[14px] text-[var(--ink)] leading-[1.5] pl-4 relative font-light before:content-['â'] before:absolute before:left-0 before:text-[var(--ink-faint)]",children:a},t))})]}),e.jsxs("div",{className:"bg-[var(--red-light)] border border-[var(--red-border)] rounded-[10px] p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 font-medium text-[14px] text-[var(--red)] mb-4",children:[e.jsx("span",{className:"w-[22px] h-[22px] rounded-full bg-[var(--red)] text-white flex items-center justify-center text-[12px] shrink-0",children:"Ã"}),"Avoid a pair plot whenâ¦"]}),e.jsx("ul",{className:"flex flex-col gap-[10px] list-none",children:["You have more than 10â12 variables â the grid becomes impossibly small","Your dataset has millions of rows â each scatter plot will be overplotted","You only need one specific pair â make a full-size scatter plot instead","The audience isnât familiar with interpreting multiple small charts","Your variables are mostly categorical â use contingency tables","You need precise numeric summaries â a correlogram is more compact"].map((a,t)=>e.jsx("li",{className:"text-[14px] text-[var(--ink)] leading-[1.5] pl-4 relative font-light before:content-['â'] before:absolute before:left-0 before:text-[var(--ink-faint)]",children:a},t))})]})]})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"how-to-read",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 05 â Reading guide"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"How to read a pair plot"}),e.jsx("p",{className:"text-[16px] font-light text-[var(--ink)] leading-[1.75]",children:"Follow these steps whenever you encounter a pair plot."}),e.jsx("div",{className:"flex flex-col gap-5 mt-7",children:[{num:"1",title:"Read the diagonal first",desc:"Each diagonal cell shows the distribution of one variable. Are they symmetric? Skewed? Bimodal? This tells you about each variable independently."},{num:"2",title:"Scan for strong correlations",desc:"Look at off-diagonal cells for tight, elongated point clouds. A thin, diagonal band of points means strong correlation; a round cloud means weak or no correlation."}
1,{num:"3",title:"Look for clusters",desc:"If points naturally group into separate clouds (especially when color-coded), it suggests natural groupings in the data."},{num:"4",title:"Check for non-linear patterns",desc:"Curved scatter plots reveal relationships that correlation coefficients miss â parabolas, thresholds, or logarithmic curves."},{num:"5",title:"Identify outliers",desc:"Points far from the main cloud in any cell are potential outliers. Check if theyâre outliers in multiple variable pairs."}].map(a=>e.jsxs("div",{className:"flex gap-5",children:[e.jsx("div",{className:"w-[40px] h-[40px] rounded-full bg-[var(--accent-light)] text-[var(--accent-color)] flex items-center justify-center font-mono text-[14px] font-medium shrink-0",children:a.num}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:a.title}),e.jsx("p",{className:"text-[14px] font-light text-[var(--ink-muted)] leading-[1.6]",children:a.desc})]})]},a.num))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"data-format",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 06 â Data format"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"What your data should look like"}),e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-5 mt-6 font-mono text-[13px] text-[var(--ink-muted)] leading-[1.8] overflow-x-auto",children:[e.jsx("p",{className:"text-[var(--accent-color)]",children:"// Tidy table â each column is a variable"}),e.jsx("p",{children:"| sepal_len | petal_len | petal_wid | species   |"}),e.jsx("p",{children:"|-----------|-----------|-----------|-----------|"}),e.jsx("p",{children:"| 5.1       | 1.4       | 0.2       | setosa    |"}),e.jsx("p",{children:"| 7.0       | 4.7       | 1.4       | versicolor|"})]})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"construction",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 07 â Construction"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"How to build one"}),e.jsx("div",{className:"flex flex-col gap-5 mt-4",children:[{step:"1",text:"Select 3â10 numeric variables from your dataset."},{step:"2",text:"Create an nÃn grid of subplot panels."},{step:"3",text:"For each diagonal cell (i, i), plot the distribution of variable i (histogram, KDE, or rug plot)."},{step:"4",text:"For each off-diagonal cell (i, j), plot a scatter plot with variable j on X and variable i on Y."},{step:"5",text:"Optionally color-code points by a categorical variable and add a shared legend."}].map(a=>e.jsxs("div",{className:"flex gap-4 items-start",children:[e.jsxs("span",{className:"font-mono text-[13px] text-[var(--accent-color)] font-medium shrink-0 mt-[2px]",children:[a.step,"."]}),e.jsx("p",{className:"text-[15px] font-light text-[var(--ink)] leading-[1.7]",children:a.text})]},a.step))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"common-mistakes",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 08 â Pitfalls"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Common mistakes"}),e.jsx("div",{className:"flex flex-col gap-5 mt-4",children:[{title:"Too many variables",desc:"A 15Ã15 pair plot has 225 panels â each one is too small to read. Limit to 8â10 variables maximum."},{title:"Overplotted scatter panels",desc:"With large datasets, individual points overlap into solid blobs. Use transparency, subsampling, or switch to hexbin/contour in each panel."},{title:"Ignoring the diagonal",desc:"The distributions along the diagonal contain crucial information about skewness, bimodality, and outliers. Donât skip them."},{title:"Missing group coloring",desc:"If your data has a categorical variable (species, class, group), color-coding points reveals cluster separation across all pairs."},{title:"Inconsistent axis scales",desc:"Each panel should use consistent scales for comparison across rows and columns. Some tools handle this automatically; check yours."}].map((a,t)=>e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-5",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:a.title}),e.jsx("p",{className:"text-[14px] font-light text-[var(--ink-muted)] leading-[1.6]",children:a.desc})]},t))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"real-world-examples",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 09 â In the wild"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Real-world examples"}),e.jsx("div",{className:"flex flex-col gap-5 mt-4",children:[{context:"Machine learning",example:"Data scientists use pair plots as the first step in feature engineering â identifying which features correlate, which separate classes, and which need transformation."},{context:"Biomedical research",example:"Clinicians use pair plots to visualize patient biomarkers (blood pressure, cholesterol, BMI, glucose) and identify risk profiles across multiple health indicators."},{context:"Quality control",example:"Manufacturing engineers plot multiple process parameters simultaneously to detect when two variables drift together â a sign of systemic process changes."}].map((a,t)=>e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-5",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.10em] uppercase text-[var(--accent-color)] mb-2",children:a.context}),e.jsx("p",{className:"text-[14px] font-light text-[var(--ink)] leading-[1.65]",children:a.example})]},t))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"key-facts",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 10 â At a glance"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Qu
1ick reference"}),e.jsx("div",{className:"grid grid-cols-2 gap-[1px] bg-[var(--border-color)] rounded-[10px] overflow-hidden mt-6",children:[{label:"Also known as",value:"Scatterplot matrix, SPLOM"},{label:"Category",value:"Correlation / EDA"},{label:"Typical data",value:"3â10 numeric variables"},{label:"Best for",value:"Multivariate exploration"},{label:"Difficulty",value:"Intermediate"},{label:"Tools",value:"seaborn.pairplot(), GGally::ggpairs()"}].map((a,t)=>e.jsxs("div",{className:"bg-[var(--bg-card)] p-4",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.10em] uppercase text-[var(--ink-faint)] mb-1",children:a.label}),e.jsx("p",{className:"text-[14px] text-[var(--ink)] font-light",children:a.value})]},t))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"accessibility",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 11 â Accessibility"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Making it accessible"}),e.jsx("div",{className:"flex flex-col gap-4 mt-4",children:["Use colorblind-safe palettes when coloring by group","Ensure axis labels are readable even at small panel sizes","Provide a text summary of key relationships for screen readers","Use shapes (circle, triangle, square) in addition to color for group coding","Consider large-format printing or zoomed panels for presentations"].map((a,t)=>e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full bg-[var(--accent-color)] mt-[8px] shrink-0"}),e.jsx("p",{className:"text-[14px] font-light text-[var(--ink)] leading-[1.6]",children:a})]},t))})]}),e.jsxs("section",{className:"py-14 border-b border-[var(--border-color)]",id:"variations",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 12 â Variations"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Common variations"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5 mt-6",children:[{name:"Generalized pair plot",desc:"Shows different views in upper vs lower triangle â e.g., scatter below, correlation value above, KDE on diagonal."},{name:"Hexbin pair plot",desc:"Replaces scatter plots with hexbin plots in each panel for large datasets."},{name:"Regression pair plot",desc:"Adds fitted regression lines to each scatter panel for quick trend assessment."},{name:"Interactive pair plot",desc:"Brushing a region in one panel highlights the same observations in all other panels."}].map((a,t)=>e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-5",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:a.name}),e.jsx("p",{className:"text-[13px] font-light text-[var(--ink-muted)] leading-[1.5]",children:a.desc})]},t))})]}),e.jsx(p,{faqs:o,sectionNumber:13}),e.jsxs("section",{className:"py-14",id:"related-charts",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--accent-color)] mb-3",children:"// 14 â Related"}),e.jsx("h2",{className:"font-serif text-[28px] md:text-[30px] font-normal tracking-[-0.02em] text-[var(--ink)] mb-6 leading-[1.2]",children:"Related charts"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mt-6",children:[e.jsxs(i,{href:"/correlogram",className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-6 px-5 cursor-pointer hover:border-[var(--accent-border-hover)] hover:-translate-y-[2px] hover:shadow-[var(--shadow-card)] transition-all duration-150 no-underline text-[var(--ink)]",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:"Correlogram"}),e.jsx("p",{className:"text-[13px] font-light text-[var(--ink-muted)] leading-[1.5]",children:"Reduces each pair to a single correlation number â more compact but loses non-linear detail."})]}),e.jsxs(i,{href:"/scatter-plot",className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-6 px-5 cursor-pointer hover:border-[var(--accent-border-hover)] hover:-translate-y-[2px] hover:shadow-[var(--shadow-card)] transition-all duration-150 no-underline text-[var(--ink)]",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:"Scatter Plot"}),e.jsx("p",{className:"text-[13px] font-light text-[var(--ink-muted)] leading-[1.5]",children:"A single full-size version of one pair â use for detailed investigation of specific variable pairs."})]}),e.jsxs(i,{href:"/small-multiples",className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-6 px-5 cursor-pointer hover:border-[var(--accent-border-hover)] hover:-translate-y-[2px] hover:shadow-[var(--shadow-card)] transition-all duration-150 no-underline text-[var(--ink)]",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:"Small Multiples"}),e.jsx("p",{className:"text-[13px] font-light text-[var(--ink-muted)] leading-[1.5]",children:"The general pattern of repeating a chart layout across panels â pair plots are a specialized form."})]}),e.jsxs(i,{href:"/contour-plot",className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] p-6 px-5 cursor-pointer hover:border-[var(--accent-border-hover)] hover:-translate-y-[2px] hover:shadow-[var(--shadow-card)] transition-all duration-150 no-underline text-[var(--ink)]",children:[e.jsx("p",{className:"text-[15px] font-medium text-[var(--ink)] mb-1",children:"Contour Plot"}),e.jsx("p",{className:"text-[13px] font-light text-[var(--ink-muted)] leading-[1.5]",children:"Can replace scatter plots in each panel for smoother density visualization with large datasets."})]})]})]})]}),e.jsxs("aside",{className:"hidden md:block self-start sticky top-[80px]",children:[e.jsx("p",{className:"font-mono text-[10px] tracking-[0.14em] uppercase text-[var(--ink-faint)] mb-4",children:"On this page"}),e.jsx("nav",{className:"flex flex-col gap-[6px]",children:f.map(a=>e.jsx("a",{href:`#${a.id}`,className:"text-[13px] text-[var(--ink-muted)] no-underline hover:text-[var(--accent-color)] transition-colors duration-150",children:a.label},a.id))}),e.jsxs("div",{className:"mt-8 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] overflow-hidden mb-5",children:[e.jsx("div",{className:"bg-[var(--ink)] px-[18px] py-[14px] font-mono text-[10px] tracking-[0.12em] uppercase text-[var(--white-muted)]",children:"// Tags"}),e.jsx("div",{className:"px-[18px] py-4",children:e.jsx("div",{className:"flex flex-wrap gap-[6px]",children:["Correlation","EDA","Multivariate","Intermediate","Matrix","Scatter"].map(a=>e.jsx("span",{className:"font-mono text-[10px] tracking-[0.06em] uppercase bg-[var(--bg-alt)] text-[var(--ink-muted)] px-[10px] py-1 rounded-[3px]",children:a},a))})})]}),e.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[10px] overflow-hidden mb-5",children:[e.jsx("div",{className:"bg-[var(--ink)] px-[18px] py-[14px] font-mono text-[10px] tracking-[0.12em] uppercase text-[var(--white-muted)]",children:"// Similar charts"}),e.jsx("div",{className:"py-1",children:["Correlogram","Scatter plot","Small multiples","Contour plot","Hexbin plot"].map((a,t,l)=>e.jsxs("span",{className:`flex items-center justify-between px-[18px] py-3 text-[13px] text-[var(--ink-muted)] hover:text-[var(--accent-color)] transition-colors duration-150 cursor-pointer ${t<l.length-1?"border-b border-[var(--border-color)]":""}`,children:[a," ",e.jsx("span",{children:"â"})]},a))})]})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border-color)] bg-[var(--bg-card)] px-6 md:px-12 py-5 flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-8",children:e.jsxs(i,{href:"/contour-plot",className:"text-[13px] text-[var(--ink-muted)] no-underline flex items-center gap-[6px] hover:text-[var(--ink)] transition-colors duration-150",children:[e.jsx("span",{className:"text-[var(--accent-color)]",children:"â"})," Previous: Contour plot"]})}),e.jsx("span",{className:"font-mono text-[11px] text-[var(--ink-faint)] hidden md:block",children:"Correlation charts"}),e.jsx("div",{className:"flex gap-8",children:e.jsxs(i,{href:"/solar-correlation-map",className:"text-[13px] text-[var(--ink-muted)] no-underline flex items-center gap-[6px] hover:text-[var(--ink)] transition-colors duration-150",children:["Next: Solar correlation map ",e.jsx("span",{className:"text-[var(--accent-color)]",children:"â"})]})})]})]})}export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.