Using Matplotlib, how to highlight one point in the final plot

Suppose I have x = [1,2,3,4,5,6] and the corresponding y = [3,4,5,6,7,8] .

I want the first pair (1,3) in a different color or shape.

How to do it with python?

+5
source share
1 answer

One of the easiest possible answers.

 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() 
+5
source

Source: https://habr.com/ru/post/1262374/


All Articles