É possível fazer isso. O código a seguir cria um círculo (o) na posição de dados 5. Além disso, ele adiciona uma dica de ferramenta. (fonte: link )
xdata=1:1:100;
ydata=rand(100,1);
% First plot the data
hLine = plot(xdata, ydata);
% First get the figure's data-cursor mode, activate it, and set some of its properties
cursorMode = datacursormode(gcf);
set(cursorMode, 'enable','on');
% Note: the following code was adapted from %matlabroot%\toolbox\matlab\graphics\datacursormode.m
% Create a new data tip
hTarget = handle(hLine);
hDatatip = cursorMode.createDatatip(hTarget);
% Update the datatip marker appearance
set(hDatatip, 'MarkerSize',5, 'MarkerFaceColor','none', ...
'MarkerEdgeColor','k', 'Marker','o', 'HitTest','off');
% Move the datatip to the right-most data vertex point
position = [xdata(5),ydata(5),1; xdata(end),ydata(end),-1];
update(hDatatip, position);
Emsegundolugar,minhaprópriaideia,queéumpoucomaisfácil:
figurexdata=1:1:100;ydata=rand(100,1);sells=[10,15,25]buys=[51220]plot(xdata,ydata)holdonfori=buysiplot(xdata(i),ydata(i),'go','MarkerSize',6,'LineWidth',3);endfori=sellsplot(xdata(i),ydata(i),'ro','MarkerSize',6,'LineWidth',3);end