简体   繁体   English

Seaborn地块的大小相同?

[英]seaborn plots the same size?

seaborn has a conveninent keyword named size= , that aims to make the plots a certain size. seaborn有一个名为size=便捷关键字,目的是使图块达到一定大小。 However, the plots significantly differ in size depending on the xy-ticks and the axis labels. 但是,根据xy-ticks和轴标签的不同,图的大小也存在明显差异。 What is the best way to generate plots with exactly the same dimensions regardless of ticks and axis labels? 不管刻度和轴标签如何,生成具有完全相同尺寸的图的最佳方法是什么?

Seaborn sizing options vary by the plot type, which can be a bit confusing, so this is a useful universal approach. Seaborn的大小选项因地块类型而异,这可能会有些混乱,因此这是一种有用的通用方法。

First run this: import matplotlib as plt 首先运行: import matplotlib as plt

Then add the line plt.figure(figsize=(9, 9)) in the notebook cells for each of the plots. 然后在每个图的笔记本单元格中添加行plt.figure(figsize=(9, 9)) You can adjust the integer values as you see fit. 您可以根据需要调整整数值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM