# How to Plot Vertical Slicing in 3D like a Slice of Cheese?

**URL:** <https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [December 29, 2022, 2:34pm UTC](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275 "2022-12-29T14:34:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [December 29, 2022, 2:34pm UTC](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275/1 "2022-12-29T14:34:09Z")

</div>

Hi all,

I have created the left figure of this:  
 ![Capture d’écran_2022-12-29_21-31-59](https://global.discourse-cdn.com/julialang/original/3X/b/1/b195f37ee25d3376299c23d38a94f33c46ad6cae.png)

```julia
using Plots, LaTeXStrings, Plots.PlotMeasures
gr()

f(x) = 1 - (x^2)/4

plot(f,0,3, xtick=0:2:2, xlims=(0,3), ylims=(0,1.5), 
	framestyle=:zerolines, bottom_margin=5mm,
	label=L"y = 1 - \frac{x^{2}}{4}", legend=:topright)

plot!(f,0,2, label="", fill=(0, 0.15, :blue))
plot!(f,0.8,1, label="", fill=(0, 0.35, :blue))

# Annotations
annotate!([(0.9,0.9, (L"△ x", 8, :blue))])
annotate!([(1,-0.1, (L"x_{i}", 8, :blue))])
annotate!([(0.84,-0.1, (L"x_{i+1}", 8, :blue))])

```

I need help to create the figure on the right, as it is quite complex, I try it on my own too, let see, whether I can solve it first or anyone can help me first.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [December 30, 2022, 10:00am UTC](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275/2 "2022-12-30T10:00:00Z")

</div>

I have done this with tikz, but if anyone able to create with Julia it is always welcome…

 ![ch1-calculus-6applicationsoftheintegral-26-3d](https://global.discourse-cdn.com/julialang/original/3X/e/6/e6c1e9e6d47be95fcec7e6bd3e5483797029c7bd.png)
