資源描述:
《matlab畫(huà)圖設(shè)置(坐標(biāo)軸、曲線、顏色)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、matlab畫(huà)圖設(shè)置(坐標(biāo)軸、曲線、顏色)??a=linspace(1,2,10)plot(a,'--pr','linewidth',1.5,'MarkerEdgeColor','r','MarkerFaceColor','m','MarkerSize',10)legend('a','Location','best')title('a','FontName','TimesNewRoman','FontWeight','Bold','FontSize',16)xlabel('T','FontName','TimesNewRoman','FontSize',14)yla
2、bel('a','FontName','TimesNewRoman','FontSize',14,'Rotation',0)axisautoequalset(gca,'FontName','TimesNewRoman','FontSize',14)?1.曲線線型、顏色和標(biāo)記點(diǎn)類(lèi)型plot(X1,Y1,LineSpec,…)通過(guò)字符串LineSpec指定曲線的線型、顏色及數(shù)據(jù)點(diǎn)的標(biāo)記類(lèi)型。??????線型????????????顏色????????數(shù)據(jù)點(diǎn)標(biāo)記類(lèi)型?標(biāo)識(shí)符??意義?????標(biāo)識(shí)符意義?????標(biāo)識(shí)符???意義????-????實(shí)線?????r???紅色?
3、???????+?????加號(hào)????-.點(diǎn)劃線?????g???綠色????????o?????圓圈???--????虛線?????b???藍(lán)色????????*?????星號(hào)????:????點(diǎn)線?????c??藍(lán)綠色????????.??????點(diǎn)??????????????????m??洋紅色???????x???交叉符號(hào)??????????????????y???黃色???square(或s)方格??????????????????k???黑色??diamond(或d)菱形??????????????????w???白色???????^??向上的三角形??
4、???????????????????????????????v?向下的三角形?????????????????????????????????>??向左的三角形??????????????????????????????????向右的三角形?????????????????????????????pentagram(或p)五邊形??????????????????????????????hexagram(或h)六邊形?2.設(shè)置曲線線寬、標(biāo)記點(diǎn)大小,標(biāo)記點(diǎn)邊框顏色和標(biāo)記點(diǎn)填充顏色等。plot(…,’PropertyName’,PropertyValue,…)?P
5、ropertyName意義????選項(xiàng)?LineWidth線寬????數(shù)值,如0.5,1等,單位為pointsMarkerEdgeColor標(biāo)記點(diǎn)邊框線條顏色顏色字符,如’g’,’b’等MarkerFaceColor標(biāo)記點(diǎn)內(nèi)部區(qū)域填充顏色顏色字符MarkerSize標(biāo)記點(diǎn)大小???數(shù)值,單位為points????3.坐標(biāo)軸設(shè)置范圍設(shè)置:a.axis([xminxmaxyminymax])設(shè)置坐標(biāo)軸在指定的區(qū)間b.axisauto將當(dāng)前繪圖區(qū)的坐標(biāo)軸范圍設(shè)置為MATLAB自動(dòng)調(diào)整的區(qū)間c.axismanual凍結(jié)當(dāng)前坐標(biāo)軸范圍,以后疊加繪圖都在當(dāng)前坐標(biāo)軸范圍內(nèi)顯示d.
6、axistight采用緊密模式設(shè)置當(dāng)前坐標(biāo)軸范圍,即以用戶數(shù)據(jù)范圍為坐標(biāo)軸范圍比例:a.axisequal等比例坐標(biāo)軸b.axissquare以當(dāng)前坐標(biāo)軸范圍為基礎(chǔ),將坐標(biāo)軸區(qū)域調(diào)整為方格形c.axisnormal自動(dòng)調(diào)整縱橫軸比例,使當(dāng)前坐標(biāo)軸范圍內(nèi)的圖形顯示達(dá)到最佳效果范圍選項(xiàng)和比例設(shè)置可以聯(lián)合使用,默認(rèn)的設(shè)置為axisautonormal?4.坐標(biāo)軸刻度設(shè)置set(gca,’XTick’,[012])X坐標(biāo)軸刻度數(shù)據(jù)點(diǎn)位置set(gca,'XTickLabel',{'a','b','c'})X坐標(biāo)軸刻度處顯示的字符set(gca,'FontName','Tim
7、esNewRoman','FontSize',14)設(shè)置坐標(biāo)軸刻度字體名稱(chēng),大小‘FontWeight’,’bold’加粗‘FontAngle’,’italic’斜體對(duì)字體的設(shè)置也可以用在title,xlabel,ylabel等中?5.圖例legend('a','Location','best')圖例位置放在最佳位置?6.更多的設(shè)置可以在繪圖窗口中打開(kāi)繪圖工具,Inspector…中查找?Variouslinetypes,plotsymbolsandcolorsmaybeobtainedwithPLOT(X,Y,S)whereSisacharacterstrin