Geom.histogram2d

Bin data in rectangles and indicate density with color. As in heatmaps, etc.

An alias for Geom.rectbin with Stat.histogram2d.

Aesthetics

Arguments

Examples

plot(dataset("car", "Womenlf"), x="HIncome", y="Region", Geom.histogram2d)
HIncome 0 10 20 30 40 50 10 1 5 15 Count Ontario Prairie Atlantic BC Quebec Region
plot(dataset("car", "UN"), x="GDP", y="InfantMortality",
     Scale.x_log10, Scale.y_log10, Geom.histogram2d)
GDP 100 101 102 103 104 105 2.0 1.0 1.5 2.5 3.0 Count 100.0 100.5 101.0 101.5 102.0 102.5 InfantMortality
# Explicitly setting the number of bins
plot(dataset("car", "UN"), x="GDP", y="InfantMortality",
     Scale.x_log10, Scale.y_log10, Geom.histogram2d(xbincount=30, ybincount=30))
GDP 100 101 102 103 104 105 3 1 2 4 5 Count 100.0 100.5 101.0 101.5 102.0 102.5 InfantMortality