Опция geom_smooth отсутствует в ggplot из python
Я пытаюсь сделать заговор, используя ggplot в python. Когда я пытаюсь запустить, я получаю сообщение об ошибке
ggplot(data,aes(x='Average Credit Card Transaction',y='response'))+\
geom_smooth(se=False,span=0.2)+xlab("Average Credit Card Transaction")+\
ylab('Response')+\
ggtitle('Partial Dependence Plot \n Response Vs Average Credit Card transactions')
NameError: name 'geom_smooth' is not defined
Все остальное работает. Это была ошибка, которая была исправлена в более поздних версиях?
1 ответ
Ты можешь попробовать stat_smooth
вместо (показано с mtcars
набор данных):
from ggplot import *
ggplot(mtcars, aes('mpg', 'qsec')) + \
geom_point(colour='red') + \
stat_smooth(colour='blue', se=False, span=0.2) + \
ggtitle("mtcars stat_smooth")