示例#1
0
    def get_full_x_title(self, short=False, root=ROOT_DEFAULT):
        """
        Returns the full title (i.e. with unit string) of the x-axis. When *short* is *True*, the
        short version is returned. When *root* is *True*, the title is converted to *proper* ROOT
        latex.
        """
        title = self.x_title_short if short else self.x_title

        if self.unit not in (None, "1"):
            title = self.unit_format.format(title=title, unit=self.unit)

        return to_root_latex(title) if root else title
示例#2
0
    def get_full_y_title(self, bin_width=None, short=False, root=ROOT_DEFAULT):
        """
        Returns the full title (i.e. with bin width and unit string) of the y-axis. When not *None*,
        the value *bin_width* instead of the one evaluated from *binning* when even. When *short* is
        *True*, the short version is returned. When *root* is *True*, the title is converted to
        ROOT-style latex.
        """
        title = self.y_title_short if short else self.y_title

        # determine the bin width when not set
        if bin_width is None and self.even_binning:
            bin_width = round(self.bin_width, 2)

        # add bin width and unit to the title
        unit = []
        if self.unit not in (None, "1"):
            unit.append(str(self.unit))
        if bin_width:
            unit.insert(0, str(bin_width))
        if unit:
            title = self.unit_format.format(title=title, unit=" ".join(unit))

        return to_root_latex(title) if root else title
 def full_label_short_root(self):
     return to_root_latex(self.full_label_short)
示例#4
0
 def y_title_short_root(self):
     # y_title_short_root getter
     return to_root_latex(self.y_title_short)
示例#5
0
 def x_title_short_root(self):
     # x_title_short_root getter
     return to_root_latex(self.x_title_short)
示例#6
0
 def x_labels_root(self):
     if self.x_labels is None:
         return None
     else:
         return [to_root_latex(str(label)) for label in self.x_labels]
示例#7
0
 def label_short_root(self):
     # label_short_root getter
     return to_root_latex(self.label_short)