<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 4 nodes, how can you compute and display the spectral layout of the graph using NetworkX?
### Response:
import networkx as nx

# Create a path graph with 4 nodes
G = nx.path_graph(4)

# Compute the spectral layout of the graph
pos = nx.spectral_layout(G, weight='weight', scale=1, center=None, dim=2)

# Print the positions of each node
for node, p in pos.items():
    print(f'Node {node}: {p}')
<|EOT|>
