gadfly shapes

This commit is contained in:
Thomas Breloff 2015-09-18 01:55:16 -04:00
parent 1a490551e6
commit 56cf25eebf

View File

@ -217,18 +217,11 @@ function hexagon(xs::AbstractArray, ys::AbstractArray, rs::AbstractArray)
r = rs[mod1(i, length(rs))] r = rs[mod1(i, length(rs))]
u = 0.6r u = 0.6r
# make a "plus sign"
polys[i] = Tuple{Compose.Measure, Compose.Measure}[ polys[i] = Tuple{Compose.Measure, Compose.Measure}[
(x-r, y-u), (x-r, y+u), # L edge (x-r, y-u), (x-r, y+u), # L edge
# (x-u, y+u), # BL inside (x, y+r), # B
# (x-u, y+r), (x+u, y+r), # B edge
(x, y+r),
# (x+u, y+u), # BR inside
(x+r, y+u), (x+r, y-u), # R edge (x+r, y+u), (x+r, y-u), # R edge
(x, y-r) (x, y-r) # T
# (x+u, y-u), # TR inside
# (x+u, y-r), (x-u, y-r), # T edge
# (x-u, y-u) # TL inside
] ]
end end
@ -246,16 +239,11 @@ function octagon(xs::AbstractArray, ys::AbstractArray, rs::AbstractArray)
r = rs[mod1(i, length(rs))] r = rs[mod1(i, length(rs))]
u = 0.4r u = 0.4r
# make a "plus sign"
polys[i] = Tuple{Compose.Measure, Compose.Measure}[ polys[i] = Tuple{Compose.Measure, Compose.Measure}[
(x-r, y-u), (x-r, y+u), # L edge (x-r, y-u), (x-r, y+u), # L edge
# (x-u, y+u), # BL inside
(x-u, y+r), (x+u, y+r), # B edge (x-u, y+r), (x+u, y+r), # B edge
# (x+u, y+u), # BR inside
(x+r, y+u), (x+r, y-u), # R edge (x+r, y+u), (x+r, y-u), # R edge
# (x+u, y-u), # TR inside
(x+u, y-r), (x-u, y-r), # T edge (x+u, y-r), (x-u, y-r), # T edge
# (x-u, y-u) # TL inside
] ]
end end