官术网_书友最值得收藏!

Making a basic histogram plot

This recipe shows you how to make the simplest step-type histogram. Later, we will build histogram and statistical plots on this, but sometimes this is all you need. The following figure shows a simple step-type histogram:

Making a basic histogram plot

Getting ready

We're going to plot a part of our file parabola.text, so make sure that's still available. Of course, if you have your own sorted statistical data that will probably be more interesting.

How to do it…

Type the following command to make a histogram plot:

plot [-2:2] 'parabola.text' with histeps

How it works…

As we can see, rather than drawing a line through a series of x-y points, the histeps style draws a staircase composed of horizontal and vertical line segments. The vertical lines are drawn not at the actual x-coordinates given in the data, but at the average values of neighboring x-coordinates. This is the usual way to construct a histogram, where each box represents "how much" is contained in each interval between two x-values.

主站蜘蛛池模板: 尼玛县| 彭泽县| 军事| 凉山| 瑞丽市| 合肥市| 高阳县| 宁南县| 康保县| 茂名市| 祁连县| 如东县| 黎平县| 城市| 西畴县| 佛学| 黑山县| 衡阳县| 农安县| 犍为县| 大埔区| 通辽市| 上饶市| 大埔县| 渑池县| 上犹县| 乐平市| 凤凰县| 邛崃市| 章丘市| 金寨县| 平江县| 田阳县| 蓬溪县| 龙门县| 济阳县| 河北区| 尉犁县| 青海省| 芦山县| 法库县|