class_docstr: Create a scatter plot.
  
  Preprocessing: this component does *not* accept input.
  Postprocessing: expects a pandas dataframe with the data to plot.
  
  Demos: scatter_plot
  Guides: creating-a-dashboard-from-bigquery-data
docstr: Helper for creating the scatter plot.
docstr_tok: ["Helper","for","creating","the","scatter","plot","."]
code: def create_plot(
      value: pd.DataFrame,
      x: str,
      y: str,
      color: str | None = None,
      size: str | None = None,
      shape: str | None = None,
      title: str | None = None,
      tooltip: list[str] | str | None = None,
      x_title: str | None = None,
      y_title: str | None = None,
      x_label_angle: float | None = None,
      y_label_angle: float | None = None,
      color_legend_title: str | None = None,
      size_legend_title: str | None = None,
      shape_legend_title: str | None = None,
      color_legend_position: Literal[
          "left",
          "right",
          "top",
          "bottom",
          "top-left",
          "top-right",
          "bottom-left",
          "bottom-right",
          "none",
      ]
      | None = None,
      size_legend_position: Literal[
          "left",
          "right",
          "top",
          "bottom",
          "top-left",
          "top-right",
          "bottom-left",
          "bottom-right",
          "none",
      ]
      | None = None,
      shape_legend_position: Literal[
          "left",
          "right",
          "top",
          "bottom",
          "top-left",
          "top-right",
          "bottom-left",
          "bottom-right",
          "none",
      ]
      | None = None,
      height: int | None = None,
      width: int | None = None,
      x_lim: list[int | float] | None = None,
      y_lim: list[int | float] | None = None,
      interactive: bool | None = True,
  ):
      """Helper for creating the scatter plot."""
      interactive = True if interactive is None else interactive
      encodings = {
          "x": alt.X(
              x,  # type: ignore
              title=x_title or x,  # type: ignore
              scale=AltairPlot.create_scale(x_lim),  # type: ignore
              axis=alt.Axis(labelAngle=x_label_angle)
              if x_label_angle is not None
              else alt.Axis(),
          ),  # ignore: type
          "y": alt.Y(
              y,  # type: ignore
              title=y_title or y,  # type: ignore
              scale=AltairPlot.create_scale(y_lim),  # type: ignore
              axis=alt.Axis(labelAngle=y_label_angle)
              if y_label_angle is not None
              else alt.Axis(),
          ),
      }
      properties = {}
      if title:
          properties["title"] = title
      if height:
          properties["height"] = height
      if width:
          properties["width"] = width
      if color:
          if is_numeric_dtype(value[color]):
              domain = [value[color].min(), value[color].max()]
              range_ = [0, 1]
              type_ = "quantitative"
          else:
              domain = value[color].unique().tolist()
              range_ = list(range(len(domain)))
              type_ = "nominal"
  
          encodings["color"] = {
              "field": color,
              "type": type_,
              "legend": AltairPlot.create_legend(
                  position=color_legend_position,
                  title=color_legend_title or color,
              ),
              "scale": {"domain": domain, "range": range_},
          }
      if tooltip:
          encodings["tooltip"] = tooltip
      if size:
          encodings["size"] = {
              "field": size,
              "type": "quantitative"
              if is_numeric_dtype(value[size])
              else "nominal",
              "legend": AltairPlot.create_legend(
                  position=size_legend_position,
                  title=size_legend_title or size,
              ),
          }
      if shape:
          encodings["shape"] = {
              "field": shape,
              "type": "quantitative"
              if is_numeric_dtype(value[shape])
              else "nominal",
              "legend": AltairPlot.create_legend(
                  position=shape_legend_position,
                  title=shape_legend_title or shape,
              ),
          }
      chart = (
          alt.Chart(value)  # type: ignore
          .mark_point(clip=True)  # type: ignore
          .encode(**encodings)
          .properties(background="transparent", **properties)
      )
      if interactive:
          chart = chart.interactive()
  
      return chart
  
file_path: gradio/gradio/components/scatter_plot.py
imports: from __future__ import annotations
  from typing import Any, Callable, Literal
  import altair
  import pandas
  from gradio_client.documentation import document, set_documentation_group
  from pandas.api.types import is_numeric_dtype
  from gradio.components.plot import AltairPlot, AltairPlotData, Plot
label_desc: Use image node_id 3 for calling the ScatterPlot obj's underlying member method code with example usage: obj.create_plot(value, x, y, color, size, shape, title, tooltip, x_title, y_title, x_label_angle, y_label_angle, color_legend_title, size_legend_title, shape_legend_title, color_legend_position, size_legend_position, shape_legend_position, height, width, x_lim, y_lim, interactive) and returns: chart