October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code plots a sine wave and annotates a point on the graph in both data and display co-ordinates:
fig = plt.figure()ax = fig.add_subplot(111)
theta = np.linspace(0, 2*np.pi, 128)y = np.sin(theta)ax.plot(theta, y, 'r-*')
xdata, ydata = 3, 0xdisplay, ydisplay = ax.transData.transform_point((xdata, ydata))
bbox = dict(boxstyle="round", fc="1.0")
arrowprops = dict(arrowstyle="->", ...
Read now
Unlock full access