# How to crop or zoom into a plot area

**URL:** <https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [June 27, 2020, 12:34pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151 "2020-06-27T12:34:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alireza\_Ghavaminia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alireza_ghavaminia/32/14397_2.png) [@Alireza\_Ghavaminia](https://discourse.julialang.org/u/Alireza_Ghavaminia)\
**Post date:** [June 27, 2020, 12:34pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151/1 "2020-06-27T12:34:06Z")

</div>

Hello,  
I have a polar plot, and I want to zoom into one section of it, How can I do that.

```julia
using Plots
x = [0,pi/6,pi/4,pi/3,pi/2] # theta
y = [0,0.1, 0.2, 0.3, 0.4] # r
p = plot(x,y,axis=false,legend=false,proj =:polar)

```

let say I want to zoom in a section with r limit [0.1,0.3] and theta limit =[pi/6, pi/2].  
How can I do that?  
I saw the `lens` function, but it seems that it only works with cartesian plots.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [June 27, 2020, 1:02pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151/2 "2020-06-27T13:02:22Z")

</div>

Maybe not what you’re looking for, but the PlotlyJS backend has very nice interactive zooming and panning.

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [June 27, 2020, 1:04pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151/3 "2020-06-27T13:04:47Z")

</div>

If you want interactive zooming and panning, try using the Plotly backend by calling the function `plotly()` before you create your plot.

---

<div class="post-metadata">

**Author:** ![Alireza\_Ghavaminia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alireza_ghavaminia/32/14397_2.png) [@Alireza\_Ghavaminia](https://discourse.julialang.org/u/Alireza_Ghavaminia)\
**Post date:** [June 27, 2020, 1:07pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151/4 "2020-06-27T13:07:37Z")

</div>

I need something more like a croping tool, which can crop a section of a plot.  
I am making a gif so interactive zooming isn’t helpful to me.

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [June 27, 2020, 1:14pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151/5 "2020-06-27T13:14:44Z")

</div>

Use `xlim` and `ylim` to specify boundaries for the plot area. You’ll get a rectangular area and you’ll need to do your own polar to rectangular conversion first.

Edit: an example of use is here: [Home · Plots](http://docs.juliaplots.org/latest/#simple-is-beautiful-1)
