I'm very new to python and matplotlib! I'm wanting to boxplot two
distributions with diff number of observations. At the moment I can do
two subplots, but this makes comparisons difficult. Dose anyone have
any suggestions? I would also like to have a label for each plot on the
y-axis, if it's plotted horizontally.
A colleague of mine suggested to concatenate the arrays along axis 1,
but as the arrays are of different sizes, this dose not work.
I can do this in R, but I was told to give matplotlib a go :)
Noel Faux <noel.faux@...> writes:
> I'm wanting to boxplot two
> distributions with diff number of observations.
I wanted to do something similar, and it seems that the current
boxplot implementation doesn't quite allow it, but it is easy to
modify. I'm attaching a patch that allows you to set the position and
width of each box (as in Matlab's boxplot), so if you set hold(True),
you can call boxplot multiple times with different positions.
It's not perfect: it forces the limits and ticks of the last boxplot
on the axes, so you have to set the limits and ticks manually after
doing all the plots. I tried to fix this problem by extending the
limits and adding to the ticks instead of replacing them if holdStatus
is true, but then I got extra ticks at 0.0, 0.2, ..., 1.0; I guess
these are automatically generated when the figure is initialized, and
I don't know how to tell the difference between a just-initialized
figure and one where the user has set the ticks.
Jouni K Seppänen