plot in matlab with custom colors
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a data set mentioned below
I want to make a custom plot with respect to time showing different activities(starting,moving,stopping) with different colors. an anyone help me please
댓글 수: 2
Stephen23
2018년 5월 28일
@Girish Kanika: please upload sample data (in a .mat file) by clicking the paperclip button.
"I want to make a custom plot with respect to time "
What kind of plot: a line plot, a scatter plot, a bar plot, ...? Which column contains the time data?
채택된 답변
Ameer Hamza
2018년 5월 28일
편집: Ameer Hamza
2018년 5월 28일
You can use to plot the required graphs
c2 = splitapply(@(x) {x}, c(2:end,:), findgroups(c(2:end,end)));
titles = {'accX', 'accY', 'accZ', 'Average'};
for ii=1:4
f = figure;
ax = gca;
hold(ax);
title(titles{ii});
for jj=1:length(c2)
plot([c2{jj}{:,1}], [c2{jj}{:,ii+1}], 'DisplayName', c2{jj}{1,end})
end
legend()
end
댓글 수: 7
Ameer Hamza
2018년 5월 29일
plotAccelerationColouredByActivity(), is not a MATLAB built-in function. This function is part of the Sensor Data Analytics Webinar. In order to use that function, you will need to download and place in MATLAB path.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!