python点线图_Python | 点线图
python點線圖
A mixture of dot and line plot is called a Dot-Line plot. Each dot is connected through a line and it is the next version of the line plot. It maintains the discrete property of the points and also represents the correlation between consecutive points. It makes data visualization much better than an individual line or dot plot. Matplotlib provides this feature and with the following examples, we can better understand the implementation.
點線圖的混合稱為點線圖。 每個點通過一條線連接,這是該線圖的下一個版本。 它既保持了點的離散特性,又代表了連續點之間的相關性。 它使數據可視化遠勝于單個線或點圖。 Matplotlib提供了此功能,并通過以下示例,我們可以更好地理解實現。
1)標準點線圖 (1) Standard Dot-Line Plot)
Syntax:
句法:
plt.plot(x, y,'o-')x - names/numeric distribution
x-名稱/數字分布
y - length of the bar
y-鋼筋的長度
o- - instruction for dot-line
o--虛線說明
2)點線較小的點線圖 (2) Dot-Line Plot with Smaller Dot)
Syntax:
句法:
plt.plot(x, y,'o-')x - names/numeric distribution
x-名稱/數字分布
y - length of the bar
y-鋼筋的長度
.- - instruction for dot-line with small dot
.--帶小點的虛線說明
3)不同顏色的點線圖 (3) Dot-Line Plot with Different Color)
Syntax:
句法:
plt.plot(x, y,'o-')x - names/numeric distribution
x-名稱/數字分布
y - length of the bar
y-鋼筋的長度
g.- - instruction for dot-line with small dot green color
g。--小點綠色的虛線說明
虛線繪圖的Python代碼 (Python code for dot-line plotting)
import numpy as np import matplotlib.pyplot as pltx = np.linspace(0.0, 5.0)y = x*x# default Plot plt.subplot(2, 1, 1) plt.plot(x, y, 'o-') plt.title('Dot-Line Plot (1)') plt.ylabel('Square') plt.xlabel('numbers') plt.show()# Smaller dot plt.subplot(2, 1, 2) plt.plot(x, y, '.-') plt.title('Dot-Line Plot (2): Smaller Dot') plt.xlabel('numbers') plt.ylabel('Square') plt.show()#colour Change plt.subplot(2, 1, 2) plt.plot(x, y, 'g.-') plt.title('Dot-Line Plot (3): Colour Change') plt.xlabel('numbers') plt.ylabel('Square') plt.show()Output:
輸出:
Output is as figure翻譯自: https://www.includehelp.com/python/dot-line-plotting.aspx
python點線圖
總結
以上是生活随笔為你收集整理的python点线图_Python | 点线图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: arduino 休眠 节能_Arduin
- 下一篇: 查找两个字符串中相同字符串_使两个字符串