Jump to content

File:Bitcoin electricity consumption.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 810 × 630 pixels, file size: 412 KB)

Summary

Description
English: Bitcoin electricity consumption based on data from the University of Cambridge (Source: Cambridge Bitcoin Electricity Consumption Index. https://cbeci.org/). This plot is an updated SVG replacement for File:Bitcoin electricity consumption.png. (The country equivalents in the old plot have been left out as requested at Commons:Graphic_Lab/Illustration_workshop#Bitcoin_annualized_electricity_consumption.)
Date
Source

Own work

Data sources:

Author Morn
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

Source code
from pylab import *
from datetime import datetime, timezone

mi, ma, gu, t = [], [], [], []
matplotlib.rcParams.update({'font.size': 16})

# CSV file from https://ccaf.io/cbeci/api/v1.4.0/download/data?price=0.05
f = open("export.csv")
for num, l in enumerate(f.readlines()):
    if num < 2: continue
    x = l.split(",")
    ts = int(x[0])
    d = datetime.fromtimestamp(ts, timezone.utc)
    t.append(d)
    ma.append(float(x[5]))
    mi.append(float(x[6]))
    gu.append(float(x[7]))

figure(figsize = (9, 7))
fill_between(t, mi, ma, color = "#d8d8d8")
plot(t, ma, label = "Upper bound" , lw = 3.5, c = "#1829af", alpha = .5)
plot(t, mi, label = "Lower bound" , lw = 3.5, c = "#18af23", alpha = .5)
plot(t, gu, label = "Estimate", lw = 5.5, c = "#af2318")

# Estimate is drawn last (so that it is not obscured by the other curves),
# but it should come in _second_ place in the legend, so shuffle legend order accordingly:
handles, labels = gca().get_legend_handles_labels()
order = [0, 2, 1]
legend([handles[idx] for idx in order], [labels[idx] for idx in order], loc = "upper left")

xlabel("Year")
ylabel("[TWh]")
title("Bitcoin annualized electricity consumption")
axis([datetime(2016, 1, 1), datetime(2024, 1, 1), 0, 500])
grid()
gca().tick_params(axis = "both", pad = 14)
gca().set_position([.15, .15, .8, .75])
text(datetime(2024, 1, 1), -90, 'Source: University of Cambridge', va = 'bottom', ha = 'right' , size = 14)
savefig("Bitcoin electricity consumption.svg")

show()
This file may be updated to reflect new information.
If you wish to use a specific version of the file without it being overwritten, please upload the required version as a separate file.

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

9 December 2023

image/svg+xml

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current10:42, 10 December 2023Thumbnail for version as of 10:42, 10 December 2023810 × 630 (412 KB)Mornchange labels in legend
17:11, 9 December 2023Thumbnail for version as of 17:11, 9 December 2023810 × 630 (412 KB)MornUploaded own work with UploadWizard

Global file usage

The following other wikis use this file:

Metadata