I'm looking to plot hierarchically structured results in a simple matplotlib plot where I could represent the different levels of x-axis modalities
import numpy
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
y=[0.2,0.4,0.3,0.2,0.5,0.6,0.1,0.2]
x = [['a','1','p1'],
['b','1','p1'],
['c','2','p1'],
['d','2','p1'],
['a','3','p2'],
['b','3','p2'],
['c','4','p2'],
['d','4','p2']]
x1 = x[:,0] # label of the first x-axis
x2 = x[:,1] # label of the second x-axis
x3 = x[:,2] # label of the third x-axis
ax1.set_xticklabels(x1)
ax1.xaxis.set_label_text("Sample data")
ax2.set_xticklabels(x2)
ax2.xaxis.set_label_text("Temperature")
ax3.set_xticklabels(x3)
ax3.xaxis.set_label_text("Population")
ax.plot(x, y)
plt.show()
I tried to inspire from answers here and and here but it sounds so complicated for such a common task, with defining where to put tick and so on. Is there any way to do that easily in seaborn or matplotlib?