Plot.plot({
y: {
grid: false,
label: "Average house prices(£)",
type: logScale1 ? "log" : "linear"
},
x: { label: "Year", grid: true },
marks: [
Plot.areaY(
housing_in_london_monthly_variables,
Plot.groupX(
{ y1: "min", y2: "max" },
{ x: "date", y: "average_price", fill: "steelblue", opacity: 0.2 }
)
),
Plot.areaY(
housing_in_london_monthly_variables,
Plot.groupX(
{ y1: (d) => d3.quantile(d, 0.1), y2: (d) => d3.quantile(d, 0.9) },
{ x: "date", y: "average_price", fill: "steelblue", opacity: 0.4 }
)
),
Plot.lineY(
housing_in_london_monthly_variables,
Plot.groupX(
{ y: "median" },
{
sort: "date",
x: "date",
y: "average_price"
}
)
)
],
height: 200,
marginLeft
})