<｜begin▁of▁sentence｜>### Instruction:
Given a rainbow palette of 10 colors, can you plot these colors on a matplotlib axis to visualize the gradient?
### Response:
from igraph.drawing.colors import RainbowPalette
import matplotlib.pyplot as plt

# Initialize a rainbow palette
color_palette = RainbowPalette(n=10)

# Create a figure and axis for plotting
fig, ax = plt.subplots()

# Plot the colors of the palette
for i, color in enumerate(color_palette):
    ax.add_patch(plt.Rectangle((i, 0), 1, 1, color=color))

# Adjust the plot
ax.set_xlim(0, 10)
ax.set_ylim(0, 1)
plt.axis('off')

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