In [12]:
using Compose
Compose.set_default_graphic_size(2inch, 2inch)


Out[12]:
50.8mm

In [18]:
compose(canvas(), ellipse(0.6,0.6,0.360,0.255), stroke("blue"), 
fill("red"))


Out[18]:

In [35]:
x=2rand(150, 150)-1
x=(x+x')/2
Elements = {}
M, N = size(x)
for i=1:M
    for j=1:N
        z = abs(x[i,j])
        thecolor = x[i,j]<0 ? "white" : "black"
        push!(Elements, compose(canvas(), rectangle((i-0.5-z/2)/M, (j-0.5-z/2)/N, z/M, z/N),
            stroke(thecolor), fill(thecolor)))
    end
end
@time compose(canvas(), rectangle(0,0,1,1), fill("lavender"), Elements...)


elapsed time: 0.006086899 seconds (904212 bytes allocated)
Out[35]:

In [28]:
typeof(Elements[1])


Out[28]:
CanvasTree (constructor with 7 methods)

In [29]:
Elements[1]


Out[29]:

In [32]:
x


Out[32]:
20x20 Array{Float64,2}:
 -0.0556076   0.697797    0.783476   …  -0.212249    0.764954   -0.445495  
 -0.0402965   0.961386    0.333362       0.674619   -0.2684     -0.722103  
  0.238938   -0.44039     0.0857351      0.761056   -0.590466    0.673079  
 -0.379758    0.942017    0.385936      -0.891925   -0.0668593   0.832455  
 -0.329088    0.637295    0.0893322     -0.654149   -0.339657   -0.748873  
 -0.107142    0.622068   -0.269477   …  -0.771749    0.96839     0.752089  
 -0.310152   -0.731951   -0.639828       0.338975    0.648151   -0.86146   
  0.231978    0.21267     0.2775         0.938266    0.620748   -0.940101  
  0.436536    0.887191    0.237928       0.0930314  -0.351852   -0.335171  
  0.0543429   0.0642884   0.989645       0.398242   -0.554987    0.00666962
  0.656842    0.794869   -0.737623   …  -0.93759    -0.16029    -0.191784  
 -0.333706   -0.905783   -0.130987      -0.31525     0.0619506  -0.57315   
 -0.179681    0.112575   -0.585448       0.753676    0.59896    -0.191138  
  0.0891804  -0.847983   -0.204556       0.424822   -0.862148    0.530096  
 -0.491793   -0.290587    0.821481      -0.241339    0.481718   -0.592809  
  0.0333976   0.922336   -0.885642   …   0.067586    0.880241    0.626905  
  0.590271    0.600726   -0.649706       0.111327    0.0788032   0.319802  
 -0.147589    0.485359   -0.358529      -0.83698     0.362007    0.992555  
  0.258341    0.589368   -0.100121       0.0449639  -0.546134    0.275781  
  0.269303   -0.128529   -0.0911307      0.0843121   0.734843   -0.787398  

In [ ]: