In this notebook, we use the reference-location option to indicate that we would like footnotes to be placed in the right margin.
We also use the column: screen-inset cell option to indicate we would like our figure to occupy the full width of the screen, with a small inset.
Colorbars indicate the quantitative extent of image data. Placing in a figure is non-trivial because room needs to be made for them. The simplest case is just attaching a colorbar to each axes:1.
I’m also adding a few global settings to control the general look. The first four define the range, size, and width of the wedges in the histogram.
Code
START_ANGLE =100# At what angle to start drawing the first wedgeEND_ANGLE =450# At what angle to finish drawing the last wedgeSIZE = (END_ANGLE - START_ANGLE) /len(df) # The size of each wedgePAD =0.2* SIZE # The padding between wedgesINNER_PADDING =2* df.score.min()LIMIT = (INNER_PADDING + df.score.max()) *1.3# Limit of the axes
2.1.1.3 Boilerplate code
Code
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(30, 30))ax.set(xlim=(-LIMIT, LIMIT), ylim=(-LIMIT, LIMIT))for i, row in df.iterrows(): bar_length = row.score name = row.country length = bar_length + INNER_PADDING start =100+ i*SIZE + PAD end =100+ (i+1)*SIZE angle = (end + start) /2# Create variables here# Add wedge functions here# Add general functions hereplt.axis("off")plt.tight_layout()plt.show()