code: def test_2D_density_all_args(self):
      # check if 2D_density data matches with expected output
      x = [1, 2]
      y = [2, 4]
  
      colorscale = [
          "#7A4579",
          "#D56073",
          "rgb(236,158,105)",
          (1, 1, 0.2),
          (0.98, 0.98, 0.98),
      ]
  
      test_2D_density_chart = ff.create_2d_density(
          x,
          y,
          colorscale=colorscale,
          hist_color="rgb(255,237,222)",
          point_size=3,
          height=800,
          width=800,
      )
  
      exp_2D_density_chart = {
          "data": [
              {
                  "marker": {
                      "color": "rgb(0, 0, 128)",
                      "opacity": 0.4,
                      "size": 3,
                  },
                  "mode": "markers",
                  "name": "points",
                  "type": "scatter",
                  "x": [1, 2],
                  "y": [2, 4],
              },
              {
                  "colorscale": [
                      [0.0, "rgb(122, 69, 121)"],
                      [0.25, "rgb(213, 96, 115)"],
                      [0.5, "rgb(236, 158, 105)"],
                      [0.75, "rgb(255, 255, 51)"],
                      [1.0, "rgb(250, 250, 250)"],
                  ],
                  "name": "density",
                  "ncontours": 20,
                  "reversescale": True,
                  "showscale": False,
                  "type": "histogram2dcontour",
                  "x": [1, 2],
                  "y": [2, 4],
              },
              {
                  "marker": {"color": "rgb(255, 237, 222)"},
                  "name": "x density",
                  "type": "histogram",
                  "x": [1, 2],
                  "yaxis": "y2",
              },
              {
                  "marker": {"color": "rgb(255, 237, 222)"},
                  "name": "y density",
                  "type": "histogram",
                  "xaxis": "x2",
                  "y": [2, 4],
              },
          ],
          "layout": {
              "autosize": False,
              "bargap": 0,
              "height": 800,
              "hovermode": "closest",
              "margin": {"t": 50},
              "showlegend": False,
              "title": {"text": "2D Density Plot"},
              "width": 800,
              "xaxis": {
                  "domain": [0, 0.85],
                  "showgrid": False,
                  "zeroline": False,
              },
              "xaxis2": {
                  "domain": [0.85, 1],
                  "showgrid": False,
                  "zeroline": False,
              },
              "yaxis": {
                  "domain": [0, 0.85],
                  "showgrid": False,
                  "zeroline": False,
              },
              "yaxis2": {
                  "domain": [0.85, 1],
                  "showgrid": False,
                  "zeroline": False,
              },
          },
      }
  
      self.assert_fig_equal(
          test_2D_density_chart["data"][0],
          exp_2D_density_chart["data"][0],
      )
  
      self.assert_fig_equal(
          test_2D_density_chart["data"][1],
          exp_2D_density_chart["data"][1],
      )
  
      self.assert_fig_equal(
          test_2D_density_chart["data"][2],
          exp_2D_density_chart["data"][2],
      )
  
      self.assert_fig_equal(
          test_2D_density_chart["data"][3],
          exp_2D_density_chart["data"][3],
      )
  
      self.assert_fig_equal(
          test_2D_density_chart["layout"],
          exp_2D_density_chart["layout"],
      )
  
imports: import math
  from unittest import TestCase
  import datetime
  import plotly.figure_factory
  import plotly.io
  from plotly.exceptions import PlotlyError
  from plotly.tests.test_optional.optional_utils import NumpyTestUtilsMixin
  from plotly.graph_objs import graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 2 for calling the Test2D_Density obj's underlying member method code with example usage: obj.test_2D_density_all_args() without return types