Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: How can you create error bars in a Matplotlib plot?
Answer: Use the `plt.errorbar()` function to create a plot with error bars.

Example:

x = [1, 2, 3, 4]
y = [10, 20, 25, 30]
error = [1, 2, 1, 3]
plt.errorbar(x, y, yerr=error, fmt='o', capsize=5)
plt.show()
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook