<｜begin▁of▁sentence｜>### Instruction:
Given a path graph with 5 nodes, how do you draw it using a spectral layout with NetworkX and display it with Matplotlib?
### Response:
import networkx as nx
import matplotlib.pyplot as plt

# Create a NetworkX graph
G = nx.path_graph(5)

# Draw the graph using a spectral layout
nx.draw_spectral(G)

# Show the plot
plt.show()
<|EOT|>
