# Combine scarf plot and line plot in Gadfly or Plots

**URL:** <https://discourse.julialang.org/t/combine-scarf-plot-and-line-plot-in-gadfly-or-plots/5983>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 19, 2017, 5:48pm UTC](https://discourse.julialang.org/t/combine-scarf-plot-and-line-plot-in-gadfly-or-plots/5983 "2017-09-19T17:48:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [September 19, 2017, 5:48pm UTC](https://discourse.julialang.org/t/combine-scarf-plot-and-line-plot-in-gadfly-or-plots/5983/1 "2017-09-19T17:48:40Z")

</div>

I would like to plot some time series data on line plot combined with a scarf plot. A [scarf plot](https://i.stack.imgur.com/4wkE1.png) represents discrete events with blocks of color. The closest solution I found involves the [vline geometry](http://gadflyjl.org/stable/lib/geoms/geom_vline.html#Geom.vline-1) in Gadfly to create the scarf plot. The main complication is mapping the width of the vline onto the desired time intervals. Does anyone have any solutions using Gadfly or Plots?

Thank you,

Chris

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [September 19, 2017, 6:39pm UTC](https://discourse.julialang.org/t/combine-scarf-plot-and-line-plot-in-gadfly-or-plots/5983/2 "2017-09-19T18:39:57Z")

</div>

I think you should be able to use `Geom.rect` (use one layer per color).

[http://gadflyjl.org/latest/lib/geoms/geom\_rectbin.html#Geom.rectbin-1](http://gadflyjl.org/latest/lib/geoms/geom_rectbin.html#Geom.rectbin-1)
