April 2018
Beginner to intermediate
300 pages
7h 34m
English
Bar plots are useful for comparing absolute levels of discrete data series. They are created by the function plt.bar(labels,heights) in Matplotlib. Let's look at the example of the market capitalization of today's much hyped cryptocurrencies. The five top cryptocurrencies in terms of market capitalization are shown here:
import matplotlib.pyplot as plt# Data retrieved from https://coinmarketcap.com on Jan 8, 2018# Prepare the data seriescc = ['BTC','XRP','ETH','BCH','ADA']cap = [282034,131378,107393,49999,26137]# Plot the bar chartplt.bar(cc,cap)plt.title('Market capitalization of five top cryptocurrencies in Jan 2018')plt.xlabel('Crytocurrency')plt.ylabel('Market capitalization (million USD)')plt.show()
We can see from the following ...
Read now
Unlock full access