How would I go about adding specific data points to a line chart through pandas/matplotlib?
This is what i have now:
And this is what i would like to do:
Cheers.
How would I go about adding specific data points to a line chart through pandas/matplotlib?
This is what i have now:
And this is what i would like to do:
Cheers.
matplotlib.pyplot.annotate() can be used to annotate (add a string) to a particular point. For example:
import matplotlib.pyplot as plt
plt.scatter([1, 2, 3], [4, 5, 6])
plt.annotate("X", (1, 4))
plt.annotate("Z", (3, 6))
plt.show()
you can address a specific data point on a chart using the index value. Remember the list is ordered from 0-X (i.e the first in your list = 0 and so on )
This function plots a blue square at point x,y where x is the data point first in the list =0 and y =0
fig.square(
x_vals_ideal_projection[0], y_vals_ideal_projection[0],
fill_alpha=0, size=8, color='blue',
legend_label="Projected Counts Burndown if wk 39 = 15 ")