- gnuplot Cookbook
- Lee Phillips
- 367字
- 2021-08-20 15:42:54
Making a scatterplot
If you are in possession of a collection of measurements that, as is usually the case, is subject to random errors, an attempt to simply plot a curve through the measurements may result in a chaotic graph that will be difficult to interpret. In these cases, one usually begins with a scatterplot, which is simply a plot of a dot or small symbol at each data point. An examination of such a plot often leads to the discovery of correlations or patterns.

Getting ready
To make this recipe interesting, we need some slightly random-looking data. You may have some available, in which case you merely need to ensure that it is in a format that gnuplot can read. Simply arrange the data so that each line of the file contains one data point with space-separated x and y values:
x1 y1 x2 y2 ...
Then name the file scatter.dat
.
If you don't have such a file of your own handy, use the one called scatter.dat
that we have provided. Make sure that the file is in the directory in which you have started gnuplot, so that the program can find it.
How to do it…
Now simply tell gnuplot:
plot 'scatter.dat' with points pt 7
If you are using the file we provided, you will get a plot similar to the one shown in the previous figure.
There's more…
You can plot the points using different symbols. Try plot 'scatter.dat' with dots
to get the smallest dot available to your terminal. For use with scatterplots of very large datasets, try the following command:
plot 'scatter.dat' with points pt n
With different integers for n
. pt
stands for pointtype, and the different pointtypes available are dependent on your terminal. Simply type test
in gnuplot to see a demonstration of all the pointtypes available for the currently selected terminal. You can find more about point and line styles in Chapter 3, Applying Colors and Styles.
- 文本數(shù)據(jù)挖掘:基于R語言
- 商業(yè)分析思維與實(shí)踐:用數(shù)據(jù)分析解決商業(yè)問題
- 大數(shù)據(jù)算法
- Python醫(yī)學(xué)數(shù)據(jù)分析入門
- 深度剖析Hadoop HDFS
- 數(shù)據(jù)庫原理與應(yīng)用(Oracle版)
- 智能數(shù)據(jù)時(shí)代:企業(yè)大數(shù)據(jù)戰(zhàn)略與實(shí)戰(zhàn)
- 云數(shù)據(jù)中心網(wǎng)絡(luò)與SDN:技術(shù)架構(gòu)與實(shí)現(xiàn)
- 新手學(xué)會(huì)計(jì)(2013-2014實(shí)戰(zhàn)升級(jí)版)
- Unreal Engine Virtual Reality Quick Start Guide
- 大數(shù)據(jù)數(shù)學(xué)基礎(chǔ)(Python語言描述)
- 活用數(shù)據(jù):驅(qū)動(dòng)業(yè)務(wù)的數(shù)據(jù)分析實(shí)戰(zhàn)
- 從實(shí)踐中學(xué)習(xí)sqlmap數(shù)據(jù)庫注入測(cè)試
- 數(shù)據(jù)產(chǎn)品經(jīng)理寶典:大數(shù)據(jù)時(shí)代如何創(chuàng)造卓越產(chǎn)品
- 數(shù)據(jù)分析實(shí)踐:專業(yè)知識(shí)和職場(chǎng)技巧