Matplotlib Labels and Title

import matplotlib.pyplot as plt

# Sample data
x = [1, 2, 3, 4, 5]
y = [2, 3, 5, 7, 11]

# Create the plot
plt.plot(x, y)

# Add title and labels
plt.title("Simple Line Plot")
plt.xlabel("X Axis")
plt.ylabel("Y Axis")

# Show the plot
plt.show()
import matplotlib.pyplot as plt

# Sample data
x = [1, 2, 3, 4, 5]
y = [2, 3, 5, 7, 11]

# Create the plot
plt.plot(x, y)

# Add title and labels with customization
plt.title("Simple Line Plot", fontsize=14, fontweight='bold', color='blue')
plt.xlabel("X Axis", fontsize=12, color='green')
plt.ylabel("Y Axis", fontsize=12, color='green')

# Show the plot
plt.show()
import matplotlib.pyplot as plt

# Sample data
x = [1, 2, 3, 4, 5]
y = [2, 3, 5, 7, 11]

# Create the plot
plt.plot(x, y, label='Prime Numbers', color='purple', marker='o')

# Add title and labels with customization
plt.title("Simple Line Plot", fontsize=14, fontweight='bold', color='blue')
plt.xlabel("X Axis", fontsize=12, color='green')
plt.ylabel("Y Axis", fontsize=12, color='green')

# Add grid
plt.grid(True)

# Add legend
plt.legend(loc='upper left')

# Add annotation
plt.annotate('Max Value', xy=(5, 11), xytext=(4, 10),
             arrowprops=dict(facecolor='black', shrink=0.05))

# Show the plot
plt.show()