Matplotlib – python – put markers on a curve

# put handles on the curve

import numpy as np
import matplotlib.pyplot as plt
from pdb import set_trace

x = np.linspace(0, np.pi, 200)
y = np.sin(x)

ymax = np.max(y)
yind = np.argmax(y)

fix, ax = plt.subplots()

#ax.plot(x, y, 'o',ls='-',  markevery=5)
ax.plot(x, y, '-gD',  markevery=[50, yind, 150])
plt.show()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s