PiWi
PiWi

Reputation: 169

Why is the line callback no more triggered after zoom?

In MATLAB (R11) following code sets a callback to a line plot and is working well, before I zoom or pan the axis. After that it is not triggered anymore. What is happening? How to correct that?

function line_callback 
figure() 
hl  = line(randn(1,2),randn(1,2),'ButtonDownFcn',@set_lines); % plot and set callback 

function set_lines(cb,eventdata) 
lw = get(cb,'LineWidth');% get current line width 
set(cb,'LineWidth',lw+1) % increase current line width

Upvotes: 0

Views: 55

Answers (1)

PiWi
PiWi

Reputation: 169

The answer is: the line callback was not fired because I put the Edit Plot mode on (clicked on the arrow tool in the figure). Line callback do not seem fired when any of the figure tool is activated. When I deactivate Edit Plot mode, all works. My mistake!

Upvotes: 1

Related Questions