code: def configure_cartesian_marginal_axes(args, fig, orders):
      if "histogram" in [args["marginal_x"], args["marginal_y"]]:
          fig.layout["barmode"] = "overlay"
  
      nrows = len(fig._grid_ref)
      ncols = len(fig._grid_ref[0])
  
      # Set y-axis titles and axis options in the left-most column
      for yaxis in fig.select_yaxes(col=1):
          set_cartesian_axis_opts(args, yaxis, "y", orders)
  
      # Set x-axis titles and axis options in the bottom-most row
      for xaxis in fig.select_xaxes(row=1):
          set_cartesian_axis_opts(args, xaxis, "x", orders)
  
      # Configure axis ticks on marginal subplots
      if args["marginal_x"]:
          fig.update_yaxes(
              showticklabels=False,
              showline=False,
              ticks="",
              range=None,
              row=nrows,
          )
          if args["template"].layout.yaxis.showgrid is None:
              fig.update_yaxes(
                  showgrid=args["marginal_x"] == "histogram", row=nrows
              )
          if args["template"].layout.xaxis.showgrid is None:
              fig.update_xaxes(showgrid=True, row=nrows)
  
      if args["marginal_y"]:
          fig.update_xaxes(
              showticklabels=False,
              showline=False,
              ticks="",
              range=None,
              col=ncols,
          )
          if args["template"].layout.xaxis.showgrid is None:
              fig.update_xaxes(
                  showgrid=args["marginal_y"] == "histogram", col=ncols
              )
          if args["template"].layout.yaxis.showgrid is None:
              fig.update_yaxes(showgrid=True, col=ncols)
  
      # Add axis titles to non-marginal subplots
      y_title = get_decorated_label(args, args["y"], "y")
      if args["marginal_x"]:
          fig.update_yaxes(title_text=y_title, row=1, col=1)
      else:
          for row in range(1, nrows + 1):
              fig.update_yaxes(title_text=y_title, row=row, col=1)
  
      x_title = get_decorated_label(args, args["x"], "x")
      if args["marginal_y"]:
          fig.update_xaxes(title_text=x_title, row=1, col=1)
      else:
          for col in range(1, ncols + 1):
              fig.update_xaxes(title_text=x_title, row=1, col=col)
  
      # Configure axis type across all x-axes
      if "log_x" in args and args["log_x"]:
          fig.update_xaxes(type="log")
  
      # Configure axis type across all y-axes
      if "log_y" in args and args["log_y"]:
          fig.update_yaxes(type="log")
  
      # Configure matching and axis type for marginal y-axes
      matches_y = "y" + str(ncols + 1)
      if args["marginal_x"]:
          for row in range(2, nrows + 1, 2):
              fig.update_yaxes(matches=matches_y, type=None, row=row)
  
      if args["marginal_y"]:
          for col in range(2, ncols + 1, 2):
              fig.update_xaxes(matches="x2", type=None, col=col)
  
imports: import plotly.graph_objs
  import plotly.io
  from collections import namedtuple, OrderedDict
  from ._special_inputs import IdentityMap, Constant, Range
  from .trendline_functions import ols, lowess, rolling, expanding, ewm
  from _plotly_utils.basevalidators import ColorscaleValidator
  from plotly.colors import qualitative, sequential
  import math
  from packaging import version
  import pandas
  import numpy
  from plotly._subplots import make_subplots, _set_trace_grid_reference, _subplot_type_for_trace_type
label_desc: Use image node_id 11 for calling a global function with example usage: configure_cartesian_marginal_axes(args, fig, orders) without return types