def plot(self, to_file=None):
    '\n        Create a UML diagram-ish graph of the EntitySet.\n\n        Args:\n            to_file (str, optional) : Path to where the plot should be saved.\n                If set to None (as by default), the plot will not be saved.\n\n        Returns:\n            graphviz.Digraph : Graph object that can directly be displayed in\n                Jupyter notebooks.\n\n        '
    GRAPHVIZ_ERR_MSG = (('Please install graphviz to plot entity sets.' + ' (See https://docs.featuretools.com/en/stable/getting_started/install.html#installing-graphviz for') + ' details)')
    graphviz = import_or_raise('graphviz', GRAPHVIZ_ERR_MSG)
    try:
        graphviz.Digraph().pipe()
    except graphviz.backend.ExecutableNotFound:
        raise RuntimeError(((((('To plot entity sets, a graphviz backend is required.\n' + 'Install the backend using one of the following commands:\n') + '  Mac OS: brew install graphviz\n') + '  Linux (Ubuntu): sudo apt-get install graphviz\n') + '  Windows: conda install python-graphviz\n') + '  For more details visit: https://docs.featuretools.com/en/stable/getting_started/install.html'))
    if to_file:
        to_file = str(to_file)
        split_path = to_file.split('.')
        if (len(split_path) < 2):
            raise ValueError(("Please use a file extension like '.pdf'" + ' so that the format can be inferred'))
        format = split_path[(- 1)]
        valid_formats = graphviz.backend.FORMATS
        if (format not in valid_formats):
            raise ValueError(('Unknown format. Make sure your format is' + (' amongst the following: %s' % valid_formats)))
    else:
        format = None
    graph = graphviz.Digraph(self.id, format=format, graph_attr={'splines': 'ortho'})
    for entity in self.entities:
        variables_string = '\\l'.join([((var.id + ' : ') + var.type_string) for var in entity.variables])
        nrows = entity.shape[0]
        label = ('{%s (%d row%s)|%s\\l}' % (entity.id, nrows, ('s' * (nrows > 1)), variables_string))
        graph.node(entity.id, shape='record', label=label)
    for rel in self.relationships:
        if (rel._parent_variable_id == rel._child_variable_id):
            label = rel._parent_variable_id
        else:
            label = ('%s -> %s' % (rel._parent_variable_id, rel._child_variable_id))
        graph.edge(rel._child_entity_id, rel._parent_entity_id, xlabel=label)
    if to_file:
        offset = (len(format) + 1)
        output_path = to_file[:(- offset)]
        graph.render(output_path, cleanup=True)
    return graph
Create a UML diagram-ish graph of the EntitySet.

Args:
    to_file (str, optional) : Path to where the plot should be saved.
        If set to None (as by default), the plot will not be saved.

Returns:
    graphviz.Digraph : Graph object that can directly be displayed in
        Jupyter notebooks.
def plot(self, to_file=None):
    '\n        Create a UML diagram-ish graph of the EntitySet.\n\n        Args:\n            to_file (str, optional) : Path to where the plot should be saved.\n                If set to None (as by default), the plot will not be saved.\n\n        Returns:\n            graphviz.Digraph : Graph object that can directly be displayed in\n                Jupyter notebooks.\n\n        '
    GRAPHVIZ_ERR_MSG = (('Please install graphviz to plot entity sets.' + ' (See https://docs.featuretools.com/en/stable/getting_started/install.html#installing-graphviz for') + ' details)')
    graphviz = import_or_raise('graphviz', GRAPHVIZ_ERR_MSG)
    try:
        graphviz.Digraph().pipe()
    except graphviz.backend.ExecutableNotFound:
        raise RuntimeError(((((('To plot entity sets, a graphviz backend is required.\n' + 'Install the backend using one of the following commands:\n') + '  Mac OS: brew install graphviz\n') + '  Linux (Ubuntu): sudo apt-get install graphviz\n') + '  Windows: conda install python-graphviz\n') + '  For more details visit: https://docs.featuretools.com/en/stable/getting_started/install.html'))
    if to_file:
        to_file = str(to_file)
        split_path = to_file.split('.')
        if (len(split_path) < 2):
            raise ValueError(("Please use a file extension like '.pdf'" + ' so that the format can be inferred'))
        format = split_path[(- 1)]
        valid_formats = graphviz.backend.FORMATS
        if (format not in valid_formats):
            raise ValueError(('Unknown format. Make sure your format is' + (' amongst the following: %s' % valid_formats)))
    else:
        format = None
    graph = graphviz.Digraph(self.id, format=format, graph_attr={'splines': 'ortho'})
    for entity in self.entities:
        variables_string = '\\l'.join([((var.id + ' : ') + var.type_string) for var in entity.variables])
        nrows = entity.shape[0]
        label = ('{%s (%d row%s)|%s\\l}' % (entity.id, nrows, ('s' * (nrows > 1)), variables_string))
        graph.node(entity.id, shape='record', label=label)
    for rel in self.relationships:
        if (rel._parent_variable_id == rel._child_variable_id):
            label = rel._parent_variable_id
        else:
            label = ('%s -> %s' % (rel._parent_variable_id, rel._child_variable_id))
        graph.edge(rel._child_entity_id, rel._parent_entity_id, xlabel=label)
    if to_file:
        offset = (len(format) + 1)
        output_path = to_file[:(- offset)]
        graph.render(output_path, cleanup=True)
    return graph