I'm trying to create a scatterplot for a bunch of probability values for two labels, but when I plot it, the labels appear left- and right-justified so there's a bunch of empty space in-between. Is there a way to narrow the gap between the two x-axis tick marks?
Here's the code I used:
x = [1,2]
y = [[0.1, 0.6, 0.9],[0.5,0.7,0.8]]
colors = ['magenta', 'blue']
plt.title("Algorithm comparison - p-values")
for xe, ye,c in zip(x, y,colors):
plt.scatter([xe] * len(ye), ye, c=c)
plt.xticks([1,2])
plt.axes().set_xticklabels(['Part 1','Part 2'],rotation = 45)
Thanks in advance! Please let me know if I left out any important details.