python - 如何从 Seaborn 的计数图图形中删除标签名称?

标签 python matplotlib machine-learning count namespaces

主要问题是如果我有三个数据集文件的计数图,如何删除图形中的“标签”命名空间?我正在使用 Seaborn 模块。

#Importing the libraries
 import pandas as pd
 import numpy as np
 import seaborn as sb

#Reading the files 
train_filename = 'train.csv'
test_filename = 'test.csv'
valid_filename = 'valid.csv'

train_news = pd.read_csv(train_filename)
test_news = pd.read_csv(test_filename)
valid_news = pd.read_csv(valid_filename)

#Data observation
 def data_obs():
     print("Training dataset size:")
     print(train_news.shape)
     print(train_news)

     print("Testing dataset size:")
     print(test_news.shape)
     print(test_news)

     print("Validation dataset size:")
     print(valid_news.shape)
     print(valid_news)

  print(data_obs())
这是我从数据中得到的结果 enter image description here
enter image description here
另外,我正在使用 LIAR 数据集,它具有以下功能:
enter image description here

最佳答案

这应该这样做:

g = sb.countplot(x='Label', data=dataFile, palette="hls")

g.set(xticklabels=[])   # To remove the ticklabels
g.set(xlabel=None)      # To remove the "Label"

关于python - 如何从 Seaborn 的计数图图形中删除标签名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65541515/

相关文章:

python - 将 NumPy 数组列表写入 csv

python - 如何在绘图中创建非线性轴

python - 预期 4D 张量作为输入,但得到 2D 张量

logging - Tensorflow Estimator 打印损失时使用什么数据集

python - 桌面 python 脚本检索发送到 android 设备的短信

python - 将应用程序连接到 MySQL 数据库的最佳方式

python - 在 python pandas 中的 groupby 之后填写列中缺少的行

python - 使用 Python 3 将多个 matplotlib 图形放入 Excel 中

python - 我怎样才能用 python//Matplotlib 重新创建这个图形?

machine-learning - 改变批量大小如何导致不同的预测时间?