Skip to content
scatter_facets

scatter_facets

Mojo function 🡭

scatter_facets

fn def scatter_facets(df: DataFrame, x: String, y: String, facet: String, color: String = "", facet_order: List[String] = List(), color_order: List[String] = List(), theme: Theme = Theme(WHITE, Color(UInt8(30), UInt8(100), UInt8(180), UInt8(255)), Color(UInt8(80), UInt8(80), UInt8(80), UInt8(255)), Color(UInt8(225), UInt8(225), UInt8(225), UInt8(255)), Color(UInt8(40), UInt8(40), UInt8(40), UInt8(255)), SIMD(12), SIMD(3.5), SIMD(2), Int(60), Int(20), Int(20), Int(50), True, False, False, Color(UInt8(240), UInt8(240), UInt8(240), UInt8(255)), Int(3), Color(UInt8(60), UInt8(110), UInt8(200), UInt8(255)), Color(UInt8(235), UInt8(235), UInt8(235), UInt8(255)), Color(UInt8(220), UInt8(90), UInt8(40), UInt8(255)), ColorRamp(), ColorPalette(), SIMD(3), SIMD(15), True, SIMD(1), Int(0), False, Color(UInt8(200), UInt8(60), UInt8(60), UInt8(255)), Color(UInt8(224), UInt8(224), UInt8(224), UInt8(255)), Color(UInt8(120), UInt8(120), UInt8(120), UInt8(255)), Color(UInt8(100), UInt8(100), UInt8(100), UInt8(255)), Color(UInt8(230), UInt8(230), UInt8(230), UInt8(255)), Color(UInt8(255), UInt8(255), UInt8(255), UInt8(255)), UInt8(90), UInt8(160), False, False, SIMD(0), SIMD(18), SIMD(14), Color(UInt8(110), UInt8(110), UInt8(110), UInt8(255)), SIMD(14), Color(UInt8(150), UInt8(150), UInt8(150), UInt8(255)), Color(UInt8(224), UInt8(236), UInt8(246), UInt8(200)), Color(UInt8(255), UInt8(255), UInt8(255), UInt8(255)), True, False, False, True, AxisPosition.EDGE, AxisPosition.EDGE, String("sans-serif"), True, UInt8(90), Int(5), Int(4), Int(130), Int(14), Int(8), Int(14), Int(100), Int(8), SIMD(4), OutputFormat.SVG, Tooltips.AUTO, Missing.DRAW, String("(missing)"), Int(1000), False, LineStyle.SOLID, SIMD(1.5), LineStyle.SOLID, LegendPosition.RIGHT, XAxisLabelRotation.AUTO, TickFormat.AUTO, TickFormat.AUTO), width: Int = Int(640), height: Int = Int(420)) -> List[AnyChart]

Build grouped scatter panels from named DataFrame columns (#364).

Each facet receives its own rows, title, and x/y column labels. A string color column groups points, with one color map shared by all panels even when a group is absent from some. facet_order and color_order make panel and group colors independent of row order. Pass the returned plots to render_facets() or save_facets().

Args:

  • df (DataFrame): The source frame.
  • x (String): Numeric x column.
  • y (String): Numeric y column.
  • facet (String): String or numeric panel column.
  • color (String): Optional string group column.
  • facet_order (List[String]): Optional explicit panel order.
  • color_order (List[String]): Optional explicit group-color order.
  • theme (Theme): Styling applied to every panel.
  • width (Int): Width of each panel.
  • height (Int): Height of each panel.

Returns:

List[AnyChart]: One plot per present facet level.

Raises:

Error: Unknown or wrong-type columns, mismatched lengths, or an explicit order missing an observed level.