Try   HackMD

SciDAVis 教學 1:XY 散佈圖基本使用方法

作者:王一哲
日期:2019/12/4


SciDAVis 的全名為 Scientific Data Analysis and Visualization,照字面的意思可以翻譯為科學資料分析與視覺化工具,用來分析數據、作圖,而且它是一套自由軟體最新的版本為1.25,下載頁面在此(前往下載) 。類似的商業軟體為 OriginSigmaPlot,但是這兩套軟體的售價不便宜,都在萬元以上。雖然用 MicroSoft Excel 和 LibreOffice Calc 也能做到類似的效果,但是 SciDAVis 處理大量數據的效果更好,即使操作界面是沒有中文化,對高中生而言應該還在可接受的範圍內。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
SciDAVis

安裝軟體

如果作業系統為 Windows,請選用 scidavis.1.25-win-dist.msi,下載後使用系統管理員身份執行安裝檔,接著不斷地按下一步就完成了。如果作業系統為 Linux,請選用 scidavis-1.25.tar.gz,下載後解壓縮,再依照資料夾中的檔案 "README.installer" 的指示編輯檔案及安裝。安裝完成後執行程式,畫面如下。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
SciDAVis 畫面截圖


斜直線方程式的 XY 散佈圖

從 CSV 檔匯入資料

可以在 SciDAVis 的儲存格中手動輸入以下的數據,或是先將以下的資料複製、貼上到文字編輯器中,將檔案儲存為data.csv,文字編碼應該用 ASCII 或 UTF-8 皆可。

index,x,errx,y,erry
0,1.0,0.1,4.9,0.5
1,2.0,0.1,6.9,0.5
2,3.0,0.1,9.0,0.5
3,4.0,0.1,11.1,0.6
4,5.0,0.1,13.2,0.6
5,6.0,0.2,15.2,0.8
6,7.0,0.2,16.9,0.8
7,8.0,0.2,18.9,0.8
8,9.0,0.2,20.9,0.8
9,10.0,0.2,22.8,0.8

由選單:FileImport ASCIICtrl + K,開啟匯入檔案視窗。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯入檔案選單

由於資料是以逗號分隔,在匯入檔案視窗中,要記得將 Separator 選項改成逗號。另外也可以選擇要將資料匯入哪一個表格,可以蓋掉現有表格的資料,也可以另外增表格。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯入檔案視窗

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯入資料檔後的表格

設定欄位資料格式

接著在要修改的欄位上按滑鼠左鍵,在畫面右側也可以更改欄位的描述及資料格式。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
更改欄位的描述

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
更改欄位的資料格式

在要修改的欄位上按滑鼠右鍵,選擇Set Column(s) As即可修改欄位的資料用途,分別將欄位index設為X、欄位x設為X、欄位errx設為X Error、欄位y設為Y、欄位erry設為Y Error。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
設定欄位的資料用途

繪製帶有誤差槓的XY散佈圖

插入XY散佈圖

先選取欄位x、y之後,再從選單選取PlotScatter,或是在欄位上按滑鼠右鍵,從快速選單中選取PlotScatter

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
從選單插入XY散佈圖

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
從快速選單插入XY散佈圖

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
預設格式的XY散佈圖

修改圖片格式

如果想要修改資料點格式,可以在圖片的資料點上連點滑鼠左鍵兩下,勾選Fill Color會在點中填滿指定的顏色,Edge Color是點的邊緣線條顏色。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

修改資料點格式

點選Plot Associations,可以修改資料點x軸、y軸數值對應的欄位。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

修改資料點對應的欄

如果想要修改座標軸及標籤的格式,可以在圖片的座標軸上連點滑鼠左鍵兩下,點選Axis分頁,在Title欄位中可以修改標籤內容,支援HTML語法;點選Axis Font可以修改座標軸數字的字型及大小。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
修改座標軸性質

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
修改座標軸數字的字型

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
修改格式後的XY散佈圖

插入誤差槓

點選圖片後從選單選取GraphAdd Error Bars或按快速鍵Ctrl+B

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
插入誤差槓

勾選Existing column,從資料表中選取不準量的來源,在視窗的下方勾選X Error BarsY Error Bars,最後點選右上方的Add

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
插入誤差槓的XY散佈圖

插入趨勢線

點選圖片後從選單選取AnalysisQuick FitFit Linear

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
選單插入趨勢線

擬合的結果如下,看起來只有考慮y軸不準量。

a=1.9979669965615±0.0715310360117212
b=2.99177166800124±0.371842523931618

R2=0.999509982857237

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
擬合結果

如果要再開啟輸出結果的視窗,可以從選單選取ViewResults Log

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

開啟輸出結果視窗

匯出成圖檔

點選圖片後從選單選取FileExport GraphCurrent或按快速鍵Alt+G

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯出圖檔選單

決定存檔路徑、檔名及圖片格式,最後按存檔。經過測試後發現,存成png檔大約400KB,存成jpg檔大約35KB,但是在電腦螢幕上看起來效果差不多。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

匯出圖檔視窗

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯出的XY散佈圖

練習題

請將以下的數據輸入至 SciDAVis,繪製帶有誤差槓的 XY 散佈圖,並做線性擬合,找出最接近直線的斜率和截距,理論上擬合的結果約為

slope=3.05±0.06
intercept=5.09±0.25

R2=0.9995

index,x,errx,y,erry
0,2,0.2,-1.02,0.2
1,4,0.3,-7.13,0.5
2,6,0.1,-12.87,1.0
3,8,0.2,-19.36,1.8
4,10,0.3,-25.43,2.1
5,12,0.1,-29.87,2.0
6,14,0.3,-37.98,2.2
7,16,0.2,-43.17,1.9
8,18,0.3,-50.66,1.8
9,20,0.1,-56.45,2.1
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
練習題線性擬合結果


參考資料

  1. SciDAVis 官方網站。2019年12月4日,取自 http://scidavis.sourceforge.net/
  2. 賈至達(2017)。SciDAVis數據繪圖軟體簡介,取自 http://typt.phy.ntnu.edu.tw/images/Documentation/SciDAVis_intro_NTNU_Professor_Chia.pdf

tags:SciDAVisPhysics校訂必修