# Plotting histogram on the y-axis at the end of a time series

**URL:** https://discourse.julialang.org/t/plotting-histogram-on-the-y-axis-at-the-end-of-a-time-series/5381
**Category:** Visualization
**Tags:** question, plotting
**Created:** [August 14, 2017, 8:02pm UTC](https://discourse.julialang.org/t/plotting-histogram-on-the-y-axis-at-the-end-of-a-time-series/5381 "2017-08-14T20:02:37Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)
#### Post date: [August 15, 2017, 1:44am UTC](https://discourse.julialang.org/t/plotting-histogram-on-the-y-axis-at-the-end-of-a-time-series/5381/4 "2017-08-15T01:44:42Z")

</div>

Here is my quick attempt to produce a “similar” plot in [Gadfly](http://gadflyjl.org/stable/).

```plaintext
x = 1.0:5:500.0
D = DataFrame(x=x, y=x/250+randn(100))
pa = plot(D, layer(x=:x, y=:y, Geom.point, Geom.smooth),
    layer(x=[0], y=[4], label=["x10⁴"], Geom.label(position=:right)),
    Guide.xlabel("Time<sub> </sub>(yr)"), Guide.ylabel("Volume (km³)"), 
    Guide.title("Grounded Volume") )
pb = plot(D, y=:y, Geom.histogram(orientation=:horizontal, bincount=10, density=true), 
    Guide.xlabel("π(<i>V̂<sub>g</sub></i>)<sup>x10⁻⁵</sup>"), Guide.ylabel(""),
    Guide.title(" "))

M = Array{Compose.Context}(1,2)
M[1] = compose(context(0,0,2/3,1), render(pa))
M[2] = compose(context(0,0,1/3,1), render(pb))

draw(PNG(6.6inch, 3.3inch), hstack(M...))

```

![fig1](https://global.discourse-cdn.com/julialang/original/3X/9/4/943e71dceb149d1591b571242a9f623134a40f54.png)

---

_[View the full topic](https://discourse.julialang.org/t/plotting-histogram-on-the-y-axis-at-the-end-of-a-time-series/5381)._
