ibbore
ibbore

Reputation: 97

Fix position of legend in MATLAB

How do I fix the position of a legend in a MATLAB figure?

I'm currently building a GUI, intended for public use, and when figures inside the GUI are produced I do not want the user to be able to move the legend by click-and-drag. Anyone?

Upvotes: 5

Views: 1536

Answers (1)

bdecaf
bdecaf

Reputation: 4732

You have to remove the buttonDownFcn from the legend.

snippet:

line(rand(1,3),rand(1,3))
l=legend('location','ne')
set(l,'ButtonDownFcn',[])

Upvotes: 3

Related Questions