George C. Privon 5 anni fa
parent
commit
2af4708bab
1 ha cambiato i file con 11 aggiunte e 6 eliminazioni
  1. 11 6
      email_stats.py

+ 11 - 6
email_stats.py

@@ -6,7 +6,7 @@
 # - Time vs date plots of emails
 # - Recipients domains as a function of time
 #
-# Copyright 2015-2018 George C. Privon
+# Copyright 2015-2018, 2020 George C. Privon
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -102,6 +102,8 @@ ax.set_title(args.title + ' - Email Send Times', fontsize='large')
 
 viridis = plt.get_cmap('viridis')
 
+fig2, ax2 = plt.subplots(1, 1)
+
 if args.sendercolors:
     for plid in enumerate(slist):
         ax.plot_date(np.array(pldata[plid[1]])[:, 0],
@@ -110,6 +112,7 @@ if args.sendercolors:
                      marker='.',
                      #tz=z.tzname(),
                      label=plid[1],
+                     alpha=0.3,
                      xdate=True)
 
 if len(pldata['unknown']) > 0:
@@ -119,11 +122,15 @@ if len(pldata['unknown']) > 0:
                  marker='.',
                  #tz=z.tzname(),
                  label='unknown',
+                 alpha=0.3,
                  xdate=True)
 
 if args.sendercolors:
     ax.legend(loc='upper left', ncol=nsend + 1)
 
+ax.tick_params(axis='x',
+               labelrotation=90)
+
 if args.plotroot:
     fig.savefig(args.plotroot + '-send_times.png')
 else:
@@ -173,13 +180,11 @@ ax.annotate('N={0:1.0f}'.format(np.sum(total)),
             xycoords='axes fraction')
 
 ax.legend(frameon=False, loc='best')
-ax.set_xticks(np.arange(len(months)),
-              months)
+ax.set_xticks(np.arange(len(months))[::6])
+ax.set_xticks(np.arange(len(months)), minor=True)
+ax.set_xticklabels(months[::6])
 ax.tick_params(axis='x',
                labelrotation=90)
-# set every other sixth ticklabel as visible
-plt.setp(ax.get_xticklabels(), visible=False)
-plt.setp(ax.get_xticklabels()[::6], visible=True)
 ax.set_ylim(bottom=0)
 
 if args.plotroot: