Geom.rectbin

Geom.rectbin

Draw colored rectangles.

Aesthetics

Either (for Geom.rect)

Or (for Geom.rectbin)

For Geom.rect, rectangles defined by x_min, x_max, y_min, y_max are drawn. For Geom.rectbin, equal sizes squares are centered at x and y positions.

Examples

plot(dataset("Zelig", "macro"), x="Year", y="Country", color="GDP", Geom.rectbin)
Year 1960 1970 1980 1990 2000 0 10 -5 15 5 GDP United States Canada United Kingdom Netherlands Belgium France West Germany Austria Italy Finland Sweden Norway Denmark Japan Country
theme1 = Theme(default_color=RGBA(0, 0.75, 1.0, 0.5))
D = DataFrame(x=[0.5,1], y=[0.5,1], x1=[0,0.5], y1=[0,0.5], x2=[1,1.5], y2=[1,1.5])
pa = plot(D, x=:x, y=:y, Geom.rectbin, theme1)
pb = plot(D, xmin=:x1, ymin=:y1, xmax=:x2, ymax=:y2, Geom.rect, theme1)
hstack(pa, pb)
x1 0.0 0.5 1.0 1.5 0.0 0.5 1.0 1.5 y1 x 0.0 0.5 1.0 1.5 0.0 0.5 1.0 1.5 y