This dataset, found in one of my old external drives, corresponds to the famous plot from Radio Observations of the Pulse Profiles and Dispersion Measures of Twelve Pulsars (Craft, 1970). This is broadly known as the Joy Division’s plot from Unknown Pleasures. If you happen to know whom created the provided CSV file, please let me know so I can give proper credit.
The dataset contains “successive pulses from the first pulsar discovered, CP 1919, are here superimposed vertically. The pulses occur every 1.337 seconds. They are caused by rapidly spinning neutron star.” (The Cambridge Encyclopaedia of Astronomy, 1977)
Thanks to Scientific American, there is a complete explanation of the dataset and its origin.
From GitHub
pak::pkg_install("pachadotdev/cp1919")
library(cp1919)
head(pulsar)
## measurement time radio_intensity
## 1 1 1 -0.81
## 2 1 2 -0.91
## 3 1 3 -1.09
## 4 1 4 -1.00
## 5 1 5 -0.59
## 6 1 6 -0.82
This looks nothing like the Joy Division album cover but it is the starting point.
library(ggplot2)
ggplot(pulsar) +
geom_line(
aes(x = time, y = radio_intensity)
) +
facet_wrap(~measurement)
Now we get a plot with the stacked waves.
library(ggridges)
col1 <- "white"
col2 <- "black"
ggplot(pulsar, aes(x = time, y = measurement, height = radio_intensity, group = measurement)) +
geom_ridgeline(
min_height = min(pulsar$radio_intensity),
scale = 0.2,
linewidth = 0.5,
fill = col1,
colour = col2
) +
scale_y_reverse() +
theme_void() +
theme(
panel.background = element_rect(fill = col1),
plot.background = element_rect(fill = col1, color = col1),
)
Similar to the previous plot.
col1 <- "#94cee1"
col2 <- "white"
ggplot(pulsar, aes(x = time, y = measurement, height = radio_intensity, group = measurement)) +
geom_ridgeline(
min_height = min(pulsar$radio_intensity),
scale = 0.2,
linewidth = 0.5,
fill = col1,
colour = col2
) +
scale_y_reverse() +
theme_void() +
theme(
panel.background = element_rect(fill = col1),
plot.background = element_rect(fill = col1, color = col1),
)
Now we get a plot with the stacked waves.
col1 <- "black"
col2 <- "white"
ggplot(pulsar, aes(x = time, y = measurement, height = radio_intensity, group = measurement)) +
geom_ridgeline(
min_height = min(pulsar$radio_intensity),
scale = 0.2,
linewidth = 0.5,
fill = col1,
colour = col2
) +
scale_y_reverse() +
theme_void() +
theme(
panel.background = element_rect(fill = col1),
plot.background = element_rect(fill = col1, color = col1),
)



