python - 为大量数据绘制条形图

标签 python seaborn bar-chart

我有 752 个数据点需要绘制, 我已经使用Python中的seaborn库在条形图上绘制了数据,但是我得到的图表非常不清楚,我无法通过图表分析任何内容,有什么方法可以更清楚地查看该图表并且所有数据点都适合标签在Python中看得很清楚

 enter image description here

编写的代码如下

import seaborn as sns
sns.set_style("whitegrid")
ax = sns.barplot(x="Events", y = "Count" , data = Unique_Complaints)

最佳答案

将这么多点可视化总是很困难。 Nihal 正确地指出,最好使用 Pandas 和统计分析来从数据中提取信息。话虽如此,Spyder 和 Pycharm 等 IDE 以及 Bokeh 等软件包允许交互式绘图,您可以在其中缩放到绘图的不同部分。以下是 Pycharm 的示例:

代码:

    # Import libraries
    import seaborn as sns
    import numpy as np
    import matplotlib.pyplot as plt

    # Exponential decay function
    x = np.arange(1,10, 0.1)
    A = 7000
    y = A*np.exp(-x)

    # Plot the exponential function
    sns.barplot(x = x, y = y)
    plt.show()

未放大的图

enter image description here

放大图

enter image description here

关于python - 为大量数据绘制条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48334921/

相关文章:

python - python中函数的变量没有在spyder的变量资源管理器中创建,例如 y_pred1 等

python - 强制 eclipse 重新加载 Python 模块

python - Matplotlib 直方图或 Seaborn 分布图的箱上没有轮廓

python - float 条形图

javascript - 需要帮助在流程图中显示并排条形图

android - 如何在栏顶部显示不同的值

python - 如何更改文件中的字节?

python - python 与 R 中的矩阵乘法对于 SVD 白化没有返回相同的结果

python - Seaborn 箱线图 : TypeError: unsupported operand type(s) for/: 'str' and 'int'

python - (如何)我可以将 seaborn despine 函数应用于单个子图?