February 2024
Data SourceOrganization: Our World in Data (Link)
Dataset & MetadataProtocol Actions
-
Load Data:
The datasetnumber-of-nuclear-weapons-tests.csvis imported into a Pandas DataFrame. -
Data Processing:
The data is grouped by "Entity" (Country) to calculate the sum of tests per country. The Entities are then sorted in descending order by this total sum to define the visual stacking order. -
Visualization Layout:
A stacked bar chart is initialized using Plotly Express with "Year" on the x-axis and "Number of nuclear weapons tests" on the y-axis. The bars are colored by "Entity". -
Chart Styling:
The "plotly_dark" template is applied. The title is set to emphasize the "Echoes of Detonations" during the Cold War. -
Refinement:
The layout is updated to stack bars, unified hover tooltips are enabled (showing totals for all countries in a given year), and axes are set to fixed ranges to prevent interaction issues in the embedded view.