diff --git a/heatmap.py b/heatmap.py index b588336..2fa848e 100644 --- a/heatmap.py +++ b/heatmap.py @@ -18,7 +18,8 @@ client = Mastodon( api_base_url="https://nofan.xyz", ) -fn = "./heatmap.txt" +base_dir = os.path.dirname(os.path.abspath(__file__)) +fn = os.path.join(base_dir, "heatmap.txt") # read from file if exists date = [] data = [] @@ -79,9 +80,9 @@ with open(fn, "w") as f: f.close() cleaned_date, cleaned_data = july.utils.preprocess_inputs(date, data) -july.heatmap(cleaned_date, cleaned_data, cmap="BuGn") +july.heatmap(cleaned_date, cleaned_data, cmap="BuGn", month_grid=False, weekday_label=False, month_label=False) -img_path = "./heatmap.png" +img_path = os.path.join(base_dir, "heatmap.png") plt.savefig(img_path, bbox_inches="tight") # upload image to mastodon