コード例 #1
0
def histogram_of_number_of_computers_per_user(
        width=900,
        height=500,
        filename='/var/listit/www-ssl/_studyplots/clients.png'):
    clientsperuser = number_of_clients_per_user(diaginfos())
    print clientsperuser
    #print "one"
    r.png('/tmp/foo', width=1024, height=768)
    aa = r.hist(c(clientsperuser))
    devoff()
    print "twos"
    try:
        print sum(aa[1])
        print "outputting to %s " % filename
        cap.hist(clientsperuser,
                 filename=filename,
                 labels=True,
                 xlabel='number of computers per user',
                 ylabel='number of users',
                 width=width,
                 height=height,
                 title="Number of computers for signed up users (N=%d)" %
                 sum(aa[1]))
    except:
        print sys.exc_info()
    return clientsperuser
コード例 #2
0
def feature_hists(keys,fvs):
    ## takes fvs and performs a stats on each of them
    import jv3.study.ca_plot as cap
    for k in keys:
        try:
            print k
            counts = [float(features[k]) for nid,features in fvs.iteritems()]
            s(counts)
            print cap.hist(counts,breaks=r.c(r.seq(min(counts)-1,50,(50-min(counts)-1)/50.0),100,250,max(500,max(counts))+1),filename='%s.png' % k,title=k)
        except ValueError,ve:
            print sys.exc_info()        
コード例 #3
0
def histogram_of_number_of_computers_per_user(width=900,height=500,filename='/var/listit/www-ssl/_studyplots/clients.png'):
   clientsperuser = number_of_clients_per_user(diaginfos())
   print clientsperuser
   #print "one"
   r.png('/tmp/foo',width=1024,height=768)
   aa = r.hist(c(clientsperuser))
   devoff();
   print "twos"
   try:
      print sum(aa[1])
      print "outputting to %s " % filename
      cap.hist(clientsperuser,filename=filename, labels=True,xlabel='number of computers per user', ylabel='number of users', width=width,height=height,title="Number of computers for signed up users (N=%d)" % sum(aa[1]))
   except:
      print sys.exc_info()
   return clientsperuser
コード例 #4
0
def feature_hists(keys, fvs):
    ## takes fvs and performs a stats on each of them
    import jv3.study.ca_plot as cap
    for k in keys:
        try:
            print k
            counts = [float(features[k]) for nid, features in fvs.iteritems()]
            s(counts)
            print cap.hist(counts,
                           breaks=r.c(
                               r.seq(
                                   min(counts) - 1, 50,
                                   (50 - min(counts) - 1) / 50.0), 100, 250,
                               max(500, max(counts)) + 1),
                           filename='%s.png' % k,
                           title=k)
        except ValueError, ve:
            print sys.exc_info()