# Plots: legend text is out of bounds

**URL:** https://discourse.julialang.org/t/plots-legend-text-is-out-of-bounds/32304
**Category:** General Usage
**Tags:** question, plotting
**Created:** [December 15, 2019, 3:22pm UTC](https://discourse.julialang.org/t/plots-legend-text-is-out-of-bounds/32304 "2019-12-15T15:22:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![roi.holtzman](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)
#### Post date: [December 15, 2019, 3:22pm UTC](https://discourse.julialang.org/t/plots-legend-text-is-out-of-bounds/32304/1 "2019-12-15T15:22:47Z")

</div>

When plotting legend, the text go out of bounds (note the 100 that goes out of the frame). Is there a way to fix it?

 ![Screen Shot 2019-12-15 at 17.19.59](https://global.discourse-cdn.com/julialang/original/3X/f/3/f38631cf9e5d85d620bed659316d6cd2bf200313.png)

This is the code I used:

```julia
p1 = hline([I(E)], xlabel=L"\theta", ylabel=L"I", label="")
for (i, T) in enumerate(Ts_dist)
    p1 = scatter!(mod.(run_no_FF_dict[T]["θ_final"], 2π), 
        run_no_FF_dict[T]["I_final"], markerstrokewidth = 0, markersize = 2, 
        label="\$\\tau = $(T)\$", legend=:topleft, color=(cgrad(g) |> C)[i])
end
p1 = plot(p1, yticks=1.660:0.005:1.7, xlims=(0,2π), dpi=200, legend=:outerleft)
p2 = hline([I(E)], xlabel=L"\theta", ylabel=L"I", label="")
for (i, T) in enumerate(Ts_dist)
    p2 = scatter!(mod.(run_no_FF_dict[T]["θ_final"], 2π), 
        run_no_FF_dict[T]["I_final"], markerstrokewidth = 0, markersize = 2, 
        label="\$\\tau = $(T)\$", legend=:topleft, color=(cgrad(g) |> C)[i])
end
p2 = plot(p2, yticks=1.660:0.0005:1.7, xlims=(0,2π), dpi=200, ylims=(1.677, 1.678), 
    legend=:outerleft)
plot(p1, p2, layout=(2, 1), dpi=200, legend=:outertopleft, size=(600, 600))

```
