class_docstr: Base class for themes
  
  In general, only complete themes should subclass this class.
  
  Parameters
  ----------
  complete : bool
      Themes that are complete will override any existing themes.
      themes that are not complete (ie. partial) will add to or
      override specific elements of the current theme. e.g:
  
      ```python
      theme_gray() + theme_xkcd()
      ```
  
      will be completely determined by [](`~plotnine.themes.theme_xkcd`),
      but:
  
      ```python
      theme_gray() + theme(axis_text_x=element_text(angle=45))
      ```
  
      will only modify the x-axis text.
  kwargs: dict
      kwargs are :ref:`themeables <themeables>`. The themeables are
      elements that are subclasses of `themeable`. Many themeables
      are defined using theme elements i.e
  
      - [](`~plotnine.themes.element_line`)
      - [](`~plotnine.themes.element_rect`)
      - [](`~plotnine.themes.element_text`)
  
      These simply bind together all the aspects of a themeable
      that can be themed. See [](`~plotnine.themes.themeable.themeable`).
  
  Notes
  -----
  When subclassing, make sure to call :python:`theme.__init__`.
  After which you can customise :python:`self._rcParams` within
  the `__init__` method of the new theme. The `rcParams`
  should not be modified after that.
class_docstr_tok: ["Base","class","for","themes","In","general",",","only","complete","themes","should","subclass","this","class",".","Parameters","--","--","--","--","--","complete",":","bool","Themes","that","are","complete","will","override","any","existing","themes",".","themes","that","are","not","complete","(","ie",".","partial",")","will","add","to","or","override","specific","elements","of","the","current","theme",".","e.g",":","``","`","python","theme_gray","(",")","+","theme_xkcd","(",")","``","`","will","be","completely","determined","by","[","]","(","`","~plotnine.themes.theme_xkcd","`",")",",","but",":","``","`","python","theme_gray","(",")","+","theme","(","axis_text_x=element_text","(","angle=45",")",")","``","`","will","only","modify","the","x-axis","text",".","kwargs",":","dict","kwargs","are",":","ref",":","`","themeables","<","themeables",">","`",".","The","themeables","are","elements","that","are","subclasses","of","`","themeable","`",".","Many","themeables","are","defined","using","theme","elements","i.e","-","[","]","(","`","~plotnine.themes.element_line","`",")","-","[","]","(","`","~plotnine.themes.element_rect","`",")","-","[","]","(","`","~plotnine.themes.element_text","`",")","These","simply","bind","together","all","the","aspects","of","a","themeable","that","can","be","themed",".","See","[","]","(","`","~plotnine.themes.themeable.themeable","`",")",".","Notes","--","--","-","When","subclassing",",","make","sure","to","call",":","python",":","`","theme.__init__","`",".","After","which","you","can","customise",":","python",":","`","self._rcParams","`","within","the","`","__init__","`","method","of","the","new","theme",".","The","`","rcParams","`","should","not","be","modified","after","that","."]
code: def __init__(
      self,
      complete=False,
      # Generate themeables keyword parameters with
      #
      #     from plotnine.themes.themeable import themeable
      #     for name in themeable.registry():
      #         print(f'{name}=None,')
      axis_title_x=None,
      axis_title_y=None,
      axis_title=None,
      legend_title=None,
      legend_text_legend=None,
      legend_text_colorbar=None,
      legend_text=None,
      plot_title=None,
      plot_subtitle=None,
      plot_caption=None,
      strip_text_x=None,
      strip_text_y=None,
      strip_text=None,
      title=None,
      axis_text_x=None,
      axis_text_y=None,
      axis_text=None,
      text=None,
      axis_line_x=None,
      axis_line_y=None,
      axis_line=None,
      axis_ticks_minor_x=None,
      axis_ticks_minor_y=None,
      axis_ticks_major_x=None,
      axis_ticks_major_y=None,
      axis_ticks_major=None,
      axis_ticks_minor=None,
      axis_ticks_x=None,
      axis_ticks_y=None,
      axis_ticks=None,
      panel_grid_major_x=None,
      panel_grid_major_y=None,
      panel_grid_minor_x=None,
      panel_grid_minor_y=None,
      panel_grid_major=None,
      panel_grid_minor=None,
      panel_grid=None,
      line=None,
      legend_key=None,
      legend_background=None,
      legend_box_background=None,
      panel_background=None,
      panel_border=None,
      plot_background=None,
      strip_background_x=None,
      strip_background_y=None,
      strip_background=None,
      rect=None,
      axis_ticks_length_major_x=None,
      axis_ticks_length_major_y=None,
      axis_ticks_length_major=None,
      axis_ticks_length_minor_x=None,
      axis_ticks_length_minor_y=None,
      axis_ticks_length_minor=None,
      axis_ticks_length=None,
      axis_ticks_pad_major_x=None,
      axis_ticks_pad_major_y=None,
      axis_ticks_pad_major=None,
      axis_ticks_pad_minor_x=None,
      axis_ticks_pad_minor_y=None,
      axis_ticks_pad_minor=None,
      axis_ticks_pad=None,
      axis_ticks_direction_x=None,
      axis_ticks_direction_y=None,
      axis_ticks_direction=None,
      panel_spacing_x=None,
      panel_spacing_y=None,
      panel_spacing=None,
      plot_margin_left=None,
      plot_margin_right=None,
      plot_margin_top=None,
      plot_margin_bottom=None,
      plot_margin=None,
      panel_ontop=None,
      aspect_ratio=None,
      dpi=None,
      figure_size=None,
      legend_box=None,
      legend_box_margin=None,
      legend_box_just=None,
      legend_direction=None,
      legend_key_width=None,
      legend_key_height=None,
      legend_key_size=None,
      legend_margin=None,
      legend_box_spacing=None,
      legend_spacing=None,
      legend_position=None,
      legend_title_align=None,
      legend_entry_spacing_x=None,
      legend_entry_spacing_y=None,
      legend_entry_spacing=None,
      strip_align_x=None,
      strip_align_y=None,
      strip_align=None,
      subplots_adjust=None,
      **kwargs,
  ):
      self.themeables = Themeables()
      self.complete = complete
  
      if complete:
          self._rcParams = deepcopy(default_rcparams)
      else:
          self._rcParams = {}
  
      # Themeables
      official_themeables = themeable.registry()
      locals_args = dict(locals())
      it = (
          (name, element)
          for name, element in locals_args.items()
          if element is not None and name in official_themeables
      )
      new = themeable.from_class_name
  
      for name, element in it:
          self.themeables[name] = new(name, element)
  
      # Unofficial themeables (for extensions)
      for name, element in kwargs.items():
          self.themeables[name] = new(name, element)
  
imports: from __future__ import annotations
  import typing
  from copy import copy, deepcopy
  from typing import overload
  from ..exceptions import PlotnineError
  from ..options import get_option, set_option
  from .themeable import Themeables, themeable
label_desc: Use image node_id 1 to create a new theme object  with example: obj = theme(complete, axis_title_x, axis_title_y, axis_title, legend_title, legend_text_legend, legend_text_colorbar, legend_text, plot_title, plot_subtitle, plot_caption, strip_text_x, strip_text_y, strip_text, title, axis_text_x, axis_text_y, axis_text, text, axis_line_x, axis_line_y, axis_line, axis_ticks_minor_x, axis_ticks_minor_y, axis_ticks_major_x, axis_ticks_major_y, axis_ticks_major, axis_ticks_minor, axis_ticks_x, axis_ticks_y, axis_ticks, panel_grid_major_x, panel_grid_major_y, panel_grid_minor_x, panel_grid_minor_y, panel_grid_major, panel_grid_minor, panel_grid, line, legend_key, legend_background, legend_box_background, panel_background, panel_border, plot_background, strip_background_x, strip_background_y, strip_background, rect, axis_ticks_length_major_x, axis_ticks_length_major_y, axis_ticks_length_major, axis_ticks_length_minor_x, axis_ticks_length_minor_y, axis_ticks_length_minor, axis_ticks_length, axis_ticks_pad_major_x, axis_ticks_pad_major_y, axis_ticks_pad_major, axis_ticks_pad_minor_x, axis_ticks_pad_minor_y, axis_ticks_pad_minor, axis_ticks_pad, axis_ticks_direction_x, axis_ticks_direction_y, axis_ticks_direction, panel_spacing_x, panel_spacing_y, panel_spacing, plot_margin_left, plot_margin_right, plot_margin_top, plot_margin_bottom, plot_margin, panel_ontop, aspect_ratio, dpi, figure_size, legend_box, legend_box_margin, legend_box_just, legend_direction, legend_key_width, legend_key_height, legend_key_size, legend_margin, legend_box_spacing, legend_spacing, legend_position, legend_title_align, legend_entry_spacing_x, legend_entry_spacing_y, legend_entry_spacing, strip_align_x, strip_align_y, strip_align, subplots_adjust)