#6. Scatter Plot #Scatter plots are used to visualize relationships between two variables. # Example: Scatter plot of Sales vs. Profit profit = [4000, 6000, 7000, 3000, 5000, 8000] plt.scatter(sales, profit, color='green') plt.title("Sales vs. Profit") plt.xlabel("Sales ($)") plt.ylabel("Profit ($)") plt.show()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter