# Plot

Visualize a dataset flexibly, depending on axes and metrics chosen

## Parameters

| Name         | Type              | Description                                                                                                                                                                                                                                                           | Is Optional |
| ------------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| x\_axis      | x\_axis           | X-axis by which to view your data. Can be categorical, datetime, or numeric. If categorical, will output a bar chart. If datetime or numerical, will result in a line chart. Includes 'timeseries\_options' for timeseries axis and 'bucket\_count' for numeric axis. |             |
| aggregations | column\_agg\_list | numeric, quantitative values that you can measure                                                                                                                                                                                                                     |             |
| filters      | filter\_list      | Filter logic on one or more columns. Can choose between a simple comparison filter or advanced filter using free text.                                                                                                                                                | True        |
| dimensions   | column\_list      | Categorical column(s) by which to pivot the calculated metrics. Including this argument will generate a new metric calculation for each distinct value in the group by column. If this column has more than 20 distinct values, the plot will not generate.           | True        |

## Example

```python
ds = rasgo.get.dataset(id)

ds2 = ds.aggregate_plot(
  x_axis={
      'column': 'ORDERDATE',
      'type': 'timeseries',
      'timeseries_options': {
          'start_date': '2021-02-01',
          'end_date': '2021-03-01',
          'time_grain': 'day',
      }
  }, aggregations= {
      'RAINFALL': ['SUM', 'AVG'],
      'SNOWFALL': ['SUM', 'AVG']
  })
ds2.preview()
```

## Source Code

{% embed url="<https://github.com/rasgointelligence/RasgoTransforms/blob/main/rasgotransforms/rasgotransforms/transforms/plot/plot.sql>" %}


---

# 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://docs.rasgoml.com/rasgo-docs/rasgo-0.1/all-transforms/plot.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.
