# Lego Plot how to?

**URL:** <https://discourse.julialang.org/t/lego-plot-how-to/12055>\
**Category:** General Usage\
**Created:** [June 29, 2018, 8:45am UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055 "2018-06-29T08:45:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [June 29, 2018, 8:45am UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055/1 "2018-06-29T08:45:57Z")

</div>

How to produce a lego plot (e.g. a histogram with 2d bins) in julia? See [here](https://www.google.com/search?biw=1920&bih=966&tbm=isch&sa=1&ei=nfA1W-iAIcehsgG-xLvYBg&q=lego+plot&oq=lego+plot&gs_l=img.3..0l2j0i30k1l2j0i8i30k1l3.5751.5751.0.5962.1.1.0.0.0.0.123.123.0j1.1.0....0...1c.1.64.img..0.1.122....0.9EPA8oPDhJQ#imgrc=_) for example plots.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 29, 2018, 3:06pm UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055/3 "2018-06-29T15:06:48Z")

</div>

Matplotlib supports this, so you can use PyPlot. For example, I adapted [this Matplotlib example](https://matplotlib.org/gallery/mplot3d/3d_bars.html) to:

```julia
using PyPlot
x = (0:3)' .* ones(5)
y = ones(4)' .* (0:4)
x = reshape(x, length(x))
y = reshape(y, length(y))
z = x + y
bar3D(x, y, z*0, 1, 1, z)
title("bar3D demo")

```

(I find the Matplotlib `bar3d` interface a little weird.)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/f/ef403e618a8c371e98615c59db32633e51170465.jpeg)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [June 29, 2018, 4:35pm UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055/4 "2018-06-29T16:35:03Z")

</div>

Can you just use surface?

---

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [June 29, 2018, 8:03pm UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055/5 "2018-06-29T20:03:27Z")

</div>

It is not ideal, but it is a possiblity

 ![lego](https://global.discourse-cdn.com/julialang/original/3X/1/1/1139da4038ce754792cf0ce25e0302cc6fdf7fdf.png)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [June 29, 2018, 8:48pm UTC](https://discourse.julialang.org/t/lego-plot-how-to/12055/6 "2018-06-29T20:48:10Z")

</div>

Use the plotlyjs() backend to make it interactive and you have a super solution.
