mirtah
June 21, 2019, 3:09pm
1
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
using PyPlot
x=[1,2,3,4]
y=x
figure()
plot(x,y, label=“y=x”)
legend()
mbaz
June 21, 2019, 5:46pm
2
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
mirtah
June 23, 2019, 1:28pm
4
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)
Pawan_Kumar:
plot(rand(10,1), legend=:true, label="Label", fg_legend = :false)
This looks like Plots.jl
rather than PyPlot.jl
1 Like