9951 explained code solutions for 126 technologies


python-matplotlibErrorbar usage example


import matplotlib.pyplot as plt

x = [2, 6, 15]
y = [20, 9, 15]

x_error = [2, 5.1, 1]

plt.bar(x,y)
plt.errorbar(x, y, xerr = x_error,ecolor = 'maroon',color='red')

plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.bar

will plot bar chart

.errorbar(

plots errorbars

x, y

coordinates to plot errorbars at

x_error

error bars sizes list

.show()

render chart in a separate window


Errorbar usage example, python matplotlib

Usage example

import matplotlib.pyplot as plt

x = [2, 6, 15]
y = [20, 9, 15]

x_error = [2, 5.1, 1]

plt.bar(x,y)
plt.errorbar(x, y, xerr = x_error,ecolor = 'maroon',color='red')

plt.show()