Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created November 7, 2019 14:23
Show Gist options
  • Save mdfarragher/683669c431569b5fc9981f206c2c0f80 to your computer and use it in GitHub Desktop.
Save mdfarragher/683669c431569b5fc9981f206c2c0f80 to your computer and use it in GitHub Desktop.
// get an array of housing data
houses = context.Data.CreateEnumerable<HouseBlockData>(data, reuseRowObject: false).ToArray();
// plot median house value by median income
chart = Chart.Plot(
new Graph.Scattergl()
{
x = houses.Select(v => v.MedianIncome),
y = houses.Select(v => v.MedianHouseValue),
mode = "markers"
}
);
chart.WithXTitle("Median Income");
chart.WithYTitle("Median House Value");
chart.WithTitle("Median house value by income");
chart.Width = 600;
chart.Height = 600;
display(chart);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment