Skip to content

Commit dc7294f

Browse files
committed
minor edits and set standard figsize
1 parent 3d1348d commit dc7294f

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lectures/inflation_history.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ We start by installing a library we will use followed by importing some Python m
5757
```{code-cell} ipython3
5858
import numpy as np
5959
import pandas as pd
60+
import matplotlib
61+
matplotlib.rcParams['figure.figsize'] = (12, 10)
6062
import matplotlib.pyplot as plt
6163
import matplotlib.dates as mdates
6264
```
@@ -89,7 +91,7 @@ df_fig5_bef1914 = df_fig5[df_fig5.index <= 1915]
8991
# create plot
9092
cols = ['UK', 'US', 'France', 'Castile']
9193
92-
fig, ax = plt.subplots(figsize=[8, 5], dpi=200)
94+
fig, ax = plt.subplots(dpi=200)
9395
9496
for col in cols:
9597
ax.plot(df_fig5_bef1914.index,
@@ -156,7 +158,7 @@ mystnb:
156158
caption: "Long run time series of the price level (log)"
157159
name: lrpl_lg
158160
---
159-
fig, ax = plt.subplots(figsize=[8, 5], dpi=200)
161+
fig, ax = plt.subplots(dpi=200)
160162
161163
for col in cols:
162164
ax.plot(df_fig5.index, df_fig5[col])
@@ -207,7 +209,7 @@ from chapter 3 of {cite}`sargent2013rational`.
207209
Data underlying our graphs appear in tables in an appendix to chapter 3 of {cite}`sargent2013rational`.
208210
We have transcribed all of these data into a spreadsheet `chapter_3.xls` that we read into pandas.
209211

210-
In the code cell below we clean this data build a `pandas.dataframe`.
212+
In the code cell below we clean the data and build a `pandas.dataframe`.
211213

212214
```{code-cell} ipython3
213215
:tags: [hide-input]
@@ -268,8 +270,8 @@ def process_df(df):
268270
return df
269271
```
270272

271-
Now we write plotting functions so we can make plots of the price level and exchange rates,
272-
in addition to a plot of inflation rates, for each country of interest.
273+
Now we write plotting functions so we can plot the price level and exchange rates,
274+
and inflation rates, for each country of interest.
273275

274276
```{code-cell} ipython3
275277
:tags: [hide-input]
@@ -412,7 +414,7 @@ e_seq = df_Aus['Exchange Rate']
412414
lab = ['Retail Price Index', 'Exchange Rate']
413415
414416
# create plot
415-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
417+
fig, ax = plt.subplots(dpi=200)
416418
_ = pe_plot(p_seq, e_seq, df_Aus.index, lab, ax)
417419
418420
# connect disjunct parts
@@ -430,7 +432,7 @@ mystnb:
430432
name: inflationrate_austria
431433
---
432434
# plot moving average
433-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
435+
fig, ax = plt.subplots(dpi=200)
434436
_ = pr_plot(p_seq, df_Aus.index, ax)
435437
436438
plt.figtext(0.5, -0.02, 'Austria',
@@ -468,7 +470,7 @@ lab = ['Hungarian Index of Prices',
468470
'1/Cents per Crown in New York']
469471
470472
# create plot
471-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
473+
fig, ax = plt.subplots(dpi=200)
472474
_ = pe_plot(p_seq, e_seq, df_Hung.index, lab, ax)
473475
474476
plt.figtext(0.5, -0.02, 'Hungary',
@@ -485,7 +487,7 @@ mystnb:
485487
name: inflationrate_hungary
486488
---
487489
# plot moving average
488-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
490+
fig, ax = plt.subplots(dpi=200)
489491
_ = pr_plot(p_seq, df_Hung.index, ax)
490492
491493
plt.figtext(0.5, -0.02, 'Hungary',
@@ -543,7 +545,7 @@ lab = ['Wholesale Price Index',
543545
'1/Cents per Polish Mark']
544546
545547
# create plot
546-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
548+
fig, ax = plt.subplots(dpi=200)
547549
ax1 = pe_plot(p_seq, e_seq, df_Pol.index, lab, ax)
548550
549551
plt.figtext(0.5, -0.02, 'Poland',
@@ -560,7 +562,7 @@ mystnb:
560562
name: inflationrate_poland
561563
---
562564
# plot moving average
563-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
565+
fig, ax = plt.subplots(dpi=200)
564566
_ = pr_plot(p_seq, df_Pol.index, ax)
565567
566568
plt.figtext(0.5, -0.02, 'Poland',
@@ -591,7 +593,7 @@ lab = ['Price Index',
591593
'1/Cents per Mark']
592594
593595
# create plot
594-
fig, ax = plt.subplots(figsize=[9,5], dpi=200)
596+
fig, ax = plt.subplots(dpi=200)
595597
ax1 = pe_plot(p_seq, e_seq, df_Germ.index, lab, ax)
596598
597599
plt.figtext(0.5, -0.06, 'Germany',
@@ -621,7 +623,7 @@ lab = ['Price Index (Marks or converted to Marks)',
621623
'1/Cents per Mark (or Reichsmark converted to Mark)']
622624
623625
# create plot
624-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
626+
fig, ax = plt.subplots(dpi=200)
625627
ax1 = pe_plot(p_seq, e_seq, df_Germ.index, lab, ax)
626628
627629
plt.figtext(0.5, -0.02, 'Germany',
@@ -638,7 +640,7 @@ mystnb:
638640
name: inflationrate_germany
639641
---
640642
# plot moving average
641-
fig, ax = plt.subplots(figsize=[10,7], dpi=200)
643+
fig, ax = plt.subplots(dpi=200)
642644
_ = pr_plot(p_seq, df_Germ.index, ax)
643645
644646
plt.figtext(0.5, -0.02, 'Germany',

0 commit comments

Comments
 (0)