# Pin nodes offset

**URL:** <https://forum.graphviz.org/t/pin-nodes-offset/1244>\
**Category:** Uncategorized\
**Created:** [July 4, 2022, 6:03am UTC](https://forum.graphviz.org/t/pin-nodes-offset/1244 "2022-07-04T06:03:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [July 5, 2022, 6:19pm UTC](https://forum.graphviz.org/t/pin-nodes-offset/1244/4 "2022-07-05T18:19:51Z")

</div>

Possibilities:

- Place each molecule in its own cluster, and use cluster labels for the text (text _outside_ molecule). Easy, but not packed as densely. (p.s. possibly set peripheries=0)
- Text on-top-of molecule. Here pinned nodes will work.
  - put each molecule in its own subgraph (not cluster, though cluster also works)
  - add desired text to subgraph with “fake” attribute name `{graph [mytext="read me"] ...}`
  - run through **neato** with output format = _dot_. This effectively pins _all_ nodes and edges.
  - postprocess to determine center of each molecule (of all nodes within a subgraph)
  - create new node for each subgraph centered with label=mytext and style=plaintext
  - run through `neato -n2`
  - OK not trivial, but not _that_ hard. Though text-over-molecule might not be readable

- Use the **tooltip** attribute to place your text. Only helps if the user knows about it. Does not support (visual) search.
- “Inside”, hmmm. I don’t know a way to find an inside of a graph - unless circo or twopi are used. I need help on this one.

---

_[View the full topic](https://forum.graphviz.org/t/pin-nodes-offset/1244)._
