diff --git a/spatialpy/core/domain.py b/spatialpy/core/domain.py index cdb033bf..f7529929 100644 --- a/spatialpy/core/domain.py +++ b/spatialpy/core/domain.py @@ -571,6 +571,9 @@ def plot_types(self, width=None, height=None, colormap=None, size=None, title=No :returns: Plotly figure of domain types if, use_matplotlib=False and return_plotly_figure=True :rtype: None or dict ''' + if len(self.vertices) == 0: + raise DomainError("The domain does not contain particles.") + from spatialpy.core.result import _plotly_iterate # pylint: disable=import-outside-toplevel if not use_matplotlib: