[{"data":1,"prerenderedAt":553},["ShallowReactive",2],{"content-query-r5f2MvkGWp":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"heading":10,"prompt":11,"tags":15,"files":18,"nav":6,"presets":19,"gallery":37,"body":39,"_type":546,"_id":547,"_source":548,"_file":549,"_stem":550,"_extension":551,"sitemap":552},"/tools/ridgeline-plot","tools",false,"","Ridgeline Plot Generator for Excel & CSV","Create ridgeline plots online from Excel and CSV data. Compare many distributions across groups or time periods with AI.","Ridgeline Plot Generator",{"prefix":12,"label":13,"placeholder":14},"Create a ridgeline plot","Describe the ridgeline plot you want to create","e.g. ridgeline plot of temperature anomaly by decade, color from blue to red",[16,17],"charts","statistics",true,[20,26,31],{"label":21,"prompt":22,"dataset_url":23,"dataset_title":24,"dataset_citation":25},"Temperature anomaly by decade","ridgeline plot of annual temperature anomaly distribution by decade from the 1880s to 2020s; color curves from cool blue (early decades) to warm red (recent); show the rightward shift over time","https://ourworldindata.org/grapher/temperature-anomaly.csv","Annual surface temperature change","Our World in Data",{"label":27,"prompt":28,"dataset_url":29,"dataset_title":30,"dataset_citation":25},"Life expectancy by region over time","ridgeline plot of life expectancy distribution by world region; one ridge per region sorted by median; color each region differently; show how distributions differ in width and center","https://ourworldindata.org/grapher/life-expectancy.csv","Life expectancy",{"label":32,"prompt":33,"dataset_url":34,"dataset_title":35,"dataset_citation":36},"GDP per capita by income group","ridgeline plot of log GDP per capita distribution by World Bank income group; log scale on x-axis; color from light (low income) to dark (high income); label each ridge","https://api.worldbank.org/v2/en/indicator/NY.GDP.PCAP.CD?downloadformat=excel","GDP per capita (current US$)","World Bank",[38],"/img/tools/ridgeline-plot.png",{"type":40,"children":41,"toc":537},"root",[42,51,72,84,96,102,168,174,314,320,428,434,463,469,479,496,506],{"type":43,"tag":44,"props":45,"children":47},"element","h2",{"id":46},"what-is-a-ridgeline-plot",[48],{"type":49,"value":50},"text","What Is a Ridgeline Plot?",{"type":43,"tag":52,"props":53,"children":54},"p",{},[55,57,63,65,70],{"type":49,"value":56},"A ",{"type":43,"tag":58,"props":59,"children":60},"strong",{},[61],{"type":49,"value":62},"ridgeline plot",{"type":49,"value":64}," (also called a joy plot or joyplot) displays the ",{"type":43,"tag":58,"props":66,"children":67},{},[68],{"type":49,"value":69},"distribution of a numeric variable across many groups",{"type":49,"value":71}," as a series of overlapping kernel density estimate (KDE) curves, stacked vertically — one per group. Each curve sits on its own baseline, slightly offset upward from the one below, creating a layered \"ridge\" appearance. The overlap between adjacent curves can be adjusted: more overlap saves vertical space but requires careful color choice to keep curves distinguishable.",{"type":43,"tag":52,"props":73,"children":74},{},[75,77,82],{"type":49,"value":76},"The chart's signature strength is showing ",{"type":43,"tag":58,"props":78,"children":79},{},[80],{"type":49,"value":81},"how a distribution shifts across a categorical dimension",{"type":49,"value":83}," — especially when that dimension has a natural order (years, decades, age groups, income bands). A classic use is climate science: plotting the distribution of annual temperature anomalies by decade, where the entire distribution visibly shifts rightward over time. Other applications include music streaming (distribution of song plays by genre), finance (return distributions by asset class across years), and medicine (biomarker distributions by age group across a study cohort).",{"type":43,"tag":52,"props":85,"children":86},{},[87,89,94],{"type":49,"value":88},"Ridgeline plots outperform both histograms and box plots when you have ",{"type":43,"tag":58,"props":90,"children":91},{},[92],{"type":49,"value":93},"10 or more groups",{"type":49,"value":95}," to compare: a box plot grid becomes hard to scan, and overlapping histograms turn into noise. The ridgeline plot keeps each group's shape legible while still allowing comparison across the full stack at a glance.",{"type":43,"tag":44,"props":97,"children":99},{"id":98},"how-it-works",[100],{"type":49,"value":101},"How It Works",{"type":43,"tag":103,"props":104,"children":105},"ol",{},[106,117,133],{"type":43,"tag":107,"props":108,"children":109},"li",{},[110,115],{"type":43,"tag":58,"props":111,"children":112},{},[113],{"type":49,"value":114},"Upload your data",{"type":49,"value":116}," — provide a CSV or Excel file with at least one numeric column (the variable to distribute) and one categorical or ordinal column (the grouping variable). Long format works best: one row per observation.",{"type":43,"tag":107,"props":118,"children":119},{},[120,125,127],{"type":43,"tag":58,"props":121,"children":122},{},[123],{"type":49,"value":124},"Describe the plot",{"type":49,"value":126}," — e.g. ",{"type":43,"tag":128,"props":129,"children":130},"em",{},[131],{"type":49,"value":132},"\"ridgeline plot of salary by department, color from lightest (lowest median) to darkest, sort ridges by median\"",{"type":43,"tag":107,"props":134,"children":135},{},[136,141,143,150,152,158,160,166],{"type":43,"tag":58,"props":137,"children":138},{},[139],{"type":49,"value":140},"Get the visualization",{"type":49,"value":142}," — the AI writes Python code using ",{"type":43,"tag":144,"props":145,"children":147},"a",{"href":146},"https://plotly.com/python/",[148],{"type":49,"value":149},"Plotly",{"type":49,"value":151}," or ",{"type":43,"tag":144,"props":153,"children":155},{"href":154},"https://matplotlib.org/",[156],{"type":49,"value":157},"matplotlib",{"type":49,"value":159}," with ",{"type":43,"tag":144,"props":161,"children":163},{"href":162},"https://docs.scipy.org/doc/scipy/",[164],{"type":49,"value":165},"scipy",{"type":49,"value":167}," KDE to build the stacked offset curves",{"type":43,"tag":44,"props":169,"children":171},{"id":170},"interpreting-the-results",[172],{"type":49,"value":173},"Interpreting the Results",{"type":43,"tag":175,"props":176,"children":177},"table",{},[178,197],{"type":43,"tag":179,"props":180,"children":181},"thead",{},[182],{"type":43,"tag":183,"props":184,"children":185},"tr",{},[186,192],{"type":43,"tag":187,"props":188,"children":189},"th",{},[190],{"type":49,"value":191},"Visual element",{"type":43,"tag":187,"props":193,"children":194},{},[195],{"type":49,"value":196},"What it means",{"type":43,"tag":198,"props":199,"children":200},"tbody",{},[201,218,234,250,266,282,298],{"type":43,"tag":183,"props":202,"children":203},{},[204,213],{"type":43,"tag":205,"props":206,"children":207},"td",{},[208],{"type":43,"tag":58,"props":209,"children":210},{},[211],{"type":49,"value":212},"Peak of a ridge",{"type":43,"tag":205,"props":214,"children":215},{},[216],{"type":49,"value":217},"Mode — the most common value for that group",{"type":43,"tag":183,"props":219,"children":220},{},[221,229],{"type":43,"tag":205,"props":222,"children":223},{},[224],{"type":43,"tag":58,"props":225,"children":226},{},[227],{"type":49,"value":228},"Width of a ridge",{"type":43,"tag":205,"props":230,"children":231},{},[232],{"type":49,"value":233},"Spread — wide = high variance, narrow = concentrated",{"type":43,"tag":183,"props":235,"children":236},{},[237,245],{"type":43,"tag":205,"props":238,"children":239},{},[240],{"type":43,"tag":58,"props":241,"children":242},{},[243],{"type":49,"value":244},"Horizontal position of peak",{"type":43,"tag":205,"props":246,"children":247},{},[248],{"type":49,"value":249},"Central tendency of that group",{"type":43,"tag":183,"props":251,"children":252},{},[253,261],{"type":43,"tag":205,"props":254,"children":255},{},[256],{"type":43,"tag":58,"props":257,"children":258},{},[259],{"type":49,"value":260},"Shift between adjacent ridges",{"type":43,"tag":205,"props":262,"children":263},{},[264],{"type":49,"value":265},"Change in the distribution from one group to the next",{"type":43,"tag":183,"props":267,"children":268},{},[269,277],{"type":43,"tag":205,"props":270,"children":271},{},[272],{"type":43,"tag":58,"props":273,"children":274},{},[275],{"type":49,"value":276},"Overlap between ridges",{"type":43,"tag":205,"props":278,"children":279},{},[280],{"type":49,"value":281},"Similarity between adjacent groups — heavy overlap = similar distributions",{"type":43,"tag":183,"props":283,"children":284},{},[285,293],{"type":43,"tag":205,"props":286,"children":287},{},[288],{"type":43,"tag":58,"props":289,"children":290},{},[291],{"type":49,"value":292},"Tail extending right",{"type":43,"tag":205,"props":294,"children":295},{},[296],{"type":49,"value":297},"Right-skewed distribution — a few very high values pull the mean up",{"type":43,"tag":183,"props":299,"children":300},{},[301,309],{"type":43,"tag":205,"props":302,"children":303},{},[304],{"type":43,"tag":58,"props":305,"children":306},{},[307],{"type":49,"value":308},"Bimodal bump",{"type":43,"tag":205,"props":310,"children":311},{},[312],{"type":49,"value":313},"Two sub-populations within the group",{"type":43,"tag":44,"props":315,"children":317},{"id":316},"example-prompts",[318],{"type":49,"value":319},"Example Prompts",{"type":43,"tag":175,"props":321,"children":322},{},[323,339],{"type":43,"tag":179,"props":324,"children":325},{},[326],{"type":43,"tag":183,"props":327,"children":328},{},[329,334],{"type":43,"tag":187,"props":330,"children":331},{},[332],{"type":49,"value":333},"Scenario",{"type":43,"tag":187,"props":335,"children":336},{},[337],{"type":49,"value":338},"What to type",{"type":43,"tag":198,"props":340,"children":341},{},[342,360,377,394,411],{"type":43,"tag":183,"props":343,"children":344},{},[345,350],{"type":43,"tag":205,"props":346,"children":347},{},[348],{"type":49,"value":349},"Climate change",{"type":43,"tag":205,"props":351,"children":352},{},[353],{"type":43,"tag":354,"props":355,"children":357},"code",{"className":356},[],[358],{"type":49,"value":359},"ridgeline plot of temperature anomaly by decade, blue to red gradient, sorted chronologically",{"type":43,"tag":183,"props":361,"children":362},{},[363,368],{"type":43,"tag":205,"props":364,"children":365},{},[366],{"type":49,"value":367},"Income inequality",{"type":43,"tag":205,"props":369,"children":370},{},[371],{"type":43,"tag":354,"props":372,"children":374},{"className":373},[],[375],{"type":49,"value":376},"ridgeline plot of log income by country income group, 4 groups, color by group",{"type":43,"tag":183,"props":378,"children":379},{},[380,385],{"type":43,"tag":205,"props":381,"children":382},{},[383],{"type":49,"value":384},"Music streaming",{"type":43,"tag":205,"props":386,"children":387},{},[388],{"type":43,"tag":354,"props":389,"children":391},{"className":390},[],[392],{"type":49,"value":393},"ridgeline plot of daily plays by genre, sort by median plays, show top 12 genres",{"type":43,"tag":183,"props":395,"children":396},{},[397,402],{"type":43,"tag":205,"props":398,"children":399},{},[400],{"type":49,"value":401},"Hospital data",{"type":43,"tag":205,"props":403,"children":404},{},[405],{"type":43,"tag":354,"props":406,"children":408},{"className":407},[],[409],{"type":49,"value":410},"ridgeline plot of patient length of stay by diagnosis group, log x-axis",{"type":43,"tag":183,"props":412,"children":413},{},[414,419],{"type":43,"tag":205,"props":415,"children":416},{},[417],{"type":49,"value":418},"Survey responses",{"type":43,"tag":205,"props":420,"children":421},{},[422],{"type":43,"tag":354,"props":423,"children":425},{"className":424},[],[426],{"type":49,"value":427},"ridgeline plot of satisfaction score by department, sorted by mean score",{"type":43,"tag":44,"props":429,"children":431},{"id":430},"related-tools",[432],{"type":49,"value":433},"Related Tools",{"type":43,"tag":52,"props":435,"children":436},{},[437,439,445,447,453,455,461],{"type":49,"value":438},"Use the ",{"type":43,"tag":144,"props":440,"children":442},{"href":441},"/tools/ai-violin-plot",[443],{"type":49,"value":444},"AI Violin Plot Generator",{"type":49,"value":446}," when you have fewer groups (2–8) and want to show both the distribution shape and a summary box plot side by side. Use the ",{"type":43,"tag":144,"props":448,"children":450},{"href":449},"/tools/ai-histogram-generator",[451],{"type":49,"value":452},"AI Histogram Generator",{"type":49,"value":454}," to examine a single group's distribution in detail. Use the ",{"type":43,"tag":144,"props":456,"children":458},{"href":457},"/tools/ai-box-plot",[459],{"type":49,"value":460},"AI Box Plot Generator",{"type":49,"value":462}," when you need to compare many groups by summary statistics (median, IQR, outliers) rather than full shape.",{"type":43,"tag":44,"props":464,"children":466},{"id":465},"frequently-asked-questions",[467],{"type":49,"value":468},"Frequently Asked Questions",{"type":43,"tag":52,"props":470,"children":471},{},[472,477],{"type":43,"tag":58,"props":473,"children":474},{},[475],{"type":49,"value":476},"How many groups can I compare with a ridgeline plot?",{"type":49,"value":478},"\nRidgeline plots work well with roughly 5–30 groups. Fewer than 5 groups are better served by a violin or box plot; more than 30 groups make the stack too tall to read comfortably. For very many groups, ask the AI to filter to the most interesting subset or to facet the ridgelines into multiple panels.",{"type":43,"tag":52,"props":480,"children":481},{},[482,487,489,494],{"type":43,"tag":58,"props":483,"children":484},{},[485],{"type":49,"value":486},"How do I control the amount of overlap between ridges?",{"type":49,"value":488},"\nInclude \"more overlap\" or \"less overlap\" in your prompt, or specify a numeric value: ",{"type":43,"tag":128,"props":490,"children":491},{},[492],{"type":49,"value":493},"\"overlap factor 0.8\"",{"type":49,"value":495},". More overlap is visually dramatic but requires careful coloring; less overlap is safer and easier to read if groups have similar distributions.",{"type":43,"tag":52,"props":497,"children":498},{},[499,504],{"type":43,"tag":58,"props":500,"children":501},{},[502],{"type":49,"value":503},"What's the difference between a ridgeline plot and stacked area chart?",{"type":49,"value":505},"\nA stacked area chart shows cumulative totals over a continuous axis (e.g. time). A ridgeline plot shows independent distributions per group — each curve is a KDE of the raw data, not a cumulative sum. They look similar but convey completely different things.",{"type":43,"tag":52,"props":507,"children":508},{},[509,514,516,521,523,528,530,535],{"type":43,"tag":58,"props":510,"children":511},{},[512],{"type":49,"value":513},"Can I sort the ridges by a statistic rather than alphabetically?",{"type":49,"value":515},"\nYes — ask to ",{"type":43,"tag":128,"props":517,"children":518},{},[519],{"type":49,"value":520},"\"sort ridges by median\"",{"type":49,"value":522},", ",{"type":43,"tag":128,"props":524,"children":525},{},[526],{"type":49,"value":527},"\"sort by mean\"",{"type":49,"value":529},", or ",{"type":43,"tag":128,"props":531,"children":532},{},[533],{"type":49,"value":534},"\"sort by variance\"",{"type":49,"value":536},". The AI will reorder the groups along the y-axis accordingly, which often reveals a meaningful gradient in the data.",{"title":7,"searchDepth":538,"depth":538,"links":539},2,[540,541,542,543,544,545],{"id":46,"depth":538,"text":50},{"id":98,"depth":538,"text":101},{"id":170,"depth":538,"text":173},{"id":316,"depth":538,"text":319},{"id":430,"depth":538,"text":433},{"id":465,"depth":538,"text":468},"markdown","content:tools:016.ridgeline-plot.md","content","tools/016.ridgeline-plot.md","tools/016.ridgeline-plot","md",{"loc":4},1775502471196]