Pinning a node to the Node Editor view

You can select a node and use the hotkey p to pin it so that it stays within the Node Editor view and retains its position and size even after a regraph. indicates that the node is pinned .

Pinning by default

You can select Options > Pin all nodes by default so that any new nodes you create are automatically pinned. You can also select the same option via the work area marking menus.

Pinning/unpinning multiple nodes

You can select multiple nodes and pin or unpin them all at once. Select multiple nodes and then click the hotkey p to toggle between pinning and unpinning. Alternatively, you can also select Edit > Pin or Edit > Unpin.
Tip: If none of the nodes are highlighted (active) in the Node Editor, then clicking the hotkey p or selecting the menu items affects all of the nodes.
Note: If, among your selected nodes, some are pinned and others are not, clicking the hotkey p pins them all.