Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I draw an errorbar graph without lines and points in Matplotlib?

I am currently using the following code to plot errorbar graphs.

plt.errorbar(log_I_mean_, log_V2_mean_, xerr, yerr, '.')

However, the end result shows a circular point in the center of each errorbar intersection point. How can I plot just the errorbars without the central point, as is required in scientific work?

like image 797
FreelanceConsultant Avatar asked Oct 24 '25 10:10

FreelanceConsultant


1 Answers

use 'none' instead of '.':

import matplotlib.pyplot as plt

x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)

yerr = 0.1 + 0.2*np.sqrt(x)
xerr = 0.1 + yerr

plt.figure()
plt.errorbar(x, y, 0.2, 0.4,'none')
plt.title("Simplest errorbars, 0.2 in x, 0.4 in y")

result:

enter image description here

P.S. this is slightly modified version of part of the example of pylab here

like image 81
Kennet Celeste Avatar answered Oct 26 '25 00:10

Kennet Celeste



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!