code: def ggplot2():
      # Define colors
      # -------------
      # Based on theme_gray from
      # https://github.com/tidyverse/ggplot2/blob/master/R/theme-defaults.r
  
      # Set colorscale
      # Colors picked using colorpicker from
      # https://ggplot2.tidyverse.org/reference/scale_colour_continuous.html
      colorscale = [[0, "rgb(20,44,66)"], [1, "rgb(90,179,244)"]]
  
      # Hue cycle for 5 categories
      colorway = ["#F8766D", "#A3A500", "#00BF7D", "#00B0F6", "#E76BF3"]
  
      # Set colorbar_common
      # Note the light inward ticks in
      # https://ggplot2.tidyverse.org/reference/scale_colour_continuous.html
      colorbar_common = dict(
          outlinewidth=0,
          tickcolor=colors["gray93"],
          ticks="inside",
          ticklen=6,
      )
  
      # Common axis common properties
      axis_common = dict(
          showgrid=True,
          gridcolor="white",
          linecolor="white",
          tickcolor=colors["gray20"],
          ticks="outside",
          title=dict(standoff=15),
      )
  
      # semi-transparent black and no outline
      shape_defaults = dict(
          fillcolor="black", line={"width": 0}, opacity=0.3
      )
  
      # Remove arrow head and make line thinner
      annotation_defaults = {"arrowhead": 0, "arrowwidth": 1}
  
      template = initialize_template(
          paper_clr="white",
          font_clr=colors["gray20"],
          panel_background_clr=colors["gray93"],
          panel_grid_clr="white",
          axis_ticks_clr=colors["gray20"],
          zerolinecolor_clr="white",
          table_cell_clr=colors["gray93"],
          table_header_clr=colors["gray85"],
          table_line_clr="white",
          colorway=colorway,
          colorbar_common=colorbar_common,
          colorscale=colorscale,
          axis_common=axis_common,
          annotation_defaults=annotation_defaults,
          shape_defaults=shape_defaults,
      )
  
      # Increase grid width for 3d plots
      template.layout.scene.xaxis.gridwidth = 2
      template.layout.scene.yaxis.gridwidth = 2
      template.layout.scene.zaxis.gridwidth = 2
  
      # Automargin for pie chart
      template.data.pie = [{"automargin": True}]
  
      return template
  
file_path: plotly.py/packages/python/plotly/templategen/definitions.py
imports: from plotly.graph_objs.layout import Template
  from templategen.utils import initialize_template
  from .utils.colors import colors
  import colorcet
  import plotly.express
label_desc: Use image node_id 1 for calling a global function with example usage: ggplot2() and returns: template