- gnuplot Cookbook
- Lee Phillips
- 266字
- 2021-08-20 15:42:56
Making an impulse plot
Impulse or stick plots are another way to represent discrete points. If the line thickness is made large, the impulse plot can be made to look like a bar chart.

How to do it…
The following script illustrates the use of the impulses
style:
set samples 30 plot [0:2*pi] sin(x) with impulses lw 2
How it works…
The first command set the number of points used to sample or plot the function. The plot command tells gnuplot to use the impulse style, which draws a line from the x-axis to each y value; the thickness of the line is given by lw 2
.
There's more…
A "stem plot" is sometimes used in electrical engineering. It is similar to the impulse plot, but with a mark at the end of each stick; this allows the eye to more easily follow the trend of the data; conversely, the sticks make it easier to read the graph, especially when the data is sparse, compared with a simple point plot. Use the following recipe to create a stem plot of a decaying sine wave, illustrated in the following figure:
set samples 50 plot [0:4*pi] exp(-x/4.)*sin(x) with impulses lw 2 notitle,\exp(-x/4.)*sin(x) with points pt 7

As you can see, we have plotted the same function twice. The first time through plot the impulses, as in the previous script, and the second time we plot the function again with points
to draw the dots.
The previous plot shows a typical exponentially damped sine wave; it represents, for example, the motion of a pendulum with friction.
- 數據之巔:數據的本質與未來
- Architects of Intelligence
- 計算機信息技術基礎實驗與習題
- 企業大數據系統構建實戰:技術、架構、實施與應用
- 揭秘云計算與大數據
- 算法與數據中臺:基于Google、Facebook與微博實踐
- Mastering Machine Learning with R(Second Edition)
- 數據庫原理與應用(Oracle版)
- 數亦有道:Python數據科學指南
- 數據科學工程實踐:用戶行為分析與建模、A/B實驗、SQLFlow
- INSTANT Android Fragmentation Management How-to
- Solaris操作系統原理實驗教程
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- 大數據技術體系詳解:原理、架構與實踐
- 產品經理數據修煉30問