# Plot

By creating an `index.html` file in the correct directory, an interactive plot can be created. The easiest way to create an interactive plot is to use [Plotly](https://plotly.com/), but you can also handcraft an HTML file as long as the file is placed in:

{% hint style="info" %}
`{ARTIFACT_FOLDER}/index.html`
{% endhint %}

#### Plotly

Following is an example using Plotly:

```python
import polars as pl
import plotly.express as px
import os

def transform():
    # example data
    df = pl.DataFrame({
        "Category": ["Group A", "Group B", "Group C", "Group D"],
        "Value": [45, 72, 38, 91]
    })
    
    # Generate the bar chart using Plotly
    fig = px.bar(df.to_pandas(), x="Category", y="Value", title="Simple Bar Chart")
    
    # Save the chart as HTML
    fig.write_html(f"{os.environ['ARTIFACT_FOLDER']}/index.html")
    
    return df
```

<figure><img src="/files/kO6bAADI2FQbBEEBcrXx" alt=""><figcaption></figcaption></figure>


---

# 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.dataspace.ch/platform/transformation/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.
