# Plot seriestype volume

**URL:** https://discourse.julialang.org/t/plot-seriestype-volume/26301
**Category:** General Usage
**Tags:** plotting
**Created:** [July 12, 2019, 7:19pm UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301 "2019-07-12T19:19:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)
#### Post date: [July 12, 2019, 7:19pm UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301/1 "2019-07-12T19:19:19Z")

</div>

Is there an example for how to use the `seriestype=:volume` recipe?  
Found the recipe listed in the documentation here, but I am clearly using it incorrectly: [Overview · Plots](http://docs.juliaplots.org/latest/attributes/)

I am attempting to render a 3d rectangular box by plotting the eight vertices using the code below, but this generates errors.

```julia
using Plots

x = [0,0,0,0,1,1,1,1]
y = [0,0,1,1,0,0,1,1]
z = [0,1,0,1,0,1,0,1]

plot(x, y, z, seriestype=:volume)

```

Using `plot(x,y,z)` without the volume recipe correctly plots lines connecting each vertex.

I would also like to learn how to use the `seriestype=:surface` recipe.

---

<div class="post-metadata">

### Author: ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)
#### Post date: [July 12, 2019, 7:44pm UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301/2 "2019-07-12T19:44:38Z")

</div>

```julia
using Plots
plot(randn(100,100,100))

```

should work.

---

<div class="post-metadata">

### Author: ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)
#### Post date: [July 12, 2019, 8:06pm UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301/3 "2019-07-12T20:06:27Z")

</div>

Was hoping for something closer to:

```julia
using Plots
x1 = [0,1,1,0]
y1 = [0,0,1,1]
plot(x1, y1, seriestype=:shape)

```

instead of:

```julia
using Plots
plot(rand(100,100))

```

But for 3d rather than 2d.

Is usage of `:surface` and `:volume` seriestype documented in more detail somewhere?

---

<div class="post-metadata">

### Author: ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)
#### Post date: [July 16, 2019, 11:38pm UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301/4 "2019-07-16T23:38:55Z")

</div>

Found PlotlyJS to be the best solution for plotting volumes as a mesh.

> **[3d](https://plotly.com/python/3d-mesh/)**
>
> Detailed examples of 3D Mesh Plots including changing color, size, log axes, and more in Python.

Here’s an example of how to plot a tetrahedron in Julia.

```julia
using PlotlyJS
PlotlyJS.plot(
    PlotlyJS.mesh3d(
        x = [0, 1, 2, 0],
        y = [0, 0, 1, 2],
        z = [0, 2, 0, 1],
        i = [0, 0, 0, 1],
        j = [1, 2, 3, 2],
        k = [2, 3, 1, 3],
    )
)

```

---

<div class="post-metadata">

### Author: ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)
#### Post date: [May 19, 2020, 3:26am UTC](https://discourse.julialang.org/t/plot-seriestype-volume/26301/5 "2020-05-19T03:26:40Z")

</div>

It doesn’t work
