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

    Gnuplot中如何設置線型、線寬與顏色

    Gnuplot是一款科學繪圖工具,可以把數據及數學函數轉換為二維或三維圖形。上一講中,小編介紹了如何用Gnuplot如何繪制二維函數曲線圖,這次小編要講解的是Gnuplot中如何設置使用不同線型、線寬、顏色來繪制曲線。

    工具/材料

    電腦Windows7系統

    操作方法

    • 01

      Gnuplot調用腳本文件。
      將所有命令寫入腳本文件,例如test.plt,在gnuplot 命令終端中輸入load 'test.plt',運行腳本中的命令,即可繪制出曲線。此時繪制出的曲線使用的是默認的線型 "line"。

    • 02

      繪制帶數據點標記的線型。
      如果要把數據點標記出,需要使用線型"linespoints"。
      輸入命令:plot sin(x) with linespoints linestyle 1。
      此時,曲線數據點是由"+"符號標記出來的。

    • 03

      如果只需要標記數據點,不需要數據點之間的連線,可使用"points"。
      同時,可用"pointstype"來修改標記點的類型。
      如改用圓圈標記數據點,則輸入命令:
      plot sin(x) with points pointstype 6。

    • 04

      繪制虛線線型
      第一種方法是使用"line"或者"linespoints",加上"linestyle 0" ,輸入命令:
      plot sin(x) with linespoints linestyle 0

    • 05

      繪制虛線線型
      繪制虛線線型的另外一種方法,使用"line dashtype 0",輸入命令:
      plot sin(x) with line dashtype 0

    • 06

      繪制長虛線
      繪制長虛線使用"line dashtype 2",輸入命令:
      plot sin(x) with line dashtype 2。

    • 07

      繪制點劃線
      繪制點劃線使用"line dashtype 4",輸入命令:
      plot sin(x) with line dashtype 4

    • 08

      繪制雙點劃線
      繪制雙點劃線使用"line dashtype 5",輸入命令:
      plot sin(x) with line dashtype 5

    • 09

      改變線寬
      改變線寬使用"linewidth" + 寬度值,輸入命令:
      plot sin(x) with line dashtype 5 linewidth 2

    • 10

      改變線的顏色
      改變線的顏色使用"linecolor"+顏色(英文)名稱,輸入命令:
      plot sin(x) with line dashtype 5 linewidth 2 linecolor‘red’。
      也可以換成其他顏色,如blue,black……

    • End
    • 發表于 2017-10-27 00:00
    • 閱讀 ( 5399 )
    • 分類:電腦網絡

    你可能感興趣的文章

    相關問題

    0 條評論

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