日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python 散点图 分类_Python | 分类图

發(fā)布時間:2025/3/11 python 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python 散点图 分类_Python | 分类图 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

python 散點圖 分類

Visualizing different variables is also a part of basic plotting. Such variables can have different classes, for example, numerical or a category. Matplotlib has an important feature of Categorical Plotting. We can plot multiple categorical variables within different types of plots such as line, dot, bar, scatter, etc.

可視化不同的變量也是基本繪圖的一部分。 這樣的變量可以具有不同的類別,例如,數(shù)值或類別。 Matplotlib具有分類繪圖的重要功能。 我們可以在不同類型的圖中繪制多個類別變量,例如線,點,條,散點圖等。

Following are some examples of categorical plotting:

以下是分類繪圖的一些示例

Syntax:

句法:

matplotlib.pyplot.figure(figsize=(4,3))#figsize(float, float) width, height in inches.

示例1:線圖 (Example 1: Line Plot)

示例2:條形圖 (Example 2: Bar Plot)

示例3:點圖 (Example 3: Dot Plot)

用于分類繪圖的Python代碼 (Python code for categorical plotting)

# Data Visualization using Python # Categorical Plottingimport matplotlib.pyplot as pltnames = ['Rabhes', 'Grpsh J.', 'John C. Dave'] values = [45646, 75640, 42645]# example 1 plt.figure() plt.plot(names, values, color='y') plt.ylabel('Income') plt.title('Income Comparison') plt.show()# example 2 plt.figure() plt.bar(names, values, color='y') plt.ylabel('Income') plt.title('Income Comparison') plt.show()# example 3 plt.figure() plt.plot(names, values, 'or') plt.ylabel('Income') plt.title('Income Comparison') plt.show()

Output:

輸出:

Output is as figure

翻譯自: https://www.includehelp.com/python/categorical-plotting.aspx

python 散點圖 分類

總結(jié)

以上是生活随笔為你收集整理的python 散点图 分类_Python | 分类图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。