#!/usr/bin/python # Minas Gjoka import urllib,re, sys, time, random, datetime, time, signal, urllib2, cookielib, httplib, gzip, glob, os, csv import Gnuplot, Gnuplot.funcutils #############Coverage##################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 2') g('set logscale x') g.xlabel('Ranked Number of Applications used') g.ylabel('Covered number of users') g('set terminal postscript monochrome enhanced "Arial" 22') g('set output "coverage.eps"') g('plot "coverage.dat" using 1:4 with points title "Coverage"') ################CCDF of Total Installs####################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 2') g('set logscale x') g('set logscale y') g.xlabel('Installed Applications') g.ylabel('CDF') g('set terminal postscript color enhanced "Arial" 20') g('set output "ccdf-installs-datacrawled.eps"') g('plot "ccdf-installs-datacrawled.dat" using 1:2 with linespoints title "Popularity"') ################CCDF of Total Installs from Crawled vs All profiles ####################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 2') g('set logscale x') g('set logscale y') g.xlabel('Number of Installed Applications') g.ylabel('CDF') g('set terminal postscript monochrome enhanced "Arial" 22') g('set output "ccdf-installs-datacrawled_n_analytics.eps"') g('plot "ccdf-installs-datacrawled.dat" using 1:2 with linespoints title "Crawled dataset", \ "../apps/ccdf-totalinstalls-lastday.dat" using 1:2 with linespoints title "Facebook Analytics"') ################Rank-Total Installs from Crawled and All profiles ####################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 2') g('set logscale x') g('set logscale y') g.xlabel('Number of Installed Applications') g.ylabel('CDF') g('set terminal postscript monochrome enhanced "Arial" 22') g('set output "rank-installs-datacrawled_n_analytics.eps"') g('plot "rank-installs-datacrawled.dat" using 1:2 with linespoints title "Crawled dataset", \ "../apps/rank-totalinstalls-lastday.dat" using 1:2 with linespoints title "Facebook Analytics"') ##################Histogram for number of apps#################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 2') g('set xlabel "Number of applications installed') g('set ylabel "Number of users') g('set logscale x') g('set logscale y') #g('set style data histogram') #g('set style fill solid border -1') g.xlabel('Numofapps\\n') g.ylabel('Instances') g('set terminal postscript color enhanced "Arial" 22') g('set output "apps-peruser.eps"') g('plot "apps-peruser.dat" using 1:2 with linespoints title "Applications per user"') ############################################### g = Gnuplot.Gnuplot(debug=0) g('set grid') g('set pointsize 1.5') g('set logscale x') g('set logscale y') g('set key bottom right') g.xlabel('Number of applications (ranked by popularity) used') g.ylabel('Number of users covered') g('set terminal postscript monochrome enhanced "Arial" 22') g('set output "coverage-simulation_n_crawled.eps"') g('plot [][:1]"coverage.dat" using 1:4 with points pt 3 title "Coverage from Crawled dataset", \ "simulation-coverage-all-profiles-installs-foreachapp-withoutexcludedapps" using ($1):3 with points pt 11 title "Coverage from Simulation')