code: def subgraph(self, vertices):
          r
          adjacency = self.W[vertices, :][:, vertices]
          try:
              coords = self.coords[vertices]
          except AttributeError:
              coords = None
          graph = Graph(adjacency, self.lap_type, coords, self.plotting)
          for name, signal in self.signals.items():
              graph.set_signal(signal[vertices], name)
          return graph
docs: r"""Create a subgraph from a list of vertices.
  
          Parameters
          ----------
          vertices : list
              Vertices to keep.
              Either a list of indices or an indicator function.
  
          Returns
          -------
          subgraph : :class:`Graph`
              Subgraph.
  
          Examples
          --------
          >>> graph = graphs.Graph([
          ...     [0., 3., 0., 0.],
          ...     [3., 0., 4., 0.],
          ...     [0., 4., 0., 2.],
          ...     [0., 0., 2., 0.],
          ... ])
          >>> graph = graph.subgraph([0, 2, 1])
          >>> graph.W.toarray()
          array([[0., 0., 3.],
                 [0., 0., 4.],
                 [3., 4., 0.]])