# Plot text from \`Inputs.text()\`

**URL:** <https://talk.observablehq.com/t/plot-text-from-inputs-text/8161>\
**Category:** Help\
**Created:** [August 8, 2023, 9:26am UTC](https://talk.observablehq.com/t/plot-text-from-inputs-text/8161 "2023-08-08T09:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erdirstats](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/erdirstats/32/7607_2.png) [@erdirstats](https://talk.observablehq.com/u/erdirstats)\
**Post date:** [August 8, 2023, 9:26am UTC](https://talk.observablehq.com/t/plot-text-from-inputs-text/8161/1 "2023-08-08T09:26:22Z")

</div>

Hi,

I would like to plot some text from `Inputs.text()`. Notebook here: [Plot text from Inputs.text() / Erdi | Observable](https://observablehq.com/d/0c85127564e2d540)

The text shows up in plot but letters overlap. Anyone can help with this?

Thank you!

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [August 8, 2023, 9:42am UTC](https://talk.observablehq.com/t/plot-text-from-inputs-text/8161/2 "2023-08-08T09:42:27Z")

</div>

> [@erdirstats](#):
>
> The text shows up in plot but letters overlap. Anyone can help with this?

Try this:

```
    Plot.text([text], {x: 220, y: 3500, fontSize: 25})

```

Note the square brackets: `[text]`, as opposed to just `text` in your notebook

### Why?

Generally, `Plot` marks accept [iterables](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) as their first argument so that they can plot a whole list of items in one step. Now, your `text` variable is a string, which is iterable, and the individual characters in the string are the items. Thus, those characters are all plotted at the some spot, namely `{x: 220, y: 3500}`. Wrapping `text` in brackets changes the iterable to an array whose single data point is the string that you want.

---

<div class="post-metadata">

**Author:** ![erdirstats](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/erdirstats/32/7607_2.png) [@erdirstats](https://talk.observablehq.com/u/erdirstats)\
**Post date:** [August 8, 2023, 10:01am UTC](https://talk.observablehq.com/t/plot-text-from-inputs-text/8161/3 "2023-08-08T10:01:09Z")

</div>

😍 Thanks so much (for the solution and also for the context)!
