Matlab---畫圖線型、符號及顏色


 

Matlab 畫圖

線形、顏色、數據點形狀的選擇

1,線形

- Solid line (default)
-- Dashed line
: Dotted line
-. Dash-dot line

2,顏色

r Red
g Green
b Blue
c Cyan
m Magenta
y Yellow
k Black
w White


3,數據點的形狀

+ Plus sign
o Circle
* Asterisk
. Point
x Cross
'square' or s Square
'diamond' or d Diamond
^ Upward-pointing triangle
v Downward-pointing triangle
> Right-pointing triangle
'pentagram' or p Five-pointed star (pentagram)
'hexagram' or h Six-pointed star (hexagram)

4,例子

Plot the sine function over three different ranges using different line styles, colors, and markers.

t = 0:pi/20:2pi;
plot(t,sin(t),'-.r
')
hold on
plot(t,sin(t-pi/2),'--mo')
plot(t,sin(t-pi),':bs')
hold off

5,附錄,概括為:

線型

說明

標記符

說明

顏色

說明

-

實線(默認)

+

加號符

r

紅色

--

雙划線

o

空心圓

g

綠色

:

虛線

*

星號

b

藍色

:.

點划線

.

實心圓

c

青綠色

   

x

叉號符

m

洋紅色

   

s

正方形

y

黃色

   

d

菱形

k

黑色

   

^

上三角形

w

白色

   

v

下三角形

   
   

>

右三角形

   
   

<

左三角形

   
   

p

五角星

   
   

h

六邊形

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM