# How to Create a Brackets for certain length in Plots?

**URL:** <https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930>\
**Category:** General Usage\
**Tags:** plotting, plots\
**Created:** [December 21, 2022, 6:36am UTC](https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930 "2022-12-21T06:36:39Z")\
**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 21, 2022, 6:36am UTC](https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930/1 "2022-12-21T06:36:40Z")

</div>

Hi all,

I want to create a bracket like this:

![Capture d’écran_2022-12-21_13-35-00](https://global.discourse-cdn.com/julialang/original/3X/1/b/1bcd9438b22e518dd6e056c79d033eb255b8e598.png)

I currently use a line and two bars to replace the bracket, I try to use `}` with rotation and increase the length and it is not working.

this is my code:

```julia
using Plots, LaTeXStrings
gr()

x = collect(range(0, 4, length= 100))
f(x) = sqrt(4x)
g(x) = (4x - 4)/3

plot(g,-1,4, xtick=-1:1:4, xlims=(-1,4), ylims=(-2,4), 
	framestyle=:zerolines,
	label=L"g: 4x - 3y = 4", legend=:topleft)
plot!(f,-1,4, xtick=-1:1:4, xlims=(-1,4), ylims=(-2,4), 
	framestyle=:zerolines,
	label=L"f: y^{2} = 4x ", legend=:topleft)

plot!(x, f, fillrange = g, fillalpha = 0.35, c = 1, 
	label = L"f - g = y^{2} - 3y - 4 = 0", legend=:topleft)

plot!([0.42,1.95],[f(0.42),g(1.95)], label="", linecolor=:green)
plot!([0.3,1.8],[f(0.3),g(1.8)], label="", linecolor=:green)

annotate!([(0.27,1.27, (L"△ y", 8, :blue))])
annotate!([(1.95,0.97, (L"y_{i}", 8, :blue))])
annotate!([(2.13,1.17, (L"y_{i+1}", 8, :blue))])

plot!([0.45,1.97],[1.5,1.5], label="", linecolor=:blue)
annotate!(0.45,1.5, Plots.text("|", 10, :blue, rotation = 0 ))
annotate!(1.97,1.5, Plots.text("|", 10, :blue, rotation = 0 ))

annotate!([(1.41,1.7, (L" \frac{3y+4}{4} - \frac{y^{2}}{4}", 6, :blue))])

```

---

<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:** [December 21, 2022, 2:18pm UTC](https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930/2 "2022-12-21T14:18:36Z")

</div>

I am not aware of this functionality in Plots.jl

But, you could write your own curly braces function, to produce something like:

 ![Plots_curly_braces_annotated](https://global.discourse-cdn.com/julialang/original/3X/a/d/ada43ea6a399520c9f442bc1ae44cb74e53a116d.png)
