Plots: legend text is out of bounds

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?

This is the code I used:

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))