1edcc86eb40c55259fff85ec4e14b4373a6bb589,nilmtk/metergroup.py,MeterGroup,plot,#MeterGroup#,1132

Before Change


        
        // Get start and end times for the plot
        start = convert_to_timestamp(start)
        end = convert_to_timestamp(end)
        if start is None or end is None:
            timeframe_for_group = self.get_timeframe()
            if start is None:
                start = timeframe_for_group.start
            if end is None:
                end = timeframe_for_group.end
        timeframe = TimeFrame(start, end)

        // Calculate the resolution for the x axis
        duration = (end - start).total_seconds()
        secs_per_pixel = int(round(duration / width))

        // Define a resample function
        resample_func = lambda df: pd.DataFrame.resample(
            df, rule="{:d}S".format(secs_per_pixel))

        // Load data and plot each meter
        for meter in self.meters:
            power_series = meter.power_series_all_data(
                sections=[timeframe], preprocessing=[Apply(func=resample_func)])
            ax = plot_series(power_series, ax=ax, label=meter.appliance_label())

        if plot_legend:
            plt.legend()

After Change



            ax = kwargs.pop("ax", None)
            for meter in self.meters:
                ax = meter.plot(start=start, end=end, ax=ax, plot_legend=False, 
                                **kwargs)

            if kwargs.pop("plot_legend", True):
                plt.legend()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilmtk/nilmtk
Commit Name: 1edcc86eb40c55259fff85ec4e14b4373a6bb589
Time: 2014-12-09
Author: jack-list@xlk.org.uk
File Name: nilmtk/metergroup.py
Class Name: MeterGroup
Method Name: plot


Project Name: havakv/pycox
Commit Name: d9f4448777a924ed71d82bf84eda6bb88fd96641
Time: 2018-03-13
Author: kvamme@samba8.ad.nr.no
File Name: pycox/callbacks.py
Class Name: PlotProgress
Method Name: on_epoch_end


Project Name: suavecode/SUAVE
Commit Name: 4233250171080006377b8226799730b51723e183
Time: 2019-03-19
Author: mclarke2@stanford.edu
File Name: trunk/SUAVE/Plots/Mission_Plots.py
Class Name:
Method Name: plot_flight_conditions