# Makie and polar plots, how to plot quarter circle only (sector)

**URL:** <https://discourse.julialang.org/t/makie-and-polar-plots-how-to-plot-quarter-circle-only-sector/102262>\
**Category:** General Usage\
**Tags:** plotting, makie\
**Created:** [July 30, 2023, 1:01am UTC](https://discourse.julialang.org/t/makie-and-polar-plots-how-to-plot-quarter-circle-only-sector/102262 "2023-07-30T01:01:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aran/32/32584_2.png) [@Aran](https://discourse.julialang.org/u/Aran)\
**Post date:** [July 30, 2023, 1:01am UTC](https://discourse.julialang.org/t/makie-and-polar-plots-how-to-plot-quarter-circle-only-sector/102262/1 "2023-07-30T01:01:01Z")

</div>

Hi there I have a streamlines plot that I have produced using Makie. I have plotted the streamlines using the following commands

```julia
fig_polar = Figure(resolution = (1000, 900))
ax2 = PolarAxis(
    fig_polar[1, 1], 
    thetaticks = ((((0:15:90) .* pi) / 180))
)
streamplot!(f_trans, 1+dy..α-dy, 0+dx..pi/2-dx,colormap = :magma, gridsize=(30, 30), arrow_size=9,linewidth=0.8, title="x")

fig_polar

```

 ![Screenshot_2023-07-30_01-54-20](https://global.discourse-cdn.com/julialang/original/3X/e/1/e1793fd564925634d062fe7d9b0f3c26f0991dc3.jpeg)

But I would like to only print the quarter circle is there a lims command for plotting only within a sector?  
Any help much appreciated.

---

<div class="post-metadata">

**Author:** ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)\
**Post date:** [July 31, 2023, 12:34pm UTC](https://discourse.julialang.org/t/makie-and-polar-plots-how-to-plot-quarter-circle-only-sector/102262/2 "2023-07-31T12:34:12Z")

</div>

We didn’t implement this with the first version of polar axis. It would be good to have an issue for this on github so we can keep track of it easier.

You can mess around with internals to get there, but it won’t work interactively and you’ll have to fiddle with alignments to get them to not clip.

```julia
using LinearAlgebra
begin
    fig_polar = Figure(resolution = (1000, 900))
    ax2 = PolarAxis(fig_polar[1, 1], )
    scatter!(ax2, 1 .+ rand(100), pi/2 .* rand(100))
    lines!(ax2, 1.5 .+ 0.5 .* sin.(range(0, 6pi, length = 300)), range(0, pi/2, length = 300))
    scatter!(ax2, Point2f(0, 1), color = :red)
    
    let
        view = ax2.scene.camera.view[]
        scale = diag(view)[Vec(1,2)]
        ws = widths(ax2.scene.px_area[])
        pad = Vec2f(0.03)
        trans = Vec3f((pad .- ws ./ maximum(ws))..., 0)

        ax2.scene.camera.view[] = Makie.transformationmatrix(trans, Vec3f(2scale..., 1))    
        ax2.overlay.camera.view[] = Makie.transformationmatrix(trans, Vec3f(2, 2, 1))
        ax2.overlay.plots[8].markersize[] = ax2.overlay.plots[8].markersize[] * 2
    end

    fig_polar
end

```

 ![Screenshot from 2023-07-31 14-27-16](https://global.discourse-cdn.com/julialang/original/3X/3/e/3e64dc1dc51db7c2bfdc0043eaaf598c3705e311.png)
