久久精品精选,精品九九视频,www久久只有这里有精品,亚洲熟女乱色综合一区
    分享

    matlab坐標軸設置

     昵稱16293528 2014-03-28

    matlab坐標軸設置

    (2011-05-06 11:07:36)
    標簽:

    雜談

    分類: Matlab應用

    a=linspace(1,2,10)

    plot(a,'--pr','linewidth',1.5,'MarkerEdgeColor','r','MarkerFaceColor','m','MarkerSize',10)

    legend('a','Location','best')

    title('a','FontName','Times New Roman','FontWeight','Bold','FontSize',16)

    xlabel('T','FontName','Times New Roman','FontSize',14)

    ylabel('a','FontName','Times New Roman','FontSize',14,'Rotation',0)

    axis auto equal

    set(gca,'FontName','Times New Roman','FontSize',14)

     

    1.曲線線型、顏色和標記點類型

    plot(X1,Y1,LineSpec,) 通過字符串LineSpec指定曲線的線型、顏色及數據點的標記類型。

     

         線型            顏色        數據點標記類型

     標識符  意義     標識符意義     標識符   意義

          實線      紅色           加號

        -. 點劃線      綠色            圓圈

       --    虛線      藍色           星號

        :    點線     c  藍綠色            

                      m  洋紅色         交叉符號

                      y   黃色   square(s) 方格

                       黑色  diamond(d) 菱形

                      w   白色        向上的三角形

                                     v  向下的三角形

                                     向左的三角形

                                     向右的三角形

                                 pentagram(p) 五邊形

                                  hexagram(h) 六邊形

     

    2.設置曲線線寬、標記點大小,標記點邊框顏色和標記點填充顏色等。

    plot(…,’Property Name’, Property Value, …)

     

    Property Name 意義    選項

     

    LineWidth 線寬    數值,如0.51等,單位為points

    MarkerEdgeColor 標記點邊框線條顏色顏色字符,如’g,b’等

    MarkerFaceColor 標記點內部區域填充顏色顏色字符

    MarkerSize 標記點大小   數值,單位為points

     

     

     

     

    3.坐標軸設置

    范圍設置:

    a. axis([xmin xmax ymin ymax])設置坐標軸在指定的區間

    b. axis auto 將當前繪圖區的坐標軸范圍設置為MATLAB自動調整的區間

    c. axis manual 凍結當前坐標軸范圍,以后疊加繪圖都在當前坐標軸范圍內顯示

    d. axis tight 采用緊密模式設置當前坐標軸范圍,即以用戶數據范圍為坐標軸范圍比例:

    a. axis equal 等比例坐標軸

    b. axis square 以當前坐標軸范圍為基礎,將坐標軸區域調整為方格形

    c. axis normal 自動調整縱橫軸比例,使當前坐標軸范圍內的圖形顯示達到最佳效果

    范圍選項和比例設置可以聯合使用,默認的設置為axis auto normal

     

    4.坐標軸刻度設置

    set(gca,XTick, [0 1 2]) X坐標軸刻度數據點位置

    set(gca,'XTickLabel',{'a','b','c'}) X坐標軸刻度處顯示的字符

    set(gca,'FontName','Times New Roman','FontSize',14)設置坐標軸刻度字體名稱,大小

    FontWeight,bold’ 加粗 ‘FontAngle,italic’ 斜體

    對字體的設置也可以用在title, xlabel, ylabel等中

     

    5.圖例

    legend('a','Location','best') 圖例位置放在最佳位置

     

    6.更多的設置可以在繪圖窗口中打開繪圖工具,Inspector… 中查找

     

    Various line types, plot symbols and colors may be obtained with

    PLOT(X,Y,S) where S is a character string made from one element

    from any or all the following 3 columns:

     

                 blue          point                 solid

                 green          circle             dotted

                  red              x-mark          -. dashdot

                  cyan          plus             -- dashed

                 magenta       star          (none)   no line

                 yellow           square

                 black          diamond

                 white          triangle (down)

                                  triangle (up)

                                  triangle (left)

                                  triangle (right)

                                  pentagram

                                  hexagram

     

    在使用Matlab時,經常需要將得到的數值表達成二維或三維圖像。

     

    plot(vector1,vector2)可以用來畫兩個矢量的二維圖,例如

    x=1:0.1:2*pi;

    plot(x,sin(x))可以畫正弦函數在0-2pi的上的圖像。

     

    plot函數可以接一些參數,來改變所畫圖像的屬性(顏色,圖像元素等)。下面是一些屬性的說明

                  blue(藍色)          point(點)          solid(實線)

                  green(綠色)         circle(圓圈)       dotted(點線)

                  red(紅色)           x-mark(叉號)    -.    dashdot (點畫線)

                  cyan(墨綠色)        plus(加號)       --    dashed(虛線)

                  magenta(紫紅色)     star(星號)      (none) no line

                  yellow(黃色)        square(正方形)

                  black(黑色)         diamond(菱形)

                                      triangle (down)

                                       triangle (up)

                                      triangle (left)

                                      triangle (right)

                                      pentagram

                                      hexagram

    例如,plot(x,y,'.r')表示用點來畫圖,點的顏色是紅色。

     

    plot函數可以接一些參數,來改變所畫圖像的屬性(顏色,圖像元素等)。下面是一些屬性的說明

     

                  blue(藍色)          point(點)          solid(實線)

     

                  green(綠色)         circle(圓圈)       dotted(點線)

     

                  red(紅色)           x-mark(叉號)    -.    dashdot (點畫線)

     

                  cyan(墨綠色)        plus(加號)       --    dashed(虛線)

     

                  magenta(紫紅色)     star(星號)      (none) no line

     

                  yellow(黃色)        square(正方形)

     

                  black(黑色)         diamond(菱形)

     

                                      triangle (down)

     

                                      triangle (up)

     

                                      triangle (left)

     

                                      triangle (right)

     

                                      pentagram

     

                                      hexagram

     

     

        Example

     

           x = -pi:pi/10: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畫圖時,有時候需要對各種圖標進行標注,例如,用“+”代表A的運動情況,“*”代表B的運動情況。

     

     

     

    legend函數的基本用法是

     

    LEGEND(string1,string2,string3, ...)

     

    分別將字符串1、字符串2、字符串3……標注到圖中,每個字符串對應的圖標為畫圖時的圖標。

    例如:

     

    plot(x,sin(x),'.b',x,cos(x),'+r')

     

    legend('sin','cos')這樣可以把"."標識為'sin',把"+"標識為"cos"

     

    還可以用LEGEND(...,'Location',LOC) 來指定圖例標識框的位置

     

    這些是Matlab help文件。后面一段是對應的翻譯和說明

     

            'North'              inside plot box near top

     

            'South'              inside bottom

     

            'East'               inside right

     

            'West'               inside left

     

            'NorthEast'          inside top right (default)

     

            'NorthWest           inside top left

     

            'SouthEast'          inside bottom right

     

            'SouthWest'          inside bottom left

     

            'NorthOutside'       outside plot box near top

     

            'SouthOutside'       outside bottom

     

            'EastOutside'        outside right

     

            'WestOutside'        outside left

     

            'NorthEastOutside'   outside top right

     

            'NorthWestOutside'   outside top left

     

            'SouthEastOutside'   outside bottom right

     

            'SouthWestOutside'   outside bottom left

     

            'Best'               least conflict with data in plot

     

            'BestOutside'        least unused space outside plot

     

            'North'             圖例標識放在圖頂端

     

            'South'            圖例標識放在圖底端

     

            'East'               圖例標識放在圖右方

     

            'West'              圖例標識放在圖左方

     

            'NorthEast'       圖例標識放在圖右上方(默認)

     

            'NorthWest      圖例標識放在圖左上方

     

            'SouthEast'      圖例標識放在圖右下角

     

            'SouthWest'     圖例標識放在圖左下角

     

    (以上幾個都是將圖例標識放在框圖內)

     

            'NorthOutside'          圖例標識放在圖框外側上方

     

            'SouthOutside'         圖例標識放在圖框外側下方

     

            'EastOutside'           圖例標識放在圖框外側右方

     

            'WestOutside'          圖例標識放在圖框外側左方

     

            'NorthEastOutside'   圖例標識放在圖框外側右上方

     

            'NorthWestOutside' 圖例標識放在圖框外側左上方

     

            'SouthEastOutside'   圖例標識放在圖框外側右下方

     

            'SouthWestOutside' 圖例標識放在圖框外側左下方

     

    (以上幾個將圖例標識放在框圖外)

     

            'Best'                      圖標標識放在圖框內不與圖沖突的最佳位置

     

            'BestOutside'           圖標標識放在圖框外使用最小空間的最佳位置

     

    還是用上面的例子

     

    legend('sin','cos','location','northwest')可以將標識框放置在圖的左上角。

     

        Examples:

     

            x = 0:.2:12;

     

            plot(x,bessel(1,x),x,bessel(2,x),x,bessel(3,x));

     

            legend('First','Second','Third');

     

            legend('First','Second','Third','Location','NorthEastOutside')

     

            b = bar(rand(10,5),'stacked'); colormap(summer); hold on

     

            x = plot(1:10,5*rand(10,1),'marker','square','markersize',12,...

     

                     'markeredgecolor','y','markerfacecolor',[.6 0 .6],...

     

                     'linestyle','-','color','r','linewidth',2); hold off

     

            legend([b,x],'Carrots','Peas','Peppers','Green Beans',...

     

                      'Cucumbers','Eggplant')

      本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發布,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發現有害或侵權內容,請點擊一鍵舉報。
      轉藏 分享 獻花(0

      0條評論

      發表

      請遵守用戶 評論公約

      類似文章 更多

      主站蜘蛛池模板: 日韩女同在线二区三区| 午夜av高清在线观看| 久久精品免视看国产成人| 日韩深夜视频在线观看| 亚洲av男人电影天堂热app| 小12萝8禁用铅笔自慰喷水| 日韩精品久久久久久久电影蜜臀| 精精国产XXX在线观看| 国产L精品国产亚洲区在线观看| 亚洲制服丝袜中文字幕在线| 五月天国产成人AV免费观看| 日韩人妻系列无码专区| 亚洲另类无码一区二区三区| 久久久久久亚洲精品成人| 高清无码一区二区在线观看吞精| 国产又爽又黄无码无遮挡在线观看 | 放荡的美妇在线播放| 国产精品国产三级国AV| 精品乱码无人区一区二区| 国产爆乳无码一区二区麻豆| 亚洲高清日韩专区精品| 午夜不卡欧美AAAAAA在线观看| 无码人妻一区二区三区四区AV | 亚洲男人第一无码av网站| 欧美肥老太牲交大战| 精品国产品香蕉在线| 欧美性大战久久久久XXX| 国产一区二区不卡在线| 天天影视网色香欲综合网| 精品久久人人妻人人做精品| 中文字幕人妻无码一夲道| 无码专区 人妻系列 在线| 午夜精品一区二区三区在线观看 | 麻豆国产成人AV在线播放| 亚洲乳大丰满中文字幕| 精品亚洲国产成人av| 日本无遮挡吸乳视频| 亚洲av永久无码精品水牛影视 | 久热这里只有精品12| 又爽又黄又无遮挡的视频| 蜜臀av久久国产午夜|