# How to reduce the left margin of plot with PyPlot?

**URL:** <https://discourse.julialang.org/t/how-to-reduce-the-left-margin-of-plot-with-pyplot/93507>\
**Category:** New to Julia\
**Created:** [January 25, 2023, 12:51pm UTC](https://discourse.julialang.org/t/how-to-reduce-the-left-margin-of-plot-with-pyplot/93507 "2023-01-25T12:51:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Post date:** [January 25, 2023, 12:51pm UTC](https://discourse.julialang.org/t/how-to-reduce-the-left-margin-of-plot-with-pyplot/93507/1 "2023-01-25T12:51:45Z")

</div>

Hello,  
I am plotting with PyPlot adding a legend on the right side with

```julia
    legend(handles = [active_contour, passive_contour], bbox_to_anchor=[1.2,1], loc=2, borderaxespad=0, title="Margins", fancybox="true")

```

The legend ends up outside the margins of the plot.  
How can I reduce the left margin to better accommodate for the legend?  
Thank you
