Isra
Isra

Reputation: 155

scatter plots in matlab Gui

I'm trying to plot a signal that has paeks and plot it, I have another function that will detect those peaks and return their adresses or locations. I'd like to plot both the signal and scatter dots on the locations of the peaks with the help of the adresses vector. I'm using Matlab GUI, I only seem to have either the scattered points alone of the original signal alone. Here is the lines responsible for plotting this signal :

        plot(handles.axes7, t, Outw2);
        hold on;
        scatter(handles.axes7,locs_Rwave,Outw2(locs_Rwave),400,'.')
        hold off;

locs_Rwave has the adresses of the peaks,Can someone point me in the right direction?

Thanks

Upvotes: 0

Views: 395

Answers (1)

user4085386
user4085386

Reputation:

You have to first get the current axes set to handles.axes7.

You may want to do the following:

axes(handles.axes7); % to set the current axes
plot(t, Outw2);
hold on;
scatter(locs_Rwave, Outw2(locs_Rwave), 400, 'g*'); % changed . to g*
hold off;

Upvotes: 0

Related Questions