I'm trying to draw a curve for regression fitting. The curve is for a higher degree polynomial ( 6 and above ).
fig=figure()
ax1=fig.add_axes((0.1,0.2,0.8,0.7))
ax1.set_title("Training data(blue) and fitting curve(red)")
ax1.set_xlabel('X-axis')
ax1.set_ylabel('Y-axis')
ax1.plot(x_train,y_train,'.',x_train,np.polyval(best_coef,x_train),'-r')
show()
This is the output of the given code
I want it to be a smooth curve.
something like this , with a continues red line , instead of discreet point of red
best_coefcome from?? Did you write this?