> For the complete documentation index, see [llms.txt](https://docs.zama.org/concrete/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/concrete/2.7-1/execution-analysis/other/formatting_and_drawing.md).

# Formatting and drawing

## Formatting

You can convert your compiled circuit into its textual representation by converting it to string:

```python
str(circuit)
```

If you just want to see the output on your terminal, you can directly print it as well:

```python
print(circuit)
```

{% hint style="warning" %}
Formatting is just for debugging purposes. It's not possible to create the circuit back from its textual representation. See [How to Deploy](/concrete/2.7-1/guides/deploy.md) if that's your goal.
{% endhint %}

## Drawing

{% hint style="danger" %}
Drawing functionality requires the installation of the package with the full feature set. See the [Installation](/concrete/2.7-1/get-started/installing.md) section to learn how to do that.
{% endhint %}

You can use the `draw` method of your compiled circuit to draw it:

```python
drawing = circuit.draw()
```

This method will draw the circuit on a temporary PNG file and return the path to this file.

You can show the drawing in a Jupyter notebook, like this:

```python
from PIL import Image
drawing = Image.open(circuit.draw())
drawing.show()
drawing.close()
```

Or, you can use the `show` option of the `draw` method to show the drawing with `matplotlib`.

```python
circuit.draw(show=True)
```

{% hint style="danger" %}
Beware that this will clear the matplotlib plots you have.
{% endhint %}

Lastly, you can save the drawing to a specific path:

```python
destination = "/tmp/path/of/your/choice.png"
drawing = circuit.draw(save_to=destination)
assert drawing == destination
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.zama.org/concrete/2.7-1/execution-analysis/other/formatting_and_drawing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
