我正在使用Pandas直方图。
我想设置绘图的y轴范围。
以下是上下文:
import matplotlib.pyplot as plt
%matplotlib inline
interesting_columns = ['Level', 'Group']
for column in interesting_columns:
data['ranking'].hist(by=data[column], normed=True)
有一个范围参数可以过滤x值,但我不知道对应y值的参数:
hist(by=[column], normed=True, range=[0, 1]) #working argument
hist(by=[column], normed=True, y_range=[0, 1]) #hypothetical argument
我已经阅读了许多使用plt属性更改绘图范围的不同方法。它们似乎无法在循环和子图中起作用。
我很难掌握正确的解决方法。
hist
指定一个句柄,比如:h1=hist(...)
,然后查看h1.*
有哪些方法吗?它可能会有类似于h1.set_ylim
的方法。 - Sleepyhead