資源描述:
《matlab畫圖函數(shù)plot使用方法》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、matlab畫圖函數(shù)plot使用方法plot函數(shù)可以接一些參數(shù),來(lái)改變所畫圖像的屬性(顏色,圖像元素等)。下面是一些屬性的說(shuō)明b????blue(藍(lán)色)??????.????point(點(diǎn))??????-????solid(實(shí)線)g????green(綠色)?????o????circle(圓圈)???:????dotted(點(diǎn)線)r????red(紅色)???????x????x-mark(叉號(hào))???-.???dashdot(點(diǎn)畫線)c????cyan(墨綠色)????+????plus(加號(hào))????
2、??--???dashed(虛線)m????magenta(紫紅色)*????star(星號(hào))?????(none)noliney????yellow(黃色)????s????square(正方形)k????black(黑色)?????d????diamond(菱形)v????triangle(down)^????triangle(up)???triangle(left)>????triangle(right)p????pentagramh????hexagram???Examplex=-pi:pi/1
3、0:pi;y=tan(sin(x))-sin(tan(x));plot(x,y,'--rs','LineWidth',2,...'MarkerEdgeColor','k',...'MarkerFaceColor','g',...'MarkerSize',10)???xlabel('x');??????????ylabel('y');·用Matlab畫圖時(shí),有時(shí)候需要對(duì)各種圖標(biāo)進(jìn)行標(biāo)注,例如,用“+”代表A的運(yùn)動(dòng)情況,“*”代表B的運(yùn)動(dòng)情況。legend函數(shù)的基本用法是LEGEND(string1,strin
4、g2,string3,...)分別將字符串1、字符串2、字符串3……標(biāo)注到圖中,每個(gè)字符串對(duì)應(yīng)的圖標(biāo)為畫圖時(shí)的圖標(biāo)。例如:plot(x,sin(x),'.b',x,cos(x),'+r')legend('sin','cos')這樣可以把"."標(biāo)識(shí)為'sin',把"+"標(biāo)識(shí)為"cos"還可以用LEGEND(...,'Location',LOC)來(lái)指定圖例標(biāo)識(shí)框的位置這些是Matlabhelp文件。后面一段是對(duì)應(yīng)的翻譯和說(shuō)明???????'North'?????????????insideplotboxnear
5、top'South'?????????????insidebottom'East'??????????????insideright'West'??????????????insideleft'NorthEast'?????????insidetopright(default)'NorthWest??????????insidetopleft'SouthEast'?????????insidebottomright'SouthWest'?????????insidebottomleft'NorthOutsi
6、de'??????outsideplotboxneartop'SouthOutside'??????outsidebottom'EastOutside'???????outsideright'WestOutside'???????outsideleft'NorthEastOutside'??outsidetopright'NorthWestOutside'??outsidetopleft'SouthEastOutside'??outsidebottomright'SouthWestOutside'??out
7、sidebottomleft'Best'??????????????leastconflictwithdatainplot'BestOutside'???????leastunusedspaceoutsideplot???????'North'????????????圖例標(biāo)識(shí)放在圖頂端???????'South'???????????圖例標(biāo)識(shí)放在圖底端???????'East'??????????????圖例標(biāo)識(shí)放在圖右方???????'West'?????????????圖例標(biāo)識(shí)放在圖左方???????'
8、NorthEast'??????圖例標(biāo)識(shí)放在圖右上方(默認(rèn))???????'NorthWest?????圖例標(biāo)識(shí)放在圖左上方???????'SouthEast'?????圖例標(biāo)識(shí)放在圖右下角???????'SouthWest'????圖例標(biāo)識(shí)放在圖左下角(以上幾個(gè)都是將圖例標(biāo)識(shí)放在框圖內(nèi))???????'NorthOutside'?????????圖例標(biāo)識(shí)放在圖框外側(cè)上方???????'SouthOutside'