# 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");
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ezel.rustic.dev/basics/1.-getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
