A Beginner’s Guide to Plotting ‘FiveThirtyEight Like’ Visualizations

To do this we define a function that loops through the “Group” column and creates a new “Occupations” column.See added ‘Occupation’ column combining occupations into three categoriesNext, create a table with the percentage of guests according to occupations each year..Customizing line color and line weight to match the graph from the article…Here’s our initial plotIncrease the length of grid lines along the y-axis and add a horizontal line at the baseline of the plot.Grid line along y-axis increased and horizontal line at baseline addedAdjust the x and y labels displayed, again adjusting font color and size.Reduced number of grid lines and changed x & y axis labelsSet the graph title and subtitle (not using the traditional plt.title() since it limits text placement)..Notice that the x and y arguments below determine the placement of the text according to the x and y coordinates.Title & subtitle aligned with ‘100%’ label on plotAdd text labels for each line in the plot with customized font size and color.Adding labels here takes a lot of playing with x & y coordinatesAnd our last touch, a custom signature box at the bottom of our graph.. More details

Leave a Reply