How to remove the box around the legend in PyPlot.jl

hi.
I would like to remove the box around the legend in my plot.
May I ask you to how to do this. Sorry , I am new to Julia.
this is the code I use.
version of Julia :1.1.1

1

using PyPlot
x=[1,2,3,4]
y=x
figure()
plot(x,y, label=“y=x”)
legend()

If you’re not tied to PyPlot and are able to try plotting with Gaston, you can do it with

x = [1,2,3,4]
plot(x, legend="y=x", keyoptions="top left")
1 Like

legend(frameon=false)

see the matplotlib manual for more info

2 Likes

Thank you very much. I tried your solution, but did not work.
I used framealpha=0 and removed the box.
I appreciate all for helping me.
Best regards

Strange. This works on my machine:

figure()
plot(x,y, label="y=x")
legend(frameon=false)
1 Like

unfortunately none of the above worked for me, but this one works fantastic for me.

 fg_legend = :false

Example

 plot(rand(10,1), legend=:true, label="Label",  fg_legend = :false)

This looks like Plots.jl rather than PyPlot.jl

1 Like

thanks…you are correct