Untitled
unknown
plain_text
9 months ago
899 B
0
Indexable
# Plot the function plt.figure(figsize=(8, 6)) plt.plot(x, y, label='$y = x^2 + 4x + 3$') plt.scatter([-2, 0, -1, -3], [-1, 3, 0, 0], color='red') # Vertex, y-intercept, and x-intercepts plt.text(-2, -1, 'Vertex (-2, -1)', fontsize=9, verticalalignment='bottom', horizontalalignment='right') plt.text(0, 3, 'Y-intercept (0, 3)', fontsize=9, verticalalignment='bottom', horizontalalignment='right') plt.text(-1, 0, 'X-intercept (-1, 0)', fontsize=9, verticalalignment='bottom', horizontalalignment='right') plt.text(-3, 0, 'X-intercept (-3, 0)', fontsize=9, verticalalignment='bottom', horizontalalignment='right') plt.axhline(0, color='black',linewidth=0.5) plt.axvline(0, color='black',linewidth=0.5) plt.grid(color = 'gray', linestyle = '--', linewidth = 0.5) plt.legend() plt.title('Graph of $y = x^2 + 4x + 3$') plt.xlabel('$x$') plt.ylabel('$y$') plt.ylim(-10, 10) plt.xlim(-10, 10) plt.show()
Editor is loading...
Leave a Comment