plot errorbars on graph for selected points
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi! I want to plot a graph of my datapoints with some errorbars. However, since i have 600 datapoints, i get 600 errorplots. That looks very messy. I wrote a script that enables selection of specific points by clicking on it. A parameter is generated which consists of zeros and only standard deviation values on the clicked datapoints. However when I plot this, it still looks messy because the bars for a standard deviation with value 0 is still displayed. Does anyone know how to get rid of these? Thanks!
This is my script:
(C_av_smooth1 containes my 600 datapoints and std_dev1 containes the standard deviation of each of these points.)
% plot graph and select the points where you want the errorbars
figure;
plot(C_av_smooth1,"LineWidth", 1)
bar_points=int16(getpts());
% list of zeros as long as the amount of data points
stdtest=zeros(1,length(std_dev1));
for i=1:length(stdtest)
for j=1:length(bar_points)
if i==bar_points(j)
stdtest(i)=std_dev1(i);
i=i+1;
end
end
end
% plot graph with errorbars on desired place
figure;
errorbar(C_av_smooth1,stdtest)
0 Kommentare
Antworten (1)
Nikhil Sonavane
am 23 Dez. 2019
You can use a for loop to scan your data and neglect data whose standard deviation is zero for plotting error bars.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Errorbars finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!