def Plot(self, nodes, ctxs):
        progress_dlg = None
        start_date = None
        end_date = None

        assert len(nodes) == len(ctxs)

        # callback called by 'run'
        def callback(date, ctx):
            days_left = (date - start_date).days
            keep_going, skip = progress_dlg.Update(days_left)
            if not keep_going:
                raise StopIteration

        dlg = RunToDialog(self,
                            "Plot...",
                            start_date=self._last_selected_start_date,
                            end_date=self._last_selected_end_date)

        dlg.CenterOnScreen()
        if wx.ID_OK == dlg.ShowModal():
            # create a date range inclusive of the end date
            start_date, end_date = dlg.GetDates()
            date_range = pd.bdate_range(start_date, end_date)

            self._last_selected_start_date = start_date
            self._last_selected_end_date = end_date

            # create a progress dialog
            maximum = max(1, (end_date - start_date).days)
            progress_dlg = wx.ProgressDialog("Please wait...",
                                             "Calculating nodes",
                                             maximum=maximum,
                                             style=wx.PD_CAN_ABORT
                                                    | wx.PD_ELAPSED_TIME
                                                    | wx.PD_REMAINING_TIME
                                                    | wx.PD_AUTO_HIDE)


            # create the dataframe builder
            df_builder = DataFrameBuilder(nodes, contexts=ctxs, filter=True)

            # and run through that date range using the builder
            self.GetStatusBar().SetStatusText("Calculating...")
            try:
                with self.UpdatingGuard(self):
                    run(date_range, [callback, df_builder], ctx=ctxs[0].get_parent() or ctxs[0])

                # create the new plot panel
                df = df_builder.dataframe.fillna(method="ffill")
                panel = PlotPanel(self, [df])
                self._mgr.AddPane(panel, aui.AuiPaneInfo().
                                            Caption("Plot").
                                            Center().
                                            Float().
                                            FloatingSize((800,600)))
                self._mgr.Update()
            except StopIteration:
                pass
            except Exception, e:
                traceback.print_tb(sys.exc_traceback)
                msg = wx.MessageDialog(self, str(e), "An error occurred",  wx.OK | wx.ICON_ERROR)
                msg.ShowModal()
                msg.Destroy()

            progress_dlg.Update(maximum)
            self.GetStatusBar().SetStatusText("Ready")

        dlg.Destroy()
        self.RefreshAll()
dataset/ETHPy150Open manahl/mdf/mdf/viewer/frame.py/MDFViewerFrame.Plot/original