python 三维图直方图_Python | 阶梯直方图
python 三維圖直方圖
A histogram is a graphical technique or a type of data representation using bars of different heights such that each bar group's numbers into ranges (bins or buckets). Taller the bar higher the data falls in that bin. A Histogram is one of the most used techniques in data visualization and therefore, matplotlib has provided a function matplotlib.pyplot.hist() for plotting histograms. Step histogram is a type of histogram in which Bars are not filled with color, instead only the edge is the representation of Histogram. It is in a form of steps of stairs and therefore it is known as step histogram.
直方圖是使用不同高度的條形圖的圖形技術或一種數據表示形式,以使每個條形圖組的數字都位于范圍內(箱或桶)。 數據落入該容器的欄越高,該欄越高。 直方圖是數據可視化中最常用的技術之一,因此,matplotlib提供了一個函數matplotlib.pyplot.hist()來繪制直方圖。 階梯直方圖是直方圖的一種類型,其中條形圖未填充顏色,而是僅邊緣表示直方圖。 它采用階梯的形式,因此稱為階梯直方圖。
The following example illustrates the implementation and use of the Step Histogram Plot.
以下示例說明了“階梯直方圖”的實現和使用。
步進直方圖的Python代碼 (Python code for step histogram plot)
import matplotlib.pyplot as plt import numpy as np# random data generation mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000)# Histogram of the Data plt.figure() plt.hist(x, 25, histtype='step') plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Step Histogram') plt.show()plt.figure() plt.hist(x, 15, density=1, histtype='step') plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Step Histogram : No. of Bins = 15') plt.show()plt.figure() plt.hist(x, 10, density=1, edgecolor='purple', linewidth=2.0, histtype='step') plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Step Histogram : Edge Width = 2.0') plt.show()Output:
輸出:
Output is as figure翻譯自: https://www.includehelp.com/python/step-histogram-plot.aspx
python 三維圖直方圖
總結
以上是生活随笔為你收集整理的python 三维图直方图_Python | 阶梯直方图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dom属性和html属性_HTML属性
- 下一篇: python 示例_带有示例的Pytho