在Python中绘制具有三个y轴和一个x轴的直方图

时间:2020-03-09 13:30:04

标签: python matplotlib plot histogram

我正在尝试绘制一个x轴(方法)和三个y轴(RequirementT,RequirementN,RequirementU)的条形图/直方图。这是指向我的完整数据https://drive.google.com/file/d/1aBRy2uf34kjWQAo8nUDMnuAEHPR4XBMD/view?usp=sharing

的链接

我正在使用以下python代码:

# Load the Pandas libraries with alias 'pd' 
import pandas as pd 
import numpy as np
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
# Read data from file 'filename.csv' 
# (in the same directory that your python process is based)
# Control delimiters, rows, column names with read_csv (see later) 
df = pd.read_csv("chessMethodReq.txt") 
# Preview the first 5 lines of the loaded data 
df.head()


ax=df.plot.bar(x='method', y=['RequirementT', 'RequirementN', 'RequirementU'])

问题是我最终看到了这个看起来疯狂的x轴

enter image description here

我想这是因为我的x轴上的1、2、3,...,752信息过多。我想为我的x轴使用间隔: [0,100] [100,200] [200,300] [300,400] [400,500],[500,600],[600,700],[700,800]

0 个答案:

没有答案