I have a figure consisting of 5 different plots created using matplotlib which can be seen at the end of the post.
The ticks on the x-axis are all over the place. Some have 2, some have 3, and they're not even aligned.
My question: Is there some way, where I can consistently get, for each plot, for example xtick 0.1, 0.5, and 0.9? or just a way to tell matplotlib to ALWAYS show N xticks?
The following is my current code. I apologize if its horrible, I'm extremely new to matplotlib.
for runtime_data in loader.all_runtime_data:
fig, axd = plt.subplot_mosaic([['topleft', 'topright'],['midleft', 'midright'],['bottom', 'bottom']])
for key in runtime_data.keys():
data = runtime_data[key]
# naive
axd['topleft'].boxplot(data[loader.pingpongKey])
axd['topleft'].tick_params(axis='both', labelsize=12)
axd['topleft'].set_xticks([1], ['Pingpong'])
axd['topleft'].set_ylabel('Time (ms)', fontsize=12)
axd['topright'].boxplot(data[loader.threadringKey])
axd['topright'].tick_params(axis='both', labelsize=12)
axd['topright'].set_xticks([1], ['Threadring'])
axd['topright'].set_ylabel('Time (ms)', fontsize=12)
axd['midleft'].boxplot(data[loader.bigKey])
axd['midleft'].tick_params(axis='both', labelsize=12)
axd['midleft'].set_xticks([1], ['Big'])
axd['midleft'].set_ylabel('Time (ms)', fontsize=12)
axd['midright'].boxplot(data[loader.bangKey])
axd['midright'].tick_params(axis='both', labelsize=12)
axd['midright'].set_xticks([1], ['Bang'])
axd['midright'].set_ylabel('Time (ms)', fontsize=12)
axd['bottom'].boxplot(data[loader.reverseBangKey])
axd['bottom'].tick_params(axis='both', labelsize=12)
axd['bottom'].set_xticks([1], ['Reversebang'])
axd['bottom'].set_ylabel('Time (ms)', fontsize=12)
plt.tight_layout()
plt.savefig('plots/boxplots/' + key + '-boxplot.pgf', bbox_inches='tight')



