简体   繁体   English

具有多个 Y 轴范围的 Seaborn FacetGrid 图

[英]Seaborn FacetGrid Plot with Multiple Y-Axis Ranges

How do i change the single y axis interval for every plot for Seaborn's FacetGrid Plot?我如何更改 Seaborn 的 FacetGrid 图的每个图的单个 y 轴间隔? If I plot a facetGrid that contains a lot of variable y values, Seaborn uses the default min and max y values of all the data to construct the only y-axis.如果我绘制一个包含许多变量 y 值的 facetGrid,Seaborn 使用所有数据的默认最小值和最大值 y 值来构建唯一的 y 轴。

import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('tips')
g = sb.FacetGrid(df, col = "time")
g.map(plt.hist, "tip")
plt.show()

Id like to see an axis for every plot, however it is not shown below on the second plot.我想看到每个图的轴,但是它没有显示在下面的第二个图上。

在此处输入图片说明

pass sharey=False to sb.FacetGrid :sharey=False传递给sb.FacetGrid

import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('tips')
g = sb.FacetGrid(df, col = "time", sharey=False)
g.map(plt.hist, "tip")
plt.show()

在此处输入图片说明

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

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