From 2c8313f4d9069124b9ba288e13caddcd303ad344 Mon Sep 17 00:00:00 2001 From: Tamas Gal <tgal@km3net.de> Date: Thu, 28 Feb 2019 18:46:58 +0400 Subject: [PATCH] Fix plotting --- scripts/online_reco.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/online_reco.py b/scripts/online_reco.py index 44a9e09..abc68d2 100644 --- a/scripts/online_reco.py +++ b/scripts/online_reco.py @@ -19,6 +19,7 @@ Options: """ from collections import deque import time +import os import threading import numpy as np import matplotlib @@ -52,8 +53,12 @@ class ZenithDistribution(kp.Module): def create_plot(self): fig, ax = plt.subplots(figsize=(16, 4)) - plt.histogram(self.thetas, bins=180) - filename = join(self.plots_path, 'track_reco.png') + ax.hist(self.thetas, bins=180) + ax.set_title( + r"$\theta$ distribution of JGandalf track reconstructions") + ax.set_xlabel(r"$\theta$ [deg]") + ax.set_ylabel = "count" + filename = os.path.join(self.plots_path, 'track_reco.png') plt.savefig(filename, dpi=120, bbox_inches="tight") plt.close('all') -- GitLab