@@ -1122,27 +1122,26 @@ the true sampling distribution—which corresponds to taking many samples fr
1122
1122
``` {code-cell} ipython3
1123
1123
:tags: [remove-input]
1124
1124
1125
+ sampling_distribution.encoding.x['bin']['extent'] = (90, 250)
1125
1126
alt.vconcat(
1126
1127
alt.layer(
1127
1128
sampling_distribution,
1128
- sampling_distribution. mark_rule(color='#f58518', size=2).encode(x='mean(mean_price)', y=alt.Y() ),
1129
- sampling_distribution .mark_text(color='#f58518', size=12, align='left', dx=16, fontWeight='bold').encode(
1129
+ alt.Chart(sample_estimates). mark_rule(color='#f58518', size=2).encode(x='mean(mean_price)'),
1130
+ alt.Chart(sample_estimates) .mark_text(color='#f58518', size=12, align='left', dx=16, fontWeight='bold').encode(
1130
1131
x='mean(mean_price)',
1131
1132
y=alt.value(7),
1132
1133
text=alt.value(f"Mean = {sampling_distribution['data']['mean_price'].mean().round(1)}")
1133
1134
)
1134
1135
).properties(title='Sampling distribution', height=150),
1135
1136
alt.layer(
1136
1137
boot_est_dist,
1137
- boot_est_dist. mark_rule(color='#f58518', size=2).encode(x='mean(mean_price)', y=alt.Y() ),
1138
- boot_est_dist .mark_text(color='#f58518', size=12, align='left', dx=18, fontWeight='bold').encode(
1138
+ alt.Chart(boot20000_means). mark_rule(color='#f58518', size=2).encode(x='mean(mean_price)'),
1139
+ alt.Chart(boot20000_means) .mark_text(color='#f58518', size=12, align='left', dx=18, fontWeight='bold').encode(
1139
1140
x='mean(mean_price)',
1140
- y=alt.value(6 ),
1141
+ y=alt.value(7 ),
1141
1142
text=alt.value(f"Mean = {boot_est_dist['data']['mean_price'].mean().round(1)}")
1142
1143
)
1143
1144
).properties(title='Bootstrap distribution', height=150)
1144
- ).resolve_scale(
1145
- x='shared'
1146
1145
)
1147
1146
```
1148
1147
0 commit comments