#2. Bar Plot #Bar plots are used to compare different categories. # Example: Bar plot for Sales by Region regions = ["North", "East", "West", "South"] sales_by_region = [25000, 31000, 17000, 19000] plt.bar(regions, sales_by_region, color='red') plt.title("Sales by Region") plt.xlabel("Region") plt.ylabel("Sales ($)") 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