• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    如何畫具有多列的圖例

    手把手教學。

    東西/原料

    • matlab
    • 電腦

    方式/步調

    1. 1

      號令行鍵入:

      x = linspace(0,10);

      %界說x。

    2. 2

      號令行鍵入:

      y1 = sin(x);

      y2 = sin(0.9*x);

      y3 = sin(0.8*x);

      y4 = sin(0.7*x);

      y5 = sin(0.6*x);

      y6 = sin(0.5*x);

      %界說y1,y2,y3,y4,y5,y6。

    3. 3

      號令行鍵入:

      plot(x,y1,'DisplayName','sin(x)')

      %繪圖。

    4. 4

      號令行鍵入:

      hold on

      %圖形連結。

    5. 5

      號令行鍵入:

      plot(x,y2,'DisplayName','sin(0.9x)')

      plot(x,y3,'DisplayName','sin(0.8x)')

      plot(x,y4,'DisplayName','sin(0.7x)')

      plot(x,y5,'DisplayName','sin(0.6x)')

      plot(x,y6,'DisplayName','sin(0.5x)')

      %繪圖。

    6. 6

      號令行鍵入:

      hold off

      %打消連結

    7. 7

      號令行鍵入:

      lgd = legend;

      %標簽。

    8. 8

      號令行鍵入:

      lgd.NumColumns = 2;

      %經由過程將 NumColumns 屬性設置為 2 來添加一個具有兩列的圖例。

      END
    • 發表于 2020-04-10 17:01
    • 閱讀 ( 876 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    admin
    admin

    0 篇文章

    作家榜 ?

    1. xiaonan123 189 文章
    2. 湯依妹兒 97 文章
    3. luogf229 46 文章
    4. jy02406749 45 文章
    5. 小凡 34 文章
    6. Daisy萌 32 文章
    7. 我的QQ3117863681 24 文章
    8. 華志健 23 文章

    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆