Skip to content
Snippets Groups Projects
schedule.py 37.2 KiB
Newer Older
  • Learn to ignore specific revisions
  •         Create a Figure and an Axes and plot schedule in the Axes.
    
            Parameters
            ----------
            operation_gap : float, optional
    
                The vertical distance between operations in the schedule. The height of
                the operation is always 1.
    
            The Matplotlib Figure.
    
            fig, ax = plt.subplots()
    
            self._plot_schedule(ax, operation_gap=operation_gap)
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
            return fig
    
        def _repr_svg_(self) -> str:
    
            Generate an SVG of the schedule. This is automatically displayed in e.g.
            Jupyter Qt console.
    
            fig, ax = plt.subplots()
            self._plot_schedule(ax)
    
            buffer = io.StringIO()
            fig.savefig(buffer, format="svg")
    
            return buffer.getvalue()