使用 Matplotlib 如何在最终图中突出显示一个点

using Matplotlib how to highlight one point in the final plot

假设,我有x = [1,2,3,4,5,6]和相应的y = [3,4,5,6,7,8]

我想要第一双 (1,3) 颜色或形状不同。

如何使用 python 完成此操作?

最简单的答案之一。

import matplotlib.pyplot as plt

x = [1,2,3,4,5,6]
y = [3,4,5,6,7,8]

plt.plot(x[1:], y[1:], 'ro')
plt.plot(x[0], y[0], 'g*')

plt.show()