code: def guide_legend(nrow=None, ncol=None, byrow=None):
      """
      Legend guide.
  
      Parameters
      ----------
      nrow : int
          Number of rows in legend's guide.
      ncol : int
          Number of columns in legend's guide.
      byrow : bool, default=True
          Type of output: by row, or by column.
  
      Returns
      -------
      `FeatureSpec`
          Legend guide specification.
  
      Notes
      -----
      Legend type guide shows key (i.e., geoms) mapped onto values.
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 11
  
          import numpy as np
          from lets_plot import *
          LetsPlot.setup_html()
          n = 100
          np.random.seed(42)
          x = np.random.uniform(size=n)
          y = np.random.uniform(size=n)
          c = np.random.choice(list('abcdefgh'), size=n)
          ggplot({'x': x, 'y': y, 'c': c}, aes('x', 'y')) + \\
              geom_point(aes(shape='c'), size=4, alpha=.7) + \\
              scale_shape(guide=guide_legend(nrow=3))
  
      """
      return _guide("legend", **locals())
  
imports: from .core import FeatureSpec
label_desc: Use image node_id 1 for calling a global function with example usage: guide_legend(nrow, ncol, byrow) and returns: _guide