@@ -742,8 +742,8 @@ We can histogram the income distribution we just constructed as follows
742
742
x = df['income']
743
743
fig, ax = plt.subplots()
744
744
ax.hist(x, bins=5, density=True, histtype='bar')
745
- ax.set_xlabel('Income ')
746
- ax.set_ylabel('Density ')
745
+ ax.set_xlabel('income ')
746
+ ax.set_ylabel('density ')
747
747
plt.show()
748
748
```
749
749
@@ -785,7 +785,7 @@ x_amazon = np.asarray(data)
785
785
fig, ax = plt.subplots()
786
786
ax.hist(x_amazon, bins=20)
787
787
ax.set_xlabel('monthly return (percent change)')
788
- ax.set_ylabel('Density ')
788
+ ax.set_ylabel('density ')
789
789
plt.show()
790
790
```
791
791
@@ -800,7 +800,7 @@ KDE will generate a smooth curve that approximates the PDF.
800
800
``` {code-cell} ipython3
801
801
fig, ax = plt.subplots()
802
802
sns.kdeplot(x_amazon, ax=ax)
803
- ax.set_xlabel('Monthly Return (Percent Change )')
803
+ ax.set_xlabel('monthly return (percent change )')
804
804
ax.set_ylabel('KDE')
805
805
plt.show()
806
806
```
@@ -812,7 +812,7 @@ fig, ax = plt.subplots()
812
812
sns.kdeplot(x_amazon, ax=ax, bw_adjust=0.1, alpha=0.5, label="bw=0.1")
813
813
sns.kdeplot(x_amazon, ax=ax, bw_adjust=0.5, alpha=0.5, label="bw=0.5")
814
814
sns.kdeplot(x_amazon, ax=ax, bw_adjust=1, alpha=0.5, label="bw=1")
815
- ax.set_xlabel('Monthly Return (Percent Change )')
815
+ ax.set_xlabel('monthly return (percent change )')
816
816
ax.set_ylabel('KDE')
817
817
plt.legend()
818
818
plt.show()
@@ -832,7 +832,7 @@ Yet another way to display an observed distribution is via a violin plot.
832
832
``` {code-cell} ipython3
833
833
fig, ax = plt.subplots()
834
834
ax.violinplot(x_amazon)
835
- ax.set_ylabel('Monthly Return (Percent Change )')
835
+ ax.set_ylabel('monthly return (percent change )')
836
836
ax.set_xlabel('KDE')
837
837
plt.show()
838
838
```
@@ -854,7 +854,7 @@ x_apple = np.asarray(data)
854
854
``` {code-cell} ipython3
855
855
fig, ax = plt.subplots()
856
856
ax.violinplot([x_amazon, x_apple])
857
- ax.set_ylabel('Monthly Return (Percent Change )')
857
+ ax.set_ylabel('monthly return (percent change )')
858
858
ax.set_xlabel('KDE')
859
859
plt.show()
860
860
```
@@ -889,8 +889,8 @@ x_grid = np.linspace(-50, 65, 200)
889
889
fig, ax = plt.subplots()
890
890
ax.plot(x_grid, u.pdf(x_grid))
891
891
ax.hist(x_amazon, density=True, bins=40)
892
- ax.set_xlabel('Monthly Return (Percent Change )')
893
- ax.set_ylabel('Density ')
892
+ ax.set_xlabel('monthly return (percent change )')
893
+ ax.set_ylabel('density ')
894
894
plt.show()
895
895
```
896
896
@@ -919,7 +919,7 @@ fig, ax = plt.subplots()
919
919
ax.plot(x_grid, u.pdf(x_grid))
920
920
ax.hist(x_draws, density=True, bins=40)
921
921
ax.set_xlabel('x')
922
- ax.set_ylabel('Density ')
922
+ ax.set_ylabel('density ')
923
923
plt.show()
924
924
```
925
925
0 commit comments