Created
November 22, 2020 15:14
Create a plot from the getmempoolinfo RPC histogram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import json | |
with open('mempool.json') as f: | |
data = json.load(f) | |
widths = [] | |
feerates = [] | |
count = [] | |
for rate in data['fee_histogram']: | |
if rate == 'total_fees': | |
continue | |
feerates.append(rate) | |
count.append(data['fee_histogram'][rate]['count']) | |
widths.append(1) | |
plt.xscale('linear') | |
plt.bar(feerates, count, widths, align='edge') | |
plt.xlabel('feerate') | |
plt.ylabel('count') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment