class_docstr: Base class for all discrete scales
  
  Parameters
  ----------
  {superclass_parameters}
  limits : array_like, default=None
      Limits of the scale. For scales that deal with
      categoricals, these may be a subset or superset of
      the categories. Data values that are not in the limits
      will be treated as missing data and represented with
      the `na_value`.
  drop : bool, default=True
      Whether to drop unused categories from
      the scale
  na_translate : bool, default=True
      If `True` translate missing values and show them.
      If `False` remove missing values. Default value is
      `True`
  na_value : object
      If `na_translate=True`, what aesthetic value should be
      assigned to the missing values. This parameter does not
      apply to position scales where `nan` is always placed
      on the right.
class_docstr_tok: ["Base","class","for","all","discrete","scales","Parameters","--","--","--","--","--","{","superclass_parameters","}","limits",":","array_like",",","default=None","Limits","of","the","scale",".","For","scales","that","deal","with","categoricals",",","these","may","be","a","subset","or","superset","of","the","categories",".","Data","values","that","are","not","in","the","limits","will","be","treated","as","missing","data","and","represented","with","the","`","na_value","`",".","drop",":","bool",",","default=True","Whether","to","drop","unused","categories","from","the","scale","na_translate",":","bool",",","default=True","If","`","True","`","translate","missing","values","and","show","them",".","If","`","False","`","remove","missing","values",".","Default","value","is","`","True","`","na_value",":","object","If","`","na_translate=True","`",",","what","aesthetic","value","should","be","assigned","to","the","missing","values",".","This","parameter","does","not","apply","to","position","scales","where","`","nan","`","is","always","placed","on","the","right","."]
docstr: Information about the trained scale
docstr_tok: ["Information","about","the","trained","scale"]
code: def view(
      self,
      limits: Optional[ScaleDiscreteLimits] = None,
      range: Optional[CoordRange] = None,
  ) -> scale_view:
      """
      Information about the trained scale
      """
      if limits is None:
          limits = self.limits
  
      if range is None:
          range = self.dimension(limits=limits)
  
      breaks_d = self.get_breaks(limits)
      breaks = self.map(pd.Categorical(breaks_d))
      minor_breaks = []
      labels = self.get_labels(breaks_d)
  
      sv = scale_view(
          scale=self,
          aesthetics=self.aesthetics,
          name=self.name,
          limits=limits,
          range=range,
          breaks=breaks,
          labels=labels,
          minor_breaks=minor_breaks,
      )
      return sv
  
imports: from __future__ import annotations
  import typing
  import numpy
  import pandas
  from mizani.bounds import expand_range_distinct
  from .._utils import match
  from ..doctools import document
  from ..iapi import range_view, scale_view
  from ._expand import expand_range
  from .range import RangeDiscrete
  from .scale import scale
label_desc: Use image node_id 7 for calling the scale_discrete obj's underlying member method code with example usage: obj.view(limits, range) and returns: sv