regelungstechnik.py
def plot(self, pick=None, lim=None):
        """
        Returns matplotlib figure of the step responses.
        """
        fig, ax = plt.subplots(figsize=(8, 4.5), dpi=240)
        fig.subplots_adjust(left=0.125, right=0.925, bottom=0.15, top=0.95)

        steps = np.asarray(self.steps)
        labels = np.asarray(self.labels)
        colors = np.asarray(self.colors)

        canvas = False

        if pick is not None:
            pick = np.asarray(pick, dtype=int)
            if pick.size == 0 or len(steps) == 0:
                canvas = True
            steps = steps[pick]
            labels = labels[pick]
            colors = colors[pick]

        for w, label, color in zip(steps, labels, colors):
            ax.plot(self.time, w, label=label, color=color, linewidth=2)

        ax.set_xlim(self.time[0], self.time[-1])

        if lim is None:
            if canvas:
                lim = [0, 1]
            else:
                v_min = min([step.min() for step in steps])
                v_max = max([step.max() for step in steps])
                lim = [v_min, v_max]

        ax.set_ylim(lim[0], lim[1])

        x_label = r"Time "
        y_label = r"Step Response "

        if self.lang == "DE":
            x_label = r"Zeit "
            y_label = r"Sprungantwort "

        x_label += r"$\ t \ / \ " + self.time_prefix + r"s$"
        y_label += r"$\ w(t)$"

        ax.set_xlabel(x_label)
        ax.set_ylabel(y_label)

        if not canvas:
            ax.legend(loc="upper right")

        ax.grid(b=True, which="both", axis="both")

        return fig

        Returns matplotlib figure of the step responses.
        
Returns matplotlib figure of the step responses.
Returns matplotlib figure of the step responses .
def plot(self, pick=None, lim=None):
        fig, ax = plt.subplots(figsize=(8, 4.5), dpi=240)
        fig.subplots_adjust(left=0.125, right=0.925, bottom=0.15, top=0.95)
        steps = np.asarray(self.steps)
        labels = np.asarray(self.labels)
        colors = np.asarray(self.colors)
        canvas = False
        if pick is not None:
            pick = np.asarray(pick, dtype=int)
            if pick.size == 0 or len(steps) == 0:
                canvas = True
            steps = steps[pick]
            labels = labels[pick]
            colors = colors[pick]
        for w, label, color in zip(steps, labels, colors):
            ax.plot(self.time, w, label=label, color=color, linewidth=2)
        ax.set_xlim(self.time[0], self.time[-1])
        if lim is None:
            if canvas:
                lim = [0, 1]
            else:
                v_min = min([step.min() for step in steps])
                v_max = max([step.max() for step in steps])
                lim = [v_min, v_max]
        ax.set_ylim(lim[0], lim[1])
        x_label = r"Time "
        y_label = r"Step Response "
        if self.lang == "DE":
            x_label = r"Zeit "
            y_label = r"Sprungantwort "
        x_label += r"$\ t \ / \ " + self.time_prefix + r"s$"
        y_label += r"$\ w(t)$"
        ax.set_xlabel(x_label)
        ax.set_ylabel(y_label)
        if not canvas:
            ax.legend(loc="upper right")
        ax.grid(b=True, which="both", axis="both")
        return fig
def plot ( self , pick = None , lim = None ) : fig , ax = plt . subplots ( figsize = ( 8 , 4.5 ) , dpi = 240 ) fig . subplots_adjust ( left = 0.125 , right = 0.925 , bottom = 0.15 , top = 0.95 ) steps = np . asarray ( self . steps ) labels = np . asarray ( self . labels ) colors = np . asarray ( self . colors ) canvas = False if pick is not None : pick = np . asarray ( pick , dtype = int ) if pick . size == 0 or len ( steps ) == 0 : canvas = True steps = steps [ pick ] labels = labels [ pick ] colors = colors [ pick ] for w , label , color in zip ( steps , labels , colors ) : ax . plot ( self . time , w , label = label , color = color , linewidth = 2 ) ax . set_xlim ( self . time [ 0 ] , self . time [ - 1 ] ) if lim is None : if canvas : lim = [ 0 , 1 ] else : v_min = min ( [ step . min ( ) for step in steps ] ) v_max = max ( [ step . max ( ) for step in steps ] ) lim = [ v_min , v_max ] ax . set_ylim ( lim [ 0 ] , lim [ 1 ] ) x_label = r"Time " y_label = r"Step Response " if self . lang == "DE" : x_label = r"Zeit " y_label = r"Sprungantwort " x_label += r"$\ t \ / \ " + self . time_prefix + r"s$" y_label += r"$\ w(t)$" ax . set_xlabel ( x_label ) ax . set_ylabel ( y_label ) if not canvas : ax . legend ( loc = "upper right" ) ax . grid ( b = True , which = "both" , axis = "both" ) return fig
Returns matplotlib figure of the step responses.
Returns matplotlib figure of the step responses .
"""
        Returns matplotlib figure of the step responses.
        """
self
pick
lim