コード例 #1
0
    def lactations(self):
        """Plot lactations of ``cow`` together."""

        for lact in sorted(mongo.lacts(self.cow)):
            prods = mongo.prods(self.cow, lact)
            days = mongo.days(self.cow, lact)

            plt.plot(days, prods, label="{}".format(lact))

        plt.xlabel(self.DAY_LABEL)
        plt.ylabel(self.PROD_LABEL)
        plt.legend()

        with self.doc.create(pylatex.Section('Lactations')):
            self.add_plot()
コード例 #2
0
ファイル: crude.py プロジェクト: tartopum/MPF
    def lactations(self):
        """Plot lactations of ``cow`` together."""

        for lact in sorted(mongo.lacts(self.cow)):
            prods = mongo.prods(self.cow, lact)
            days = mongo.days(self.cow, lact)

            plt.plot(days, prods, label="{}".format(lact))

        plt.xlabel(self.DAY_LABEL)
        plt.ylabel(self.PROD_LABEL)
        plt.legend()

        with self.doc.create(pylatex.Section('Lactations')):
            self.add_plot()
コード例 #3
0
    def lactation(self, lact):
        """Plot lactation ``lact``.

        :param lact: The lactation of the cow to be plotted.
        :type lact: int
        """

        plt.xlabel(self.DAY_LABEL)
        plt.ylabel(self.PROD_LABEL)
        plt.xlim(xmax=self.MIN_DAY_RANGE)

        prods = mongo.prods(self.cow, lact)
        days = mongo.days(self.cow, lact)
        plt.plot(days, prods)

        with self.doc.create(pylatex.Section('Lactation {}'.format(lact))):
            self.add_plot()
コード例 #4
0
ファイル: crude.py プロジェクト: tartopum/MPF
    def lactation(self, lact):
        """Plot lactation ``lact``.

        :param lact: The lactation of the cow to be plotted.
        :type lact: int
        """

        plt.xlabel(self.DAY_LABEL)
        plt.ylabel(self.PROD_LABEL)
        plt.xlim(xmax=self.MIN_DAY_RANGE)

        prods = mongo.prods(self.cow, lact)
        days = mongo.days(self.cow, lact)
        plt.plot(days, prods)

        with self.doc.create(pylatex.Section('Lactation {}'.format(lact))):
            self.add_plot()