# Create custom shapes in Makie.jl

**URL:** <https://discourse.julialang.org/t/create-custom-shapes-in-makie-jl/117000>\
**Category:** Visualization\
**Created:** [July 13, 2024, 3:07pm UTC](https://discourse.julialang.org/t/create-custom-shapes-in-makie-jl/117000 "2024-07-13T15:07:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [July 13, 2024, 3:07pm UTC](https://discourse.julialang.org/t/create-custom-shapes-in-makie-jl/117000/1 "2024-07-13T15:07:19Z")

</div>

Hello,

I would like to create a custom shape using Makie.jl. Something like the figure below

![image](https://global.discourse-cdn.com/julialang/original/3X/a/5/a5d78e181074d8575ede3d4bc90fcb315b96c05f.png)

This is basically a rectangle with one curved side instead of strainght.

I have no clue if it is possible to create such a shape using Makie.jl.

I know there are the `mesh` and `poly` function. The latter should be used only for straight lines, I guess.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [July 13, 2024, 3:41pm UTC](https://discourse.julialang.org/t/create-custom-shapes-in-makie-jl/117000/2 "2024-07-13T15:41:03Z")

</div>

You can use BezierPath to define such shapes for use with scatter or poly.

> **[scatter | Makie](https://docs.makie.org/stable/reference/plots/scatter#Bezier-path-markers)**
>
> Create impressive data visualizations with Makie, the plotting ecosystem for the Julia language. Build aesthetic plots with beautiful customizable themes, control every last detail of publication quality vector graphics, assemble complex layouts and...

You’ll need MoveTo, LineTo, EllipticalArc and ClosePath for yours

---

<div class="post-metadata">

**Author:** ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Post date:** [July 13, 2024, 4:49pm UTC](https://discourse.julialang.org/t/create-custom-shapes-in-makie-jl/117000/3 "2024-07-13T16:49:30Z")

</div>

Ok thanks, the following code worked

```julia
fig = Figure()
ax = Axis(fig[1, 1])

path_prova = BezierPath([
    MoveTo(1, 1), # Upper-right corner
    LineTo(0, 1), # Upper-left corner
    LineTo(0, 0), # Lower-left corner
    LineTo(1, 0), # Lower-right corner
    CurveTo(Point2f(0.5, 0.4), Point2f(0.5, 0.6), Point2f(1, 1)), # Upper-right corner
    ClosePath()
])

poly!(ax, path_prova; color=:black)

fig

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/7/476cd33e6c60d3bd5c466917af9ac2d222e704c4.png)
