Python Forum

Full Version: Smooth curve in matplotlib
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
suppose I have the following dataset as represented in the code.
This dataset is coming from measurements which are sometimes inconsistent and there are some "peaks" in the curve.
Is there any way to smoothe the curve?

import matplotlib as mpl

from matplotlib import pyplot as plt

y = [ 0.008000000000000002, 0.007600000000000001,  0.010200000000000002,  0.010100000000000001,  0.0097,  0.010299999999999998,  0.0113]
x = [10, 20, 40, 80, 160, 320, 640]

plt.rc('font', family='serif', size='10')

fig, ax1 = plt.subplots()
ax1.plot(x,y,linewidth=1)

ax1.set_xscale('log')
ax1.set_yscale('log')
plt.show()