File:M1Czk.svg

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

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

Captions

Captions

M1 for Czech koruna

Summary[edit]

Description
English: M1 for Czech koruna, plotted using the Python code from Plotting code section.
Date
Source Own work
Author Dan Polansky

Licensing[edit]

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.

Plotting code[edit]

from matplotlib import pyplot as plt
import datetime
plotVolumes = True
plot5YRates = True
# Data source: https://fred.stlouisfed.org/series/MANMM101CZM189S
# Monetary Aggregates and Their Components: Narrow Money and Components: M1 and Components: M1 for Czech Republic
inputData = [
  "1992-01-01:299900586309",
  "1993-01-01:327992471007",
  "1994-01-01:397930617923",
  "1995-01-01:460389204558",
  "1996-01-01:505141168003",
  "1997-01-01:510735204451",
  "1998-01-01:462456969714",
  "1999-01-01:474918190185",
  "2000-01-01:560543555662",
  "2001-01-01:627108580315",
  "2002-01-01:729226581281",
  "2003-01-01:829713932183",
  "2004-01-01:955249065459",
  "2005-01-01:1035270929067",
  "2006-01-01:1189629719818",
  "2007-01-01:1354505088788",
  "2008-01-01:1554279670013",
  "2009-01-01:1663630375906",
  "2010-01-01:1764267842161",
  "2011-01-01:2021736629542",
  "2012-01-01:2159948978182",
  "2013-01-01:2343007587057",
  "2014-01-01:2513052291257",
  "2015-01-01:2777038135916",
  "2016-01-01:3120552567448",
  "2017-01-01:3509883450694",
  "2018-01-01:3788613657730"]

dates = []
volumes = []
calcRates = []
for dataRowStr in inputData:
  dataRow = dataRowStr.split(":")
  date = datetime.datetime.strptime(dataRow[0], "%Y-%m-%d").date()
  volume = float(dataRow[1])
  dates.append(date)
  volumes.append(volume)
  if len(volumes) > 5:
    calcRates.append((float(volumes[-1]) / volumes[-1 - 5]) ** (1/5.0))
  else:
    calcRates.append(float("nan"))

if plotVolumes:
  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="M1 (Czech Koruna)",
           title="Czech Koruna M1 (per stlouisfed.org)")
  xtickDates, xtickDatesStr = [], []
  for idx, date in enumerate(dates):
    if date.month == 1 and date.day == 1:
      xtickDates.append(date)
      xtickDatesStr.append(str(date.year))
  plt.xticks(xtickDates, xtickDatesStr, rotation=70)
  plt.plot(dates, volumes, color="#6699CC")
  plt.grid(linewidth=0.25, color="#CCCCCC")
  plt.tight_layout()
  plt.savefig("M1Czk.svg")

if plot5YRates:
  # Plot 5Y average annual rate of change
  fig, biax = plt.subplots()
  figSize = fig.get_size_inches()
  fig.set_size_inches(figSize[0] * 4/3, figSize[1])
  title="Czech Koruna M1\n5-year average of annual rate of change (base data per stlouisfed.org)"
  biax.set(xlabel="Date (label on 1 January)", ylabel="Rate of change", title=title)
  xtickDates = []
  xtickDatesStr = []
  for idx, date in enumerate(dates):
    xtickDates.append(date)
    xtickDatesStr.append(str(date.year))
  plt.xticks(xtickDates, xtickDatesStr, rotation=70)
  plt.axhline(1, color='#BBBBBB', linewidth=0.75)
  plt.plot(dates, calcRates, color="#6699CC")
  plt.grid(linewidth=0.25, color="#DDDDDD")
  values = biax.get_yticks()
  biax.set_yticklabels(['{:,.1%}'.format(x - 1) for x in values])
  plt.tight_layout()
  plt.savefig("M1Czk5YAvgChangeRate.svg")

File history

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

Date/TimeThumbnailDimensionsUserComment
current15:00, 10 April 2024Thumbnail for version as of 15:00, 10 April 2024768 × 432 (56 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