How to change the colour or text or delete some text of the default graph in findpeaks function?
Mostra commenti meno recenti
How to change the colour or text or delete some text of the default graph in findpeaks function?
In this code below from matlab link https://ch.mathworks.com/help/signal/ref/findpeaks.html

It used "findpeaks"
% generate data
x = linspace(0,1,1000);
base = 4*cos(2*pi*x);
Pos = [1 2 3 5 7 8]/10;
Hgt = [3 7 5 5 4 5];
Wdt = [1 3 3 4 2 3]/100;
for n = 1:length(Pos)
Gauss(n,:) = Hgt(n)*exp(-((x - Pos(n))/Wdt(n)).^2);
end
PeakSig = sum(Gauss)+base;
% findpeaks function
findpeaks(PeakSig,x,'MinPeakProminence',4,'Annotate','extents')
Risposte (1)
Muhammad Usama Sharaf SAAFI
il 16 Feb 2020
use
title('');
command to change text after findpeak() function,
use
whitebg('blue');
to change color.
9 Commenti
Matlaber
il 16 Feb 2020
Muhammad Usama Sharaf SAAFI
il 16 Feb 2020
I got your point. just use
legend('abc');
after findpeak() function it will work.
Thanks
Matlaber
il 16 Feb 2020
Muhammad Usama Sharaf SAAFI
il 16 Feb 2020
legend('abc','xyz','123');
replace "abc" "xyz" "123" with your msg.
Matlaber
il 16 Feb 2020
Muhammad Usama Sharaf SAAFI
il 16 Feb 2020
Modificato: Muhammad Usama Sharaf SAAFI
il 16 Feb 2020
Use '--b' parameter in findpeak(....,'--b') function. You can use '--r' for red color
Matlaber
il 17 Feb 2020
Muhammad Usama Sharaf SAAFI
il 17 Feb 2020
findpeaks(PeakSig,x,'MinPeakProminence',4,'Annotate','extents');
legend({'xyz','abc'},'FontSize',12,'TextColor','green');
use this command it will works perfect for you.
Thanks
Matlaber
il 17 Feb 2020
Categorie
Scopri di più su Color and Styling in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


