@@ -57,6 +57,8 @@ We start by installing a library we will use followed by importing some Python m
57
57
``` {code-cell} ipython3
58
58
import numpy as np
59
59
import pandas as pd
60
+ import matplotlib
61
+ matplotlib.rcParams['figure.figsize'] = (12, 10)
60
62
import matplotlib.pyplot as plt
61
63
import matplotlib.dates as mdates
62
64
```
@@ -89,7 +91,7 @@ df_fig5_bef1914 = df_fig5[df_fig5.index <= 1915]
89
91
# create plot
90
92
cols = ['UK', 'US', 'France', 'Castile']
91
93
92
- fig, ax = plt.subplots(figsize=[8, 5], dpi=200)
94
+ fig, ax = plt.subplots(dpi=200)
93
95
94
96
for col in cols:
95
97
ax.plot(df_fig5_bef1914.index,
@@ -156,7 +158,7 @@ mystnb:
156
158
caption: "Long run time series of the price level (log)"
157
159
name: lrpl_lg
158
160
---
159
- fig, ax = plt.subplots(figsize=[8, 5], dpi=200)
161
+ fig, ax = plt.subplots(dpi=200)
160
162
161
163
for col in cols:
162
164
ax.plot(df_fig5.index, df_fig5[col])
@@ -207,7 +209,7 @@ from chapter 3 of {cite}`sargent2013rational`.
207
209
Data underlying our graphs appear in tables in an appendix to chapter 3 of {cite}` sargent2013rational ` .
208
210
We have transcribed all of these data into a spreadsheet ` chapter_3.xls ` that we read into pandas.
209
211
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 ` .
211
213
212
214
``` {code-cell} ipython3
213
215
:tags: [hide-input]
@@ -268,8 +270,8 @@ def process_df(df):
268
270
return df
269
271
```
270
272
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.
273
275
274
276
``` {code-cell} ipython3
275
277
:tags: [hide-input]
@@ -412,7 +414,7 @@ e_seq = df_Aus['Exchange Rate']
412
414
lab = ['Retail Price Index', 'Exchange Rate']
413
415
414
416
# create plot
415
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
417
+ fig, ax = plt.subplots(dpi=200)
416
418
_ = pe_plot(p_seq, e_seq, df_Aus.index, lab, ax)
417
419
418
420
# connect disjunct parts
@@ -430,7 +432,7 @@ mystnb:
430
432
name: inflationrate_austria
431
433
---
432
434
# plot moving average
433
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
435
+ fig, ax = plt.subplots(dpi=200)
434
436
_ = pr_plot(p_seq, df_Aus.index, ax)
435
437
436
438
plt.figtext(0.5, -0.02, 'Austria',
@@ -468,7 +470,7 @@ lab = ['Hungarian Index of Prices',
468
470
'1/Cents per Crown in New York']
469
471
470
472
# create plot
471
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
473
+ fig, ax = plt.subplots(dpi=200)
472
474
_ = pe_plot(p_seq, e_seq, df_Hung.index, lab, ax)
473
475
474
476
plt.figtext(0.5, -0.02, 'Hungary',
@@ -485,7 +487,7 @@ mystnb:
485
487
name: inflationrate_hungary
486
488
---
487
489
# plot moving average
488
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
490
+ fig, ax = plt.subplots(dpi=200)
489
491
_ = pr_plot(p_seq, df_Hung.index, ax)
490
492
491
493
plt.figtext(0.5, -0.02, 'Hungary',
@@ -543,7 +545,7 @@ lab = ['Wholesale Price Index',
543
545
'1/Cents per Polish Mark']
544
546
545
547
# create plot
546
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
548
+ fig, ax = plt.subplots(dpi=200)
547
549
ax1 = pe_plot(p_seq, e_seq, df_Pol.index, lab, ax)
548
550
549
551
plt.figtext(0.5, -0.02, 'Poland',
@@ -560,7 +562,7 @@ mystnb:
560
562
name: inflationrate_poland
561
563
---
562
564
# plot moving average
563
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
565
+ fig, ax = plt.subplots(dpi=200)
564
566
_ = pr_plot(p_seq, df_Pol.index, ax)
565
567
566
568
plt.figtext(0.5, -0.02, 'Poland',
@@ -591,7 +593,7 @@ lab = ['Price Index',
591
593
'1/Cents per Mark']
592
594
593
595
# create plot
594
- fig, ax = plt.subplots(figsize=[9,5], dpi=200)
596
+ fig, ax = plt.subplots(dpi=200)
595
597
ax1 = pe_plot(p_seq, e_seq, df_Germ.index, lab, ax)
596
598
597
599
plt.figtext(0.5, -0.06, 'Germany',
@@ -621,7 +623,7 @@ lab = ['Price Index (Marks or converted to Marks)',
621
623
'1/Cents per Mark (or Reichsmark converted to Mark)']
622
624
623
625
# create plot
624
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
626
+ fig, ax = plt.subplots(dpi=200)
625
627
ax1 = pe_plot(p_seq, e_seq, df_Germ.index, lab, ax)
626
628
627
629
plt.figtext(0.5, -0.02, 'Germany',
@@ -638,7 +640,7 @@ mystnb:
638
640
name: inflationrate_germany
639
641
---
640
642
# plot moving average
641
- fig, ax = plt.subplots(figsize=[10,7], dpi=200)
643
+ fig, ax = plt.subplots(dpi=200)
642
644
_ = pr_plot(p_seq, df_Germ.index, ax)
643
645
644
646
plt.figtext(0.5, -0.02, 'Germany',
0 commit comments