- gnuplot Cookbook
- Lee Phillips
- 213字
- 2021-08-20 15:42:56
Graphing parametric curves
Gnuplot can graph functions whose x and y values depend on a third variable, called a parameter. In this way, more complicated curves can be drawn. The following plot resembles a lissajous figure, which can be seen on an oscilloscope when sine waves of different frequencies are controlling the x and y axes:

How to do it…
The following script creates the previous figure:
set samples 1000
set parametric
plot sin(7*t), cos(11*t) notitle
How it works…
We want more samples than the default 100 for a smoother plot, hence the first line. The second line (highlighted) changes the way gnuplot interprets plot commands; now the two functions (in the third line) are understood to provide x and y coordinates in the plane as the parameter t
is varied. Once we say set parametric
, then we can say plot x(t), y(t)
, and the plot will trace out a curve given by x
and y
as t
is varied between the limits given in trange.
There's more…
The range of values that t
varies through to draw the plot defaults to [-5:5]
. Try out different ranges to see what happens by setting the trange
. For example, you can say set trange [0:2]
and then replot
to see the effect.
- 從零開始學Hadoop大數(shù)據(jù)分析(視頻教學版)
- Python數(shù)據(jù)分析入門:從數(shù)據(jù)獲取到可視化
- 輕松學大數(shù)據(jù)挖掘:算法、場景與數(shù)據(jù)產(chǎn)品
- Mockito Cookbook
- 信息學競賽寶典:數(shù)據(jù)結構基礎
- SQL應用及誤區(qū)分析
- 云數(shù)據(jù)中心網(wǎng)絡與SDN:技術架構與實現(xiàn)
- IPython Interactive Computing and Visualization Cookbook(Second Edition)
- 改進的群智能算法及其應用
- SOLIDWORKS 2018中文版機械設計基礎與實例教程
- Machine Learning for Mobile
- 產(chǎn)品經(jīng)理數(shù)據(jù)修煉30問
- 大數(shù)據(jù)架構師指南
- CORS Essentials
- 從運維菜鳥到大咖,你還有多遠II:企業(yè)數(shù)據(jù)中心建設及管理