Names in boxplot x axis

Hi everyone,

I've been using matplotlib for a while but mostly using the pyplot
functions and going as far as changing their initial input parameters.

Now I need to make a boxplot and include names on the X axis as opposed
to the default numbers.

I've searched extensively on the docs and using google but I reached a
dead end. So, could someone point me in the direction of how can I
change the plot to use names instead of numbers on the x axis (vertical
boxplot) or y axis (horizontal boxplot)?

Thanks,
Renato

In Ipython -pylab

I[1]: a = np.random.rand(10)
I[3]: b = np.random.rand(10)
I[4]: boxplot([a,b], positions=[1,2])
I[5]: locs, labels = xticks([1,2], [‘a’, ‘b’])

#for fine-tuning

setp(labels, ‘rotation’, ‘horizontal’)

xticklabels = getp(gca(), ‘xticklabels’)

yticklabels = getp(gca(), ‘yticklabels’)

setp(xticklabels, fontsize=14, weight=‘bold’)

setp(yticklabels, fontsize=14, weight=‘bold’)

Cheers :slight_smile:

···

On Fri, Oct 9, 2009 at 10:41 AM, Renato Alves <rjalves@…2814…> wrote:

Hi everyone,

I’ve been using matplotlib for a while but mostly using the pyplot

functions and going as far as changing their initial input parameters.

Now I need to make a boxplot and include names on the X axis as opposed

to the default numbers.

I’ve searched extensively on the docs and using google but I reached a

dead end. So, could someone point me in the direction of how can I

change the plot to use names instead of numbers on the x axis (vertical

boxplot) or y axis (horizontal boxplot)?

Thanks,

Renato


Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Gökhan