# How to plot 3-dimensional "IntervalBox()"?

**URL:** https://discourse.julialang.org/t/how-to-plot-3-dimensional-intervalbox/103698
**Category:** Visualization
**Tags:** intervals, plots
**Created:** [September 9, 2023, 10:46am UTC](https://discourse.julialang.org/t/how-to-plot-3-dimensional-intervalbox/103698 "2023-09-09T10:46:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ashu](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Ashu](https://discourse.julialang.org/u/Ashu)
#### Post date: [September 9, 2023, 10:46am UTC](https://discourse.julialang.org/t/how-to-plot-3-dimensional-intervalbox/103698/1 "2023-09-09T10:46:13Z")

</div>

Hello,

Let’s say there is a `box = IntervalBox(1..2, 2..3, 3..4)`. How can I plot it in `Pluto.jl` notebook? I am using `IntervalArithmetic.jl` and `Plots.jl` packages.  
The code block is not working for me.

```julia
begin
	box = IntervalBox((1..2), (3..4), (5..6))
	p = plot(box)
end

```

Thank you

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [September 9, 2023, 2:24pm UTC](https://discourse.julialang.org/t/how-to-plot-3-dimensional-intervalbox/103698/2 "2023-09-09T14:24:52Z")

</div>

I don’t know if there is a recipe for that, but in case there isn’t, you may find a [solution here](https://discourse.julialang.org/t/how-to-plot-a-cube-in-3d-in-plots-jl/86919/2).

> **Code example**
>
> ```julia
> using Plots, IntervalArithmetic
> 
> box = IntervalBox((1..2), (3..4), (5..6))
> ;a, b, c = box
> xc = [a.lo, a.lo, a.lo, a.lo, a.hi, a.hi, a.hi, a.hi]
> yc = [b.lo, b.hi, b.lo, b.hi, b.lo, b.lo, b.hi, b.hi]
> zc = [c.lo, c.lo, c.hi, c.hi, c.hi, c.lo, c.lo, c.hi]
> connections = [(1,2,3), (4,2,3), (4,7,8), (7,5,6), (2,4,7), (1,6,2), (2,7,6), (7,8,5), (4,8,5), (4,5,3), (1,6,3), (6,3,5)]
> 
> mesh3d(xc, yc, zc; connections, proj_type=:persp, lc=:gray, xlabel="x", ylabel="y", zlabel="z")
> 
> ```
