I use the simple code below to generate a boxplot with the labels of the x-values changed:
subplot(221)
boxplot(list_of_lists_of_lengths)
xlabel('max gap')
ylabel('cluster lengths')
xticks(range(len(max_distance)), max_distance, size='small')
As you can see the x values are not correctly offset- I want 0 to be below the first box and 100 below the second.
Played around with it, can’t find the answer. Please help!

Use
to find out the locations where matplotlib was going to place the xtick marks. Then change the labels:
For example,
produces