Six Ways You Can Make Beautiful Graphs (Like Your Favorite Journalists)

This post shows how to make graphs like The Economist, New York Times, Vox, 538, Pew, and Quartz. And you can share–embed your beautiful, interactive graphs in apps, blog posts, and web sites. Read on to learn how. If you like interactive graphs and need to securely collaborate with your team, contact us about Plotly Enterprise.

Graphing Political Opinion In The New York Times

The Upshot, a New York Times blog, publishes articles and data visualizations about politics, policy, economics, and everyday life. The visualization below comes from a study of political opinions. Events that occur between the ages of 14–24 are most impactful for the voting patterns and political preferences of the next generations of voters.

Image for post
Image for post
See the interactive plot

We’ve used Plotly’s fill to option to show the confidence intervals. Hover your mouse to see data; click and drag to zoom. Click the source link to see the NYT original piece (you can add links to Plotly graphs).

When To Show Up At A Party In 538

538 is a news site started by statistician Nate Silver. Their staff studied when people show up at parties. They concluded that “The median arrival time of the 803 guests was a whopping 58 minutes after the party’s designated start time.” We used a line of best fit and subplots.

Image for post
Image for post
See the interactive plot

What People Think Of The News In Pew

Pew Research publishes polls about issues, attitudes, and trends. The heatmap below comes from a study by Pew concluding that among liberals and conservatives, “[t]here is little overlap in the news sources they turn to and trust.”

Image for post
Image for post
See the interactive plot

The Illegal Trade In Animal Products In The Economist

The Economist publishes news and analysis on politics, business, finance, science, technology and the connections between them. This plot shows the price per kg of illegal animal products, with a logarithmic x axis.

See the interactive plot

The History Of Cigarettes In Vox

Vox is a general interest news site, with the goal to explain the news. This plot was published in an academic journal then used in a Vox article on tobacco. Vox points out that after 1890, “Cigarettes only went from niche product to mass-market success after the rolling machine improved dramatically.”

See the interactive plot

The Economics Of Unemployment In Quartz

Quartz is a news outlet for the new global economy. This plot comes from a piece concluding that “America has an unemployment problem, but specifically, it has a long-term unemployment problem.” We’ve styled the notes to be the same color as and reside beside the lines they identify.

Image for post
Image for post
See the interactive plot

How We Made These Plots & How You Can Too

The most difficult part about making these charts is accessing the data. We often use WebPlotDigitzer to access the data in graphs. Then we embed plots in our blog. To match Plotly’s colors with the original graphic, there are a number of tools available to you, including:

WPD’s own color picker under

Image for post
Image for post

→ Auto →

Image for post
Image for post

or

Image for post
Image for post

Image for post
Image for post

The DigitalColorMeter program that comes standard with all Mac computersDownloadable programs such as Instant Eyedropper (Windows), Art Director’s Toolkit (Mac),xScope (Mac), or the Chrome colorZilla extension

If you’ve made a style you like, you can save and apply that style as a theme. Or, you can save themes from the plots in this post (or any plots from the Plotly feed).

If you’re a developer, you can specify your colors, fonts, data, or styles with our APIs. Python users can embed in IPython Notebooks with matplotlib; R users in RPubs and Shiny with ggplot2; MATLAB users can share MATALB figures. Every plot is accessible as a static image or as code in Python, R, MATLAB, Julia, JavaScript, or JSON. For example, for the last plot, see:

Written by

The leading front-end for ML & data science models in Python, R, and Julia.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store