Set y axis limit in Pandas histogram

前端 未结 2 1907
夕颜
夕颜 2021-02-20 05:48

I am using Pandas histogram.

I would like to set the y-axis range of the plot.

Here is the context:

import matplotlib.pyplot as plt
%matplotlib          


        
相关标签:
2条回答
  • 2021-02-20 06:35

    You can simply add option sharey=True to make all subplots share the same yaxis limit, similiary using sharex=True for xaxis

    data['ranking'].hist(by=data[column], sharey=True)

    0 讨论(0)
  • 2021-02-20 06:38

    If you use

    data['ranking'].plot.hist(ylim=(0,1)) 
    

    it should work.

    0 讨论(0)
提交回复
热议问题