3. ตั้งชื่อแกน X และแกน Y
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
กด Enter
ผลจะปรากฏตามรูป
4. ลักษณะเส้นกราฟ
เปลี่ยนเส้นกราฟเป็นสีแดง
สีที่ใช้ในการเปลี่ยนเส้น มี สีแดง (Red), สีเขียว (Green), สีเหลือง (Yellow), สีนํ้าเงิน (Blue), สีดํา (K)
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
plot(x,y,’red’)
กด Enter
ผลจะปรากฏตามรูป
5. เปลี่ยนเส้นกราฟเป็นเส้นปะ
การทํากราฟให้เป็นเส้นปะ ใช้ (- -)
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
plot(x,y,’red’)
plot(x,y,’—r’)
กด Enter
ผลจะปรากฏตามรูป
6. เปลี่ยนเส้นกราฟเป็นเส้นปะสลับกับจุด
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
plot(x,y,’red’)
plot(x,y,’--r’)
plot(x,y,’-.r’)
กด Enter
ผลจะปรากฏตามรูป
7. เปลี่ยนเส้นกราฟเป็นเส้นปะสลับเครื่องหมายบวก
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
plot(x,y,’red’)
plot(x,y,’--r’)
plot(x,y,’-.r’)
plot(x,y,’-+r’)
กด Enter
ผลจะปรากฏตามรูป
8. เปลี่ยนเส้นกราฟเป็นเส้นปะสลับวงกลม
ใช้คําสั่ง
x = [4 7 16];
y = [1 2 3];
plot (x,y)
title(‘score of crassroom’)
xlable(‘crassroom’)
ylable(‘score’)
plot(x,y,’red’)
plot(x,y,’--r’)
plot(x,y,’-.r’)
plot(x,y,’-+r’)
plot(x,y,’-or’)
กด Enter
ผลจะปรากฏตามรูป
9. 2) การพล็อตกราฟ 3 เส้น
พล็อตกราฟ 3 เส้น
ใช้คําสั่ง
x = [2 5 9 10 21];
y = [3 9 5 11 13];
z = [4 6 9 3 21];
t = [3 4 5 6 7];
plot(x,t,’—r’,y,t,’-.b’,z,t,’-^k’)
กด Enter
ผลจะปรากฏตามรูป