I have a big list of rectangles I'd like to draw. What I want is to end up
with something that looks like ArrayPlot
<http://reference.wolfram.com/language/ref/ArrayPlot.html> in Mathematica.
I have it the data the form of an Array{(Int64,Int64),1}, where each entry
is the center of the rectangle. I have figured out that I can get a Vector
of rectangles by
map(x->rectangle(x[1],y[1],1,1))
but I can't figure out how to actually plot these once I have them. How do
I turn the array of rectangles into an image? I've used the following
before (calling my list of points L)
draw(SVG("output.svg",20cm,20cm),plot(x=map(x->x[1],L),y=map(x->x[2],L)))
to output the points as point objects to a file, but I can't seem to modify
this syntax to work for the rectangle objects.
(As a side note, I would also be interested in knowing how to get the
rasterized version of this, i.e. convert single pixels at coordinates
corresponding to L to black and leave the rest white. But even the vector
graphics part is turning out to be harder than expected, so maybe that will
have to be an adventure for another day...)