How to fill the markers in a plot?

조회 수: 394 (최근 30일)
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga 2022년 10월 6일
답변: Matt J 2022년 10월 6일
Hello all,
Can some one tell me how can I fill the markers in the plot. My code is as follows. Please help me.
Z = readtable('Experimental_data_botheq.xlsx') ;
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
data = table2array(Z) ;
plot(data(:,1), data(:,2), 'ko', 'linewidth', 2);
hold on
plot(data(:,3), data(:,4), 'ks', 'linewidth', 2);
hold on
plot(data(:,5), data(:,6), 'k^', 'linewidth', 2);
hold on
plot(data(:,7), data(:,8), 'kv', 'linewidth', 2);
hold on
plot(data(:,9), data(:,10), 'ko', 'linewidth', 2);
hold on
plot(data(:,11), data(:,12), 'ks', 'linewidth', 2);
hold on
plot(data(:,13), data(:,14), 'k^', 'linewidth', 2);
hold on
plot(data(:,15), data(:,16), 'kv', 'linewidth', 2);
hold off

채택된 답변

Matt J
Matt J 2022년 10월 6일
Z = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1147865/Experimental_data_botheq.xlsx') ;
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
data = table2array(Z) ;
plot(data(:,1), data(:,2), 'ko', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,3), data(:,4), 'ks', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,5), data(:,6), 'k^', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,7), data(:,8), 'kv', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,9), data(:,10), 'ko', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,11), data(:,12), 'ks', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,13), data(:,14), 'k^', 'linewidth', 2,'MarkerFaceColor','k');
hold on
plot(data(:,15), data(:,16), 'kv', 'linewidth', 2,'MarkerFaceColor','k');
hold off

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Test and Measurement에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by