对于Pandas系列(pandas.core.series.Series
),有一种方便的plot()
方法(documentation)来制作,例如条形图。在
{cd2width}值为 figsize : a tuple (width, height) in inches 但是,我找不到任何关于每英寸像素密度/DPI/PPI是多少的文档。似乎也没有任何方法来说明它应该是什么。根据输出图像的大小,我猜它是相当低的(例如,72 dpi),但我想知道它是什么,所以当我教这个方法时,我可以为输出提供一个合理的解释。下面是一个示例用法: 我知道这个方法基于species_counts = surveys.groupby('species_id')['record_id'].count()
type(species_counts) # `pandas.core.series.Series`
species_counts.plot(figsize = (9, 6), kind = 'bar')
matplotlib
,但是不幸的是,Pandas系列上的方法没有采用dpi
参数(结果是AttributeError: Unknown property dpi
)。在
您可以使用底层的
matplotlib
命令来指定dpi
。在或者,如果您只想知道默认的
^{pr2}$dpi
是什么:我不认为有一个规范的答案,我很确定确切的答案将取决于您使用的后端,可能还取决于您的硬件。在
相关问题 更多 >
编程相关推荐