actions utilisateurs pour tracer sur objet axes
Bonjour
voici une partie du code que j'utilise pour le moment
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
function test()
%[...]
fig=figure();
ax=axes('parent',fig);
semilogx(r(:,1),r(:,2),'g',r(:,1),r(:,3),'r')
grid on
axis([15 22050 40 100])
set(ax,'ButtonDownFcn',@(src,evnt)plot_ref(fig,src));
function plot_ref(fig,src)
if strcmp(get(fig,'SelectionType'),'alt')
get(src,'CurrentPoint')
end |
j'ai quelques problèmes notament : sur les courbes tracées auparavent ou peut-être même à proximité, le callback n'est pas appelé. le callback est défini à cet endroit à cuase de :
Citation:
Some Plotting Functions Reset the ButtonDownFcn
Most MATLAB plotting functions clear the axes and reset a number of axes properties, including the ButtonDownFcn before plotting data. If you want to create an interface that enables users to plot data interactively, consider using a control device such as a push button (uicontrol), which is not affected by plotting functions. See Example — Using Function Handles in GUIs for an example.
If you must use the axes ButtonDownFcn to plot data, then you should use low-level functions such as line patch, and surface and manage the process with the figure and axes NextPlot properties.
merci pour votre aide