{"id":704,"date":"2024-01-10T07:45:37","date_gmt":"2024-01-10T12:45:37","guid":{"rendered":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/?p=704"},"modified":"2026-01-30T11:45:42","modified_gmt":"2026-01-30T16:45:42","slug":"creating-ridgeline-plots-from-pulsars-to-pop-culture","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/2024\/01\/10\/creating-ridgeline-plots-from-pulsars-to-pop-culture\/","title":{"rendered":"Creating Ridgeline Plots: From Pulsars To Pop Culture"},"content":{"rendered":"<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">\n<p><a href=\"https:\/\/matlab.mathworks.com\/open\/github\/v1?repo=MATLAB-Graphics-and-App-Building\/matlab-gaab-blog-2024&amp;file=RidgelinePlotsJoyDivision\/RidgelinePlots_JoyDivision.mlx\" target=\"_blank\" rel=\"nofollow noopener\"><img decoding=\"async\" class=\"\" src=\"https:\/\/www.mathworks.com\/images\/responsive\/global\/open-in-matlab-online.svg\" alt=\"Open in MATLAB Online\" \/><\/a><\/p>\n<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">In 1979, an English rock band produced what Rolling Stone would describe as <span style=\"font-style: italic\">one of the best albums of all time<\/span> with an album cover that would become iconic in data visualization. Joy Division's album <a href=\"https:\/\/wikipedia.org\/wiki\/Unknown_Pleasures\"><span style=\"font-style: italic;text-decoration: underline\">Unknown Pleasures<\/span><\/a> (1979) features a stack of wavy lines that depict activity emanating from the first pulsar star discovered, PSR B1919+21. Starting with the death of a star, we'll look at the timeline of events that led to this pop culture classic and then we'll learn how to create ridgeline plots in 2D, 3D, and polar coordinates in MATLAB.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline;width: 550px;height: 412px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_1.png\" alt=\"\" width=\"550\" height=\"412\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\">Joy Division - Unknown Pleasures album cover.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><span style=\"font-style: italic\">Factory Records<\/span><\/div>\n<h2 id=\"H_007EE742\" style=\"margin: 20px 10px 5px 4px;padding: 0px;line-height: 20px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 20px;font-weight: bold;text-align: left\">The backstory<\/h2>\n<h3 id=\"H_5E8BF8C6\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">Collapse of a supergiant<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Millions of years ago a star within the Milky Way galaxy exploded into a supernova leaving behind an extremely compressed, densely packed neutron star with a diameter of about 19 km (12 mi) containing more than 466,000 times the mass of Earth. As a result of the quick collapse and extreme compression, the star\u2019s rotation accelerated in the same way an ice skater spins faster by pulling their arms toward their body. The star formed a magnetic field a quadrillion times stronger than Earth\u2019s with magnetic dipoles offset from its rotation axis. With every rotation of the star, every 1.337 seconds, a beam of electromagnetic radiation emitting from its magnetic poles sweeps across space at the speed of light like a lighthouse beacon waiting to be discovered.<\/div>\n<h3 id=\"H_3898E715\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">Discovery of a 1000-year-old signal<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">In 1967 Jocelyn Bell Burnell, a postgraduate student at the University of Cambridge, was studying radio signals from quasars using a custom-built radio telescope. The telescope happened to intercept pulsating beams of electromagnetic radiation that departed PSR B1919+21 one thousand years prior and the radiation happened to be within the radio frequency range of the telescope. As the radio waves reached the telescope\u2019s antennas, the signal was amplified and converted to a voltage signal that moved a pen along a continuously scrolling sheet of paper producing the <span style=\"font-style: italic\">strip chart<\/span> shown below. The power and regularity of this recurrent extraterrestrial signal with a fixed period of ~1.3 seconds seemed artificial at first, earning it the nickname <span style=\"font-style: italic\">LGM <\/span>(little green men), but it was soon realized that Bell and her team had discovered pulsar stars and the world had its first visualization of a pulsating neutron star.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline;width: 601px;height: 359px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_2.png\" alt=\"\" width=\"601\" height=\"359\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\">A strip chart showing the first confirmed observation of PSR B1919+21, initially named CP1919.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><span style=\"font-style: italic\">Churchill Archives Center and the Hewish family, ref. HWSH Acc 355<\/span>.<\/div>\n<h3 id=\"H_89C50151\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">A creative leap into digital data visualization<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Around the time Bell published her work (<a href=\"https:\/\/www.nature.com\/articles\/217709a0\"><span style=\"text-decoration: underline\">1968, Nature<\/span><\/a>), data visualization was entering the digital revolution. Harold Craft, Jr, a graduate student at Cornell University, set out to investigate whether there were patterns in the variation of pulsar waveforms. Craft recorded radio signals from PSR B1919+21 using the most sensitive radio telescope available at the time, located at the Arecibo Observatory in Puerto Rico. Rather than creating analog strip charts in real-time, the radio signals Craft recorded were digitized and stored to disk providing the flexibility to apply digital transformations to the data and to create visualizations that were not previously possible.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">To visually analyze the underlying structure of the pulsar\u2019s radio signal, Craft segmented the continuous radio signal into ~120 ms temporal windows centered at each pulse and plotted each segment as black lines in a vertical stack, bottom to top, at a fixed vertical interval. The proximity of the curves caused the lines from different segments to overlap making it difficult to distinguish between each segment of data, so Craft wrote a program to fill the area under each curve. This visualization is known today as a <span style=\"font-style: italic\">ridgeline plot<\/span> or a <span style=\"font-style: italic\">joyplot<\/span> (hmmm, I wonder why). Craft also considered plotting the filled curves in 3D by orienting each curve upward which, he noted, was aesthetically pleasing but unsuitable for visual analysis. Craft didn\u2019t find a pattern to the varying waveforms but published his findings, along with his ridgeline plots, in his PhD thesis (<a href=\"https:\/\/www.proquest.com\/openview\/27b1e7fe479f69693d29237b333ced3b\/\"><span style=\"text-decoration: underline\">Craft Jr, 1970<\/span><\/a>).<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline;width: 440px;height: 611px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_3.png\" alt=\"\" width=\"440\" height=\"611\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\">A photo of Craft's original ridgeline plot on pg. 215 of this thesis.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">I've created an animation that illustrates what makes a pulsar signal 'pulse', depicting the star's electromagnetic beacon sweeping across a receiver. The data used to produce the ridge lines are simulated with random variation that mimics the characteristics of real pulsar radio signals. The source of this variation, potentially interstellar plasma or solar wind, remains a topic of debate.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline;width: 640px;height: 448px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_4.gif\" alt=\"pulsarDemo.gif\" width=\"640\" height=\"448\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\">Animation of a pulsar star's electromagnetic signal.<\/div>\n<h3 id=\"H_32E588D1\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">A scintillating visualization gone viral<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Four months after Craft submitted his thesis, his ridgeline plot of PSR B1919+21 was published on a full page in Scientific American (<a href=\"https:\/\/www.scientificamerican.com\/article\/the-nature-of-pulsars\/\"><span style=\"text-decoration: underline\">1971<\/span><\/a>). It appeared again in 1974 in the book <span style=\"font-style: italic\">Graphis Diagrams: The Graphic Visualization of Abstract Data <\/span>with white lines against a black background and again in 1977 in the <span style=\"font-style: italic\">Cambridge Encyclopedia of Astronomy<\/span> in its original form, with black lines against a white background.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">A copy of the Cambridge Encyclopedia of Astronomy was at a cafe at the Manchester Central library where Joy Division\u2019s guitarist Bernard Sumner happened to be taking a work break. Sumner found the article and immediately felt a connection with the stacked wavy lines in Craft's ridgeline plot. He sent the image to Peter Saville, the graphics artist for the band\u2019s record label, who imprinted the lines in white against a black album cover with no other graphics or text.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Nearly immediately after the release of <span style=\"font-style: italic\">Unknown Pleasures <\/span>in 1979 the image acquired a cult following and continues to make its way through graphic designer and data visualization circles. It has appeared on t-shirts, knitted sweaters, leather jackets, other album art, Disney apparel, and tattoos. Versions of Craft\u2019s ridgeline plot have even appeared in MathWorks\u2019 <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/communitycontests\/contests\/4\/entries?entry_title=joy+division\"><span style=\"text-decoration: underline\">Mini Hack competition<\/span><\/a> and in the MATLAB Central <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/75147-joyplot-ridgeline-data-representation\"><span style=\"text-decoration: underline\">File Exchange<\/span><\/a>!<\/div>\n<h2 id=\"H_660B4CD3\" style=\"margin: 3px 10px 5px 4px;padding: 0px;line-height: 20px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 20px;font-weight: bold;text-align: left\">Creating ridgeline plots in MATLAB<\/h2>\n<h3 id=\"H_432762AF\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">Acquire the data<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">I couldn't track down Harold Craft, Jr.'s original PSR B1919+21 data. However, creative coder <a href=\"https:\/\/michaelzoellner.de\/\">Michael Zoellner<\/a> extracted the data from an svg image of the ridgeline plot. The data file, <span style=\"font-family: monospace\">pulsar.csv<\/span>, is available in a number of places (Mike Bostock's <a href=\"https:\/\/observablehq.com\/@mbostock\/psr-b1919-21\">blog<\/a>, Veli's <a href=\"https:\/\/observablehq.com\/@bagami\/psr-b1919-21-data-radial-display\">blog<\/a>, borgar's <a href=\"https:\/\/gist.github.com\/borgar\/31c1e476b8e92a11d7e9\">GitHub<\/a>). Since the data were extracted from an image without a y-axis, it is an approximation of the original data, and the scale is arbitrary.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">datasource = <span style=\"color: #a709f5\">'https:\/\/github.com\/MATLAB-Graphics-and-App-Building\/matlab-gaab-blog-2024\/raw\/3eb648f40f1ba8e5517138f34d23567ab3af6d29\/RidgelinePlotsJoyDivision\/pulsar.csv'<\/span>;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px 0px 4px 4px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">pulsardata = readmatrix(datasource).';<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">pulsar.csv contains an 80x300 matrix of values from 80 pulses with 300 samples each. I prefer working with data that are organized such that each column is a variable and each row is an observation or sample from that variable. I transpose the data to fit this description so that <span style=\"font-weight: bold;font-family: monospace\">pulsardata<\/span> has 80 columns, one for each pulse, and 300 rows, one for each sample. Column <span style=\"font-style: italic\">n<\/span> is data from the n<sup>th<\/sup> curve from the top of Craft's image.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">[nSamples,nPulses] = size(pulsardata)<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" style=\"width: 1175px;font-style: normal;font-size: 12px\" data-testid=\"output_0\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px;font-style: normal;font-size: 12px\" data-previous-available-width=\"1138\" data-previous-scroll-height=\"20\" data-hashorizontaloverflow=\"false\">\n<div style=\"font-style: normal;font-size: 12px\"><span class=\"variableNameElement\" style=\"font-style: normal;font-size: 12px\">nSamples = <\/span> 300<\/div>\n<\/div>\n<\/div>\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableStringElement\" style=\"width: 1175px;font-style: normal;font-size: 12px\" data-testid=\"output_1\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px;font-style: normal;font-size: 12px\" data-previous-available-width=\"1138\" data-previous-scroll-height=\"20\" data-hashorizontaloverflow=\"false\">\n<div style=\"font-style: normal;font-size: 12px\"><span class=\"variableNameElement\" style=\"font-style: normal;font-size: 12px\">nPulses = <\/span> 80<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">2D Ridgeline plot (aka Joyplot)<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">We'll start by recreating Craft's original 2D ridgeline plot. The 80 lines need to be vertically stacked at a fixed interval by adding vertical offsets to each pulse. I selected an interval that approximates the space between lines in Craft's original image.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">interval = 8;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">vertOffsets = (nPulses-1)*interval : -interval : 0;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px 0px 4px 4px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">ydata = pulsardata + vertOffsets;<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Create x coordinates for the 300 samples with a range that reflects the scale of the pulsar data. I chose to center the x values at x=0.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px;padding: 6px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">xdata = linspace(-220,220,nSamples);<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\"><span style=\"font-weight: bold\">Ridgeline without fill. <\/span>Let's take a look at Craft's first version before he decided to fill the ridge lines (figure below, left).<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">figure(Color=<span style=\"color: #a709f5\">'w'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">tiledlayout(1,2,TileSpacing=<span style=\"color: #a709f5\">'Tight'<\/span>,Padding=<span style=\"color: #a709f5\">'tight'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">nexttile<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">plot(xdata,ydata,<span style=\"color: #a709f5\">'k-'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">equal tight off<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px 0px 4px 4px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">title(<span style=\"color: #a709f5\">'Ridgeline without fill'<\/span>)<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\"><span style=\"font-weight: bold\">Ridgeline with fill. <\/span>Now we add the fill. It may seem as easy as plotting each pulse as a filled region using <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/polyshape.html\"><span style=\"font-family: monospace\">polyshape<\/span><\/a> or <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/patch.html\"><span style=\"font-family: monospace\">patch<\/span><\/a> but in both cases, the region would be closed so each pulse would have a straight horizontal baseline connecting the two endpoints. We don't want that. Instead, I'll fill the curves using a white edgeless <span style=\"font-family: monospace\">patch<\/span> and will plot black lines on top of the otherwise invisible patches. We also have to be careful about the order in which the lines are plotted. We'll plot them from top to bottom to get the right overlap (figure below, right).<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">nexttile()<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">hold <span style=\"color: #a709f5\">on<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">for <\/span>i = 1:nPulses<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0patch(xdata, ydata(:,i),<span style=\"color: #a709f5\">'w'<\/span>,EdgeColor=<span style=\"color: #a709f5\">'none'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0plot(xdata,ydata(:,i),<span style=\"color: #a709f5\">'k-'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">end<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">equal tight off<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">title(<span style=\"color: #a709f5\">'Ridgeline with fill'<\/span>)<\/div>\n<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" data-testid=\"output_2\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"max-width: 339px;width: 100%;padding-bottom: 0px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_5.png\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\"><span style=\"font-weight: bold\">Invert colors<\/span><span style=\"font-weight: bold;font-family: monospace\">. <\/span>For the final step to recreate the Joy Division album cover, we'll invert the colors by setting the figure and patch colors to black and the line color to white, and increase the line width.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">figure(Color=<span style=\"color: #a709f5\">'k'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">hold <span style=\"color: #a709f5\">on<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">for <\/span>i = 1:nPulses<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0patch(xdata, ydata(:,i),<span style=\"color: #a709f5\">'k'<\/span>,EdgeColor=<span style=\"color: #a709f5\">'none'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0plot(xdata,ydata(:,i),<span style=\"color: #a709f5\">'w-'<\/span>,<span style=\"color: #a709f5\">'LineWidth'<\/span>,1)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">end<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">equal tight off<\/span><\/div>\n<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" data-testid=\"output_3\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"max-width: 339px;width: 100%;padding-bottom: 0px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_6.png\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"H_D6BB38FE\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">3D ridgeline plots<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Recall that Craft considered displaying the pulses in 3D rather than overlapping 2D lines. Here are two ways to recreate that idea.<\/div>\n<h4 id=\"H_1AB454B7\" style=\"margin: 10px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 15px;font-weight: bold;text-align: left\">3D waterfall plot<\/h4>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">A <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/waterfall.html\"><span style=\"font-family: monospace\">waterfall<\/span><\/a> plot adds a third dimension to the ridgeline plot. Instead of overlapping filled curves like a flat collage of paper cutouts, each curve is oriented upward in the z direction.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">figure(Color=<span style=\"color: #a709f5\">'k'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axes(Units=<span style=\"color: #a709f5\">'normalized'<\/span>,Position=[0 0 1 1])<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">h = waterfall(xdata,vertOffsets,pulsardata');<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">h.EdgeColor = <span style=\"color: #a709f5\">'w'<\/span>;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">h.FaceColor = <span style=\"color: #a709f5\">'k'<\/span>;<\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">equal tight off<\/span><\/div>\n<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" data-testid=\"output_4\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"max-width: 339px;width: 100%;padding-bottom: 0px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_7.png\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Note that each vertical slice created by <span style=\"font-family: monospace\">waterfall<\/span> is a closed polygon. You could hide the vertical and horizontal edge lines by setting axis limits that clip those edges.<\/div>\n<div class=\"preformatted-matlab\" style=\"margin: 10px 3px 10px 55px;padding: 10px 10px 10px 5px\">\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">xlim(xlim()*.99)<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">minZ = min(pulsardata,[],<span style=\"color: #a709f5\">'all'<\/span>);<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">zlim([minZ*.99, inf])<\/div>\n<\/div>\n<h4 id=\"H_18A7D7BF\" style=\"margin: 10px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 15px;font-weight: bold;text-align: left\">3D line plot<\/h4>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Instead of using <span style=\"font-family: monospace\">waterfall<\/span>, 3D lines could be plotted using <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/plot3.html\"><span style=\"font-family: monospace\">plot3<\/span><\/a> and filled using <span style=\"font-family: monospace\">patch<\/span>, adhering to the same principles employed in the filled ridgeline plot.<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">figure(Color=<span style=\"color: #a709f5\">'k'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axes(Units=<span style=\"color: #a709f5\">'normalized'<\/span>,Position=[0 0 1 1])<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">hold <span style=\"color: #a709f5\">on<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">for <\/span>i = 1:nPulses<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0yvec = vertOffsets(i) .* ones(nSamples,1);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0patch(xdata, yvec, pulsardata(:,i),<span style=\"color: #a709f5\">'k'<\/span>,EdgeColor=<span style=\"color: #a709f5\">'none'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">\u00a0\u00a0\u00a0\u00a0plot3(xdata,yvec,pulsardata(:,i),<span style=\"color: #a709f5\">'w-'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><span style=\"color: #0e00ff\">end<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">equal tight off<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">view(3)<\/div>\n<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" data-testid=\"output_5\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"max-width: 339px;width: 100%;padding-bottom: 0px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_8.png\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">Here's another version of this plot I developed for the MathWorks office in Cambridge, UK, just 6.5 miles (~10.5 km) from the Mullard Radio Astronomy Observatory where Jocelyn Bell Burnell discovered PSR B1919+21! For this piece, I smoothed the data, increased the amplitudes, and added perspective projection.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline;width: 729px;height: 465px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_9.png\" alt=\"\" width=\"666\" height=\"425\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: center\">A wall at the MathWorks office in Cambridge, UK featuring a 3D ridgeline plot of data from PSR B1919+21<\/div>\n<h3 id=\"H_83799DAA\" style=\"margin: 15px 10px 5px 4px;padding: 0px;line-height: 18px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 17px;font-weight: bold;text-align: left\">Polar plot<\/h3>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">There are many other ways these data could be visually inspected and analyzed. Let's bring this full circle by wrapping each line to polar coordinates using <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/polarplot.html\"><span style=\"font-family: monospace\">polarplot<\/span><\/a>. I've plotted the pulse waves with and without radial offsets. Amusingly, the first image resembles a vinyl record!<\/div>\n<div style=\"background-color: #f5f5f5;margin: 10px 0 10px 0\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px 4px 0px 0px;padding: 6px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">theta = linspace(-pi,pi,nSamples);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">f = figure(Color=<span style=\"color: #a709f5\">'k'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">f.Position(3) = 800;<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">tiledlayout(1,2,TileSpacing=<span style=\"color: #a709f5\">'None'<\/span>,Padding=<span style=\"color: #a709f5\">'tight'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">nexttile()<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">polarplot(theta, ydata, <span style=\"color: #a709f5\">'-w'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">set(gca,<span style=\"color: #a709f5\">'ThetaZeroLocation'<\/span>,<span style=\"color: #a709f5\">'top'<\/span>,<span style=\"color: #a709f5\">'ThetaDir'<\/span>,<span style=\"color: #a709f5\">'clockwise'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">off<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">rlim([-10 650])<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">title(<span style=\"color: #a709f5\">'With radius offsets'<\/span>,Color=<span style=\"color: #a709f5\">'w'<\/span>)<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\"><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">nexttile()<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">polarplot(theta, pulsardata, <span style=\"color: #a709f5\">'-w'<\/span>,Clipping=<span style=\"color: #a709f5\">'off'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">set(gca,<span style=\"color: #a709f5\">'ThetaZeroLocation'<\/span>,<span style=\"color: #a709f5\">'top'<\/span>,<span style=\"color: #a709f5\">'ThetaDir'<\/span>,<span style=\"color: #a709f5\">'Clockwise'<\/span>);<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">axis <span style=\"color: #a709f5\">off<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 0px;padding: 0px 45px 0px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">rlim([-70,50])<\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px;padding: 0px 45px 4px 13px;line-height: 18.004px;min-height: 0px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px\">title(<span style=\"color: #a709f5\">'Without radius offsets'<\/span>,Color=<span style=\"color: #a709f5\">'w'<\/span>)<\/div>\n<\/div>\n<div style=\"padding: 10px 0px 6px 17px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 14px;line-height: 17.234px\">\n<div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" data-testid=\"output_6\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"max-width: 484px;width: 100%;padding-bottom: 0px\" src=\"http:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_10.png\" \/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">To see the polar axes,<\/div>\n<div class=\"preformatted-matlab\" style=\"margin: 10px 3px 10px 55px;padding: 10px 10px 10px 5px\">\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">pax = gca();<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">axis(pax,<span style=\"color: #a709f5\">'on'<\/span>)<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">pax.Color = <span style=\"color: #a709f5\">'k'<\/span>;<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">pax.ThetaAxis.Color = <span style=\"color: #a709f5\">'w'<\/span>;<\/div>\n<div style=\"border-radius: 0px;padding: 0px;line-height: 15.6px;min-height: 16px;font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;font-size: 12px\">pax.RAxis.Color = <span style=\"color: #a709f5\">'w'<\/span>;<\/div>\n<\/div>\n<h2 id=\"H_FBAB0F4F\" style=\"margin: 20px 10px 5px 4px;padding: 0px;line-height: 20px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 20px;font-weight: bold;text-align: left\">Next steps<\/h2>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">We've reviewed a variety of methods to visualize cyclical data, from ridgeline plots to waterfall plots, 3D line plots, and even polar plots. I invite readers to unleash your creativity by producing unique visualizations using these data or these techniques. I'd love to see what you produce.<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">What would the album cover look like if the producers had MATLAB back in 1979?<\/div>\n<div style=\"margin: 2px 10px 9px 4px;padding: 0px;line-height: 21px;min-height: 0px;font-family: Helvetica, Arial, sans-serif;font-style: normal;font-size: 14px;font-weight: 400;text-align: left\">What signals have you received from Little Green Men?<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<p><script type=\"text\/javascript\">\n{ let css = '\/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} \/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} \/* Copyright 2015-2023 The MathWorks, Inc. *\/\/* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip *\/.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}';\nlet head = document.head || document.getElementsByTagName('head')[0];\nlet style = document.createElement('style');\nhead.appendChild(style);\nstyle.type = 'text\/css';\nif (style.styleSheet) {\n    style.styleSheet.cssText = css;\n} else {\n    style.appendChild(document.createTextNode(css));\n}<\/p>\n<p>}<\/script><a href=\"https:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx\"><button class=\"btn btn-sm btn_color_blue pull-right add_margin_10\">Download Live Script<\/button><\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/graphics-and-apps\/files\/2024\/01\/RidgelinePlots_JoyDivision.mlx-01-09-24_4.gif\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>In 1979, an English rock band produced what Rolling Stone would describe as one of the best albums of all time with an album cover that would become iconic in data visualization. Joy Division's... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/graphics-and-apps\/2024\/01\/10\/creating-ridgeline-plots-from-pulsars-to-pop-culture\/\">read more >><\/a><\/p>\n","protected":false},"author":198,"featured_media":683,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,11,2,17],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/posts\/704"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/users\/198"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/comments?post=704"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/posts\/704\/revisions"}],"predecessor-version":[{"id":3637,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/posts\/704\/revisions\/3637"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/media\/683"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/media?parent=704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/categories?post=704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/graphics-and-apps\/wp-json\/wp\/v2\/tags?post=704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}