code: def sampling_vertex_dp(n):
      """
      Simplify a polyline using the Douglas-Peucker algorithm.
  
      Parameters
      ----------
      n : int
          Number of items to return.
  
      Returns
      -------
      `FeatureSpec`
          Vertices sample specification.
  
      Notes
      -----
      Vertex sampling is designed for polygon simplification.
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 17
  
          import numpy as np
          from scipy.stats import multivariate_normal
          from lets_plot import *
          LetsPlot.setup_html()
          np.random.seed(42)
          n = 300
          x = np.linspace(-1, 1, n)
          y = np.linspace(-1, 1, n)
          X, Y = np.meshgrid(x, y)
          mean = np.zeros(2)
          cov = [[1, .5],
                 [.5, 1]]
          rv = multivariate_normal(mean, cov)
          Z = rv.pdf(np.dstack((X, Y)))
          data = {'x': X.flatten(), 'y': Y.flatten(), 'z': Z.flatten()}
          ggplot(data, aes(x='x', y='y', z='z')) + \\
              geom_contour(sampling=sampling_vertex_dp(100))
  
      """
      return _sampling("vertex_dp", n=n)
  
file_path: lets-plot/python-package/lets_plot/plot/sampling.py
imports: from .core import FeatureSpec
label_desc: Use image node_id 8 for calling a global function with example usage: sampling_vertex_dp(n) and returns: _sampling