Reducing the number of data points on the grapth
38 views (last 30 days)
Show older comments
Hello How can i reduce the number of data points for every graph? I want the line to be plotted with the original number of data points but the marker should skip every second point.
I'm doing it like this.
clear variables;
close all;
clc;
%%loading the data files.
datafiles4={'Dualhop_TM_OFF_RD_OFF.mat','Dualhop_TM_OFF_RD_On.mat','Dualhop_TM_On_RD_OFF.mat','Dualhop_TM_ON_RD_ON.mat'};%,
% plotting the results one after another.
for scheme=1:numel(datafiles4)
load(datafiles4{scheme});
colorset=['-sg';'-ko';'-r>';'-b*'];
figure(1);
hold on;
grid on;
box on;
Power_Consumption_Rating_Store_hbs=Power_Consumption_Rating_Store_hbs/1e-9;
plot(total_offer_traffic,Power_Consumption_Rating_Store_hbs,colorset(scheme,:),'LineWidth',2);
title('Power Consumption Rating for HBS');
xlabel('Offered Traffic (Gbps)');
ylabel('Power Consumption Rating (nW per bit)');
legend('TM-Off & RD-Off','TM-Off & RD-On','TM-On & RD-Off','TM-On & RD-On','location','southEast');
hold off;
end
0 Comments
Answers (1)
Walter Roberson
on 9 Mar 2018
If you have a relatively recent MATLAB then see https://www.mathworks.com/examples/matlab/mw/graphics-ex58554486-control-placement-of-markers-along-line
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!