Suppose you have the following data set which is a list of leaders for all independent states in the world as outlined in the Gleditsch and Ward.
With this data, can you plot the number of leaders by their exit code ('exitcode' in data) and the year that their rule ended ('endyear' in the data). You can represent this with x-axis having the end year, y-axis by count of leaders represented as stacked bar chart.