Ejemplo n.º 1
0
    def plot(self, rankdir='LR', prog=None, wrap=10, ax=None):
        """Plot image using dot.

        No file I/O involved.
        Requires GraphViz dot and either Matplotlib or IPython.

        NetworkX does not yet support plotting multiple edges between 2 nodes.
        This method fixes that issue, so users don't need to look at files
        in a separate viewer during development.

        See Also
        ========
        L{save}

        Depends
        =======
        dot and either of IPython or Matplotlib
        """
        # anything to plot ?
        if not self.states:
            print(
                60 * '!' +
                "\nThe system doesn't have any states to plot.\n" +
                60 * '!')
            return
        if prog is None:
            prog = self.default_layout
        from tulip.transys.export import graph2dot
        return graph2dot.plot_pydot(self, prog, rankdir, wrap, ax=ax)
Ejemplo n.º 2
0
    def plot(self, rankdir='LR', prog=None, wrap=10, ax=None):
        """Plot image using dot.

        No file I/O involved.
        Requires GraphViz dot and either Matplotlib or IPython.

        NetworkX does not yet support plotting multiple edges between 2 nodes.
        This method fixes that issue, so users don't need to look at files
        in a separate viewer during development.

        See Also
        ========
        L{save}

        Depends
        =======
        dot and either of IPython or Matplotlib
        """
        # anything to plot ?
        if not self.states:
            print(
                60 * '!' +
                "\nThe system doesn't have any states to plot.\n" +
                60 * '!')
            return
        if prog is None:
            prog = self.default_layout
        from tulip.transys.export import graph2dot
        return graph2dot.plot_pydot(self, prog, rankdir, wrap, ax=ax)