不要把軟體名稱打錯,正確寫法是 gnuplot,開頭是 GNU,而非 GUN
jservImage Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
# Linux install command
sudo apt-get install -y gnuplot
$ gnuplot
G N U P L O T
Version 5.0 patchlevel 3 last modified 2016-02-21
Copyright (C) 1986-1993, 1998, 2004, 2007-2016
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type set to 'qt'
gnuplot>
gnuplot 使用多種模式呈現圖
舉例來說上面出現Terminal type set to 'qt'
表示目前使用 qt 模式畫圖
但如果你沒安裝 qt 會顯示不出來
可以先用文字模式畫圖來測試 gnuplot 是否正常,先輸入 set terminal
檢查有哪些模式
gnuplot> set terminal
Available terminal types:
cairolatex LaTeX picture environment using graphicx package and Cairo backend
canvas HTML Canvas object
cgm Computer Graphics Metafile
context ConTeXt with MetaFun (for PDF documents)
corel EPS format for CorelDRAW
dumb ascii art for anything that prints text
dxf dxf-file for AutoCad (default size 120x80)
eepic EEPIC -- extended LaTeX picture environment
emf Enhanced Metafile format
emtex LaTeX picture environment with emTeX specials
epscairo eps terminal based on cairo
epslatex LaTeX picture environment using graphicx package
fig FIG graphics language for XFIG graphics editor
gif GIF images using libgd and TrueType fonts
gpic GPIC -- Produce graphs in groff using the gpic preprocessor
hp2623A HP2623A and maybe others
hp2648 HP2648 and HP2647
hpgl HP7475 and relatives [number of pens] [eject]
imagen Imagen laser printer
jpeg JPEG images using libgd and TrueType fonts
latex LaTeX picture environment
可以看到 dump
就是用 ascii 模擬作圖
以下設定 dump
模式並畫一個範例圖,如果成功出現表示 gnuplot 正常
gnuplot> set terminal dumb
gnuplot> set xzeroaxis
gnuplot> set yzeroaxis
gnuplot> plot [-2:2] acos(1-abs(x))-pi,sqrt(1-(abs(x)-1)**2)
2 ++-------+--------+--------+--------+-------+--------+--------+-------++
+ + + + + + acos(1-abs(x))-pi ****** +
| : sqrt(1-(abs(x)-1)**2) ###### |
1 ++ ###### : ###### ++
| ######### ########## : ########## ######### |
| #### #### :#### #### |
|# #### #|
0 *+....................................................................+*
|* : *|
| *** : *** |
-1 ++ ***** : ***** ++
| ***** : ***** |
| ***** : ***** |
| ***** : ***** |
-2 ++ ***** : ***** ++
| **** : **** |
| *** :*** |
-3 ++ **** ++
+ + + + + + + + +
+--------+--------+--------+--------+-------+--------+--------+--------+
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
現在改為 qt
模式測試
gnuplot> set terminal qt
Terminal type set to 'qt'
Options are '0 font "Sans,9"'
gnuplot> set xzeroaxis
gnuplot> set yzeroaxis
gnuplot> plot [-2:2] acos(1-abs(x))-pi,sqrt(1-(abs(x)-1)**2)
gnuplot>
會跳出畫好的圖案
Learn More →
Tool
contributed by < jasonmatobo Reviewed by yuchun1214 關於 Valgrind 的部分, linenoise.c 中確有寫關於 free histroy 的函式,但程式實際上不一定會使用到,如果用 --show-reachable=no 的方式去修改得先證明 valgrind 誤判。 :::info :alien: 補充 書本模式請使用以下連結 : Linux 核心設計筆記(2021) 內容進度 : 10%
Jan 7, 2022contributed by < jasonmatobo > :::info :alien: 補充 書本模式請使用以下連結 : Linux 核心設計筆記(2021) ::: 測驗 1 container_of
Jun 21, 2021作業 第 1 周 Lab0 第 2 周 Quiz2 你所不知道的C語言 指標篇 Linux 常用工具
Mar 4, 2021複雜宣告 常會看到一些很複雜的宣告 要理解這些宣告可以簡單的用以下規則來判斷 規則 補充 1.從內往外讀 先找變數名稱
Feb 24, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up