我对python geom\u line属性中的ggplot有问题。它没有应用程序

2024-06-16 14:09:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我在使用python plotplot库绘制lineplot时遇到问题。 我试过几何点和几何线,只有几何线有问题。你知道吗

final_result = [['head', 'male', 11.880583171300556],
 ['head', 'female', 9.181195949641543],
 ['neck', 'male', 18.288218605326048],
 ['neck', 'female', 15.433385591728676],
 ['body_top_shoulder', 'male', 45.77760065998323],
 ['body_top_shoulder', 'female', 42.10334644289686],
 ['body_top_chest', 'male', 56.85636914401857],
 ['body_top_chest', 'female', 52.15933846772258],
 ['body_bottom_waist', 'male', 54.095350745146995],
 ['body_bottom_waist', 'female', 53.50202259687758],
 ['body_bottom_stomach', 'male', 47.01293142732554],
 ['body_bottom_stomach', 'female', 45.1689572636577],
 ['leg', 'male', 28.401324830736257],
 ['leg', 'female', 27.098990036947185],
 ['foot', 'male', 44.07241779487932],
 ['foot', 'female', 43.98427730736562],
 ['arm', 'male', 34.73054349834513],
 ['arm', 'female', 34.12618814855175],
 ['hand', 'male', 45.986212053884465],
 ['hand', 'female', 44.406541536658914]]

result_data = pd.DataFrame(final_result, columns=['part', 'gender', 'RMSE'])

(ggplot(result_data, aes(x='part', y='RMSE', color='gender'))
 + geom_point()
 + geom_line()
 + theme(text=element_text(family='LG PC'),
        axis_text_x=element_text(size=10, angle = 90, vjust=1))
)

结果,geom_point()工作了,但geom_line没有出现。问题出在哪里??你知道吗


Tags: texttopbodyresultheadmalefemalefinal