Need to plot points
이전 댓글 표시
Hello every one
I have an assignment,PLEASE , I need to draw a group of points
(x,y1) in red colour
(x,y2) in blue colour
(x,y3) in green
(x,y4) in pink
(x,y5) in yallow
at the same time in the form of specifying their points only and in different colors to distinguish them and with the extension of certain numbers to the x-axis shown in the picture
I drew the points in Excel, but the only error in the drawing is the presence of a straight line connecting the points, and this is not what I want. In addition, in Excel, I cannot enlarge the drawing, nor can I show a clearer picture of the points that contain 0.000, the points appear as on the zero axis, which they are not
I searched a lot with Matlab commands in drawing and found it
scatter(x,y1,'ro') ...
I used it in the attached file, but the output of the drawing is not in the description I mentioned above
is possible to plot in matlab ??
if any prof can help me thanks alot.
채택된 답변
추가 답변 (1개)
It isn't pretty but this is the closest I could come up with to reproducing what you appear to want.
x =[ 1 2 3 4 10 1 2 3 4 10 1 2 3 4 10 ];
y1=[ 2 1 5 3 1 0.2 0.1 0.5 0.3 0.1 2.00E-03 1.00E-03 5.00E-03 3.00E-03 1.00E-03 ];
y2=[ 4 3 7 4 4 0.4 0.3 0.7 0.4 0.4 4.00E-03 3.00E-03 7.00E-03 4.00E-03 4.00E-03 ];
y3=[ 6 5 8 7 6 0.6 0.5 0.8 0.7 0.6 6.00E-03 5.00E-03 8.00E-03 7.00E-03 6.00E-03 ];
y4=[ 5 4 8 5 5 0.4 0.3 0.7 0.4 0.4 4.00E-03 3.00E-03 7.00E-03 4.00E-03 4.00E-03 ];
y5=[ 6 6 9 8 7 0.6 0.5 0.8 0.7 0.6 6.00E-03 5.00E-03 8.00E-03 7.00E-03 6.00E-03 ];
figure(1)
plot(1:15, y1, 'x', 1:15, y2, 'sq', 1:15, y3, '^', 1:15, y4, '+', 1:15, y5, 'o');
xticks(1:15)
xticklabels({'1' '2' '3' '4' '10' '1' '2' '3' '4' '10' '1' '2' '3' '4' '10'})
grid on
I think it looks better with the lines.
figure(2)
plot(1:15, y1, 'x-', 1:15, y2, 'sq-', 1:15, y3, '^-', 1:15, y4, '+-', 1:15, y5, 'o-');
xticks(1:15)
xticklabels({'1' '2' '3' '4' '10' '1' '2' '3' '4' '10' '1' '2' '3' '4' '10'})
grid on
카테고리
도움말 센터 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



