Hm. thanks for the info. But it's not perfect... I get times in my  
formats, but not the dates. Here is the sample code:


#!/usr/bin/python

#
# Example boxplot code
#

from pylab import *
from matplotlib.dates import MonthLocator, WeekdayLocator, DateFormatter
from matplotlib.dates import MONDAY,SATURDAY

# fake up some data
set1 = (rand(50)+1) * 100
set2 = (rand(50)+2) * 100

boxplot(set1,positions=[732659])
boxplot(set2,positions=[732660])
ax = gca()

ax.xaxis.set_major_locator(MonthLocator())
ax.xaxis.set_major_formatter(DateFormatter('%D'))
ax.xaxis.set_minor_locator(WeekdayLocator(MONDAY))

ax.yaxis.set_major_formatter(FormatStrFormatter('%3.0f KB/s'))
ax.xaxis_date(None)
setp(ax.get_xticklabels(),'rotation',90,fontsize=8)
show()


==================
And yes, thanks for telling me about the timezone problem. I have  
been doing all of my work in GMT, only to be confounded.

We really need a manual that explains all of the axis stuff.

Now, how do I get two boxplots on the same plot?

(This would be SO MUCH EASIER if boxplot would take a list of objects  
that listed where the various thingies when...)



On Dec 15, 2006, at 8:56 PM, Pierre GM wrote:

>
>>      2. I need to have the X axis of the boxplot be dates. There doesn't
>> seem to be an easy way to do that.
>
> Use the "position" keyword, as a list of date ordinals (output of  
> date2num).
> Then, use
> gca().xaxis_date(tz)
> where tz is your current timezone (you can use None, that's easier).
> Et voila.
> You probably gonna have to play with tick rotation and date  
> formatting, but
> that's another story
>
> Using the boxplot_demo
> #...
> # multiple box plots on one figure
> figure()
> positions = [732659, 732660]
> boxplot(data, positions=positions)
> gca().xaxis_date(None)
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to