Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple curve smoothing in matplotlib --- equivalent to gnuplot's "smooth bezier"?

I have a set of points I want to plot in matplotlib, say:

x = [1,4,6,7,8]
y = [0.2, 0.4, 0.5, 0.6, 0.6]

In gnuplot, I used to be able to directly use the 'plot' command's smooth property to get a smooth curve on a graph, without having to preprocess the data.

Is there an equivalent in matplotlib---specify a set of points, and tell it how to smooth it, bezier or spline or something like that?

If not, what is the easiest way of accomplishing this?

like image 903
Pier1 Sys Avatar asked Mar 10 '11 05:03

Pier1 Sys


1 Answers

I think scipy's interpolation and curve-fitting functions are the closest you are going to get. I don't know of anything built into matplotlib.

like image 59
Paul Avatar answered Oct 22 '22 04:10

Paul