How to plot one single data point?

前端 未结 4 585
旧时难觅i
旧时难觅i 2020-12-28 12:46

I have the following code to plot a line and a point:

df = pd.DataFrame({\'x\': [1, 2, 3], \'y\': [3, 4, 6]})
point = pd.DataFrame({\'x\': [2], \'y\': [5]})
         


        
4条回答
  •  死守一世寂寞
    2020-12-28 13:34

    To plot a single point you can do something like this:

    plt.plot([x], [y], marker='o', markersize=3, color="red")
    

提交回复
热议问题