File:EcbMlfRate.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 768 × 432 pixels, file size: 66 KB)

Captions

Captions

European central bank - marginal lending facility interest rate

Summary[edit]

Description
English: European central bank - marginal lending facility interest rate, plotted using the Python code in a dedicated section.
Date
Source Own work
Author Dan Polansky

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Plotting code[edit]

from matplotlib import pyplot as plt
import datetime
plotDepositRate = False
inputData = [
  # From https://www.ecb.europa.eu/stats/policy_and_exchange_rates/key_ecb_interest_rates/html/index.en.html
  # Date (with effect from): Deposit facility : Marginal lending facility
  "20 Sep 2023:4.00:4.75",
  "2 Aug 2023:3.75:4.50",
  "21 Jun 2023:3.50:4.25",
  "10 May 2023:3.25:4.00",
  "22 Mar 2023:3.00:3.75",
  "8 Feb 2023:2.50:3.25",
  "21 Dec 2022:2.00:2.75",
  "2 Nov 2022:1.50:2.25",
  "14 Sep 2022:0.75:1.50",
  "27 Jul 2022:0.00:0.75",
  "18 Sep 2019:-0.50:0.25",
  "16 Mar 2016:-0.40:0.25",
  "9 Dec 2015:-0.30:0.30",
  "10 Sep 2014:-0.20:0.30",
  "11 Jun 2014:-0.10:0.40",
  "13 Nov 2013:0.00:0.75",
  "8 May 2013:0.00:1.00",
  "11 Jul 2012:0.00:1.50",
  "14 Dec 2011:0.25:1.75",
  "9 Nov 2011:0.50:2.00",
  "13 Jul 2011:0.75:2.25",
  "13 Apr 2011:0.50:2.00",
  "13 May 2009:0.25:1.75",
  "8 Apr 2009:0.25:2.25",
  "11 Mar 2009:0.50:2.50",
  "21 Jan 2009:1.00:3.00",
  "10 Dec 2008:2.00:3.00",
  "12 Nov 2008:2.75:3.75",
  "15 Oct 2008:3.25:4.25",
  "9 Oct 2008:3.25:4.25",
  "8 Oct 2008:2.75:4.75",
  "9 Jul 2008:3.25:5.25",
  "13 Jun 2007:3.00:5.00",
  "14 Mar 2007:2.75:4.75",
  "13 Dec 2006:2.50:4.50",
  "11 Oct 2006:2.25:4.25",
  "9 Aug 2006:2.00:4.00",
  "15 Jun 2006:1.75:3.75",
  "8 Mar 2006:1.50:3.50",
  "6 Dec 2005:1.25:3.25",
  "6 Jun 2003:1.00:3.00",
  "7 Mar 2003:1.50:3.50",
  "6 Dec 2002:1.75:3.75",
  "9 Nov 2001:2.25:4.25",
  "18 Sep 2001:2.75:4.75",
  "31 Aug 2001:3.25:5.25",
  "11 May 2001:3.50:5.50",
  "6 Oct 2000:3.75:5.75",
  "1 Sep 2000:3.50:5.50",
  "28 Jun 2000:3.25:5.25",
  "9 Jun 2000:3.25:5.25",
  "28 Apr 2000:2.75:4.75",
  "17 Mar 2000:2.50:4.50",
  "4 Feb 2000:2.25:4.25",
  "5 Nov 1999:2.00:4.00",
  "9 Apr 1999:1.50:3.50",
  "22 Jan 1999:2.00:4.50",
  "4 Jan 1999:2.75:3.25",
  "1 Jan 1999:2.00:4.50"]
inputData.reverse()

dates = []
rates = []
depositRates = []
for dataRowStr in inputData:
  dataRow = dataRowStr.split(":")
  date = datetime.datetime.strptime(dataRow[0], "%d %b %Y").date()
  depositRate = float(dataRow[1]) # Deposit facility rate
  rate = float(dataRow[2]) # Marginal lending facility rate
  dates.append(date)
  rates.append(rate)
  depositRates.append(depositRate)

fig, biax = plt.subplots()
figSize = fig.get_size_inches()#_
fig.set_size_inches(figSize[0] * 4/3, figSize[1])
biax.set(xlabel="Date (Label on 1 January)", ylabel="Interest rate",
         title="European Central Bank - marginal lending facility interest rate")
years = sorted({date.year for date in dates})
years = range(years[0], years[-1] + 1)
xtickDates, xtickDatesStr = [], []
for idx, year in enumerate(years):
  date = datetime.datetime.strptime("1 Jan " + str(year), "%d %b %Y").date()
  xtickDates.append(date)
  xtickDatesStr.append(str(date.year))
plt.xticks(xtickDates, xtickDatesStr, rotation=70)
plt.plot(dates, rates, "o-", color="#6699CC", markersize="3")
if plotDepositRate:
  plt.plot(dates, depositRates, "o-", markersize="3")
plt.grid(linewidth=0.25, color="#CCCCCC")
biax.set_yticklabels(['{:.1f}%'.format(x) for x in biax.get_yticks()])
plt.tight_layout()
plt.savefig("EcbMlfRate.svg")

File history

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

Date/TimeThumbnailDimensionsUserComment
current08:19, 29 March 2024Thumbnail for version as of 08:19, 29 March 2024768 × 432 (66 KB)Dan Polansky (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata