我使用以下代码绘制散点图,并尝试连接图中的点:
%matplotlib notebook
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
my_df.plot(x='k', y='score', kind = 'scatter', marker = 'x', linestyle='-')
也尝试过:
my_df.plot(x='k', y='score', kind = 'scatter', 'xb-')
但以上都没有。谁知道我错过了什么?谢谢!
答案 0 :(得分:1)
更改marker
kwag,然后移除kind
kwag:
my_df.plot(x='k', y='score', marker='x-')
# removing linestyle is optional. It does not help in this case
答案 1 :(得分:0)
经过一些实验,下面的代码有效:
%matplotlib notebook
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
my_df.plot(x='k', y='score', marker = 'x', color = 'black')