> For the complete documentation index, see [llms.txt](https://ezel.rustic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ezel.rustic.dev/basics/1.-getting-started.md).

# 1. Getting Started

### Setup

```toml
[dependencies]
ezel = "*"
```

### Simple Plot

```rust
fn main() {
  let plot = ezel::Cartesian2::new();
  plot.x_axis.label = Some("X axis".to_string());
  plot.y_axis.label = Some("Y value".to_string());
  plot.scatter(Data2{});
  plot.save_to_file("example.png").unwrap();
}
```

### Multi Plot

```rust
use piet::Color;

fn main() {
  let node1 = plot_example1();
  let node2 = {
    let mut node = ezel::Grid::new();
    node.push(0, 0, plot_example2());
    node.push_side(0, 0, Side::TopLeft, ezel::PlainBox::new(Color::GREEN));
  };
  let node0 = ezel::Grid::new();
  node0.push(0, 0, node1);
  node0.push(0, 1, node2);
  node0.save_to_file("example.png").unwrap();
}
```

### GG (Grammar of Graphics) API

```rust
use ezel::gg;

fn main() {
    let df: polars::DataFrame = ..;
    let plot = gg::Plot::new()
        .data(df)
        .geometry(gg::Geometry::Line)
        .map_x("column1")
        .map_y("column2")
        .map_color("column1")
        .theme(gg::Theme::Matplotlib)
        .build();
    plot.save_to_file("example.png");
}
```
