From 9bab259ecbf8095733bf3227192c80c1ec35b455 Mon Sep 17 00:00:00 2001 From: heloises Date: Thu, 31 Oct 2019 14:48:07 +1300 Subject: [PATCH] added labels to cmd plots --- hoki/cmd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hoki/cmd.py b/hoki/cmd.py index e379185a..b8d01cb8 100644 --- a/hoki/cmd.py +++ b/hoki/cmd.py @@ -82,6 +82,8 @@ def __init__(self, file, self._time_bins = None self._log_ages = None self._ages = None + self.filter1 = None + self.filter2 = None def make(self, filter1, filter2): """ @@ -105,9 +107,12 @@ def make(self, filter1, filter2): None """ + self.filter1 = str(filter1) + self.filter2 = str(filter2) + # FIND THE KEYS TO THE COLUMNS OF INTEREST IN DUMMY - col_keys = ['timestep', 'age', str(filter1), str(filter2), 'M1', 'log(R1)', 'log(L1)'] + col_keys = ['timestep', 'age', self.filter1, self.filter2, 'M1', 'log(R1)', 'log(L1)'] try: cols = tuple([dummy_dict[key] for key in col_keys]) @@ -326,6 +331,9 @@ def plot(self, log_age=6.8, loc=111, cmap='Greys', **kwargs): cm_diagram.invert_yaxis() + cm_diagram.set_ylabel(self.filter1) + cm_diagram.set_xlabel(self.filter1+"-"+self.filter2) + return cm_diagram