Take the 2-minute tour ×  I'm currently using matplotlib to plot
a measurement against 2 or 3 other measurements (sometimes
categorical) on the x-axis. Currently, I am grouping the data on
the x-axis into tuples and sorting them before plotting... the
result looks something like the left image below. What I would
like to do is to plot the data with multiple x-axes as you see
in the right image. The grouping of the "treatment" x-axis
labels would be icing on the cake.  alt text  share|improve this
question add comment  2 Answers  up vote 14 down vote accepted
First off, cool question! It's definitely possible with
matplotlib >= 1.0.0. (The new spines functionality allows it)
It requires a fair bit of voodoo, though... My example is far
from perfect, but hopefully it makes some sense:  import numpy
as np import matplotlib.pyplot as plt import matplotlib as mpl
def main():     nx = 10     x = np.linspace(0, 2*np.pi, 10)
y = 2 * np.sin(x)      groups = [('GroupA', (x[0], x[nx//3])),
('GroupB'