From 7cca507f3368ae4ff6be3d00d15da5f16058f1ff Mon Sep 17 00:00:00 2001 From: brandons209 Date: Sun, 19 Jul 2020 17:13:03 -0400 Subject: [PATCH] fix tables not printing fully, and make legend on graph look nicer --- activitylog/activitylog.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/activitylog/activitylog.py b/activitylog/activitylog.py index fb24086..d295e63 100644 --- a/activitylog/activitylog.py +++ b/activitylog/activitylog.py @@ -507,18 +507,24 @@ class ActivityLogger(commands.Cog): # make graph look nice plt.title(f"{user} message history from {end_time} to now", fontsize=fontsize) - plt.xlabel("dates", fontsize=fontsize) + plt.xlabel("dates (UTC)", fontsize=fontsize) plt.ylabel("messages", fontsize=fontsize) plt.xticks(fontsize=fontsize) plt.yticks(fontsize=fontsize) plt.grid(True) - plt.legend(loc="best", prop={"size": 30}) + + plt.legend(bbox_to_anchor=(1.00, 1.0), loc='upper left', prop={"size": 30}) fig.tight_layout() fig.savefig(save_path, dpi=fig.dpi) plt.close() with open(table_save_path, "w") as f: + # need to set pandas options so that full data is printed to string + pd.set_option('display.max_rows', None) + pd.set_option('display.max_columns', None) + pd.set_option('display.width', None) + pd.set_option('display.max_colwidth', -1) f.write(str(df)) with open(save_path, "rb") as f, open(table_save_path, "r") as t: