So I have a function that plots running times, and cuts out sections of time during the offseason.
def plotTimes(data):
x = data["x"]
y = data["y"]
fig, axes = plt.subplots(1, data["years"], sharey=True)
for i in range(data['years']):
axes[i].plot(x, y)
if i < data['years'] - 1:
axes[i].spines['right'].set_visible(False)
if i > 0:
axes[i].spines['left'].set_visible(False)
axes[i].yaxis.set_ticks_position('none')
axes[i].set_xlim(data['boundaries'][i]['start'],data['boundaries'][i]['end'])
plt.xticks(rotation=90)
plt.xlabel('Date')
plt.ylabel('5k Time')
plt.title(data['name'])
plt.show()
This code generated an image like this:
- Why is my xtick rotation not applying to all of the axes?
- Why isn't the top label in the center?
- Why is the axis label on the left edge?