Sharing first coordinate

mx = mapping(:x)
mx * (mapping(_, :y1 => :y) * visual(Scatter) + mapping(_, :y2 => :y) * visual(Lines))

@piever How can I specify two different layers that share the same x coordinate without repeating myself?

When multiplying mappings, positional arguments are concatenated, so just

mx = mapping(:x)
mx * (mapping(:y1 => :y) * visual(Scatter) + mapping(:y2 => :y) * visual(Lines))

should work. This may need documentation, it looks like here it only says “mappings are merged”, but that’s not completely accurate for the positional part.

1 Like