1
У меня есть этот код:Как установить xlim в python matplotlib pyplot?
import matplotlib.pyplot as pl
pl.plot(np.log(alphas_lasso),coefs_lasso.T) #this generate a plot which xlim=[-8,-2]
for alpha in alpha_min:
pl.axvline(np.log(alpha),0,1) #add vertical line for every value of alpha
pl.xlim([-10,0]) # the xlim value I would like to set
pl.xlabel('Log(alpha)')
pl.ylabel('coefficients')
pl.title('Lasso Path')
pl.axis('tight')
pl.show()
print "log(alpha_min)=",log(alpha_min)
Он работает, но ось й переходит от -8 до -2, а я хотел бы от -10 до 0 Где ошибка?