Skip to content

Commit

Permalink
plot multiple lines according to size, shape, and alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarthur committed Dec 31, 2021
1 parent 9245b75 commit 0927245
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/geom/line.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ function Gadfly.Geom.render(geom::LineGeometry, theme::Gadfly.Theme, aes::Gadfly
default_aes.group = IndirectArray([1])
default_aes.color = [theme.default_color]
default_aes.linestyle = theme.line_style[1:1]
default_aes.size = Measure[theme.point_size]
default_aes.shape = Function[theme.point_shapes[1]]
default_aes.alpha = [theme.alphas[1]]
aes = inherit(aes, default_aes)

# Render lines, using multivariate groupings:
XT, YT = eltype(aes.x), eltype(aes.y)
GT, CT, LST = Int, eltype(aes.color), eltype(aes.linestyle)
groups = collect(Tuple{GT, CT, LST}, Compose.cyclezip(aes.group, aes.color, aes.linestyle))
GT, CT, LST, SzT, ShT, AT = Int, eltype(aes.color), eltype(aes.linestyle), eltype(aes.size), eltype(aes.shape), eltype(aes.alpha)
groups = collect(Tuple{GT, CT, LST, SzT, ShT, AT},
Compose.cyclezip(aes.group, aes.color, aes.linestyle, aes.size, aes.shape, aes.alpha))
ugroups = unique(groups)
nugroups = length(ugroups)
# Recycle groups
Expand Down

0 comments on commit 0927245

Please sign in to comment.