Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

facet grid - seaborn FacetGrid empty

A simple dataset, with one column named "measurement" with about 20 distinct values, and another one named "value".

g = sns.FacetGrid(data, col='measurement',col_wrap=4)
g.map(sns.displot,'value')

I get an error about the number of plots matplotlib.pyplot creates

RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplotlib.pyplot.figure) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam figure.max_open_warning). fig, axes = plt.subplots(nrow, ncol, **kwargs)

The 2 lines of code return me a long column with all the individual graphs and , at the end, an empty FacetGrid (snippet below). I have no idea why this is happening, anybody have a thought?

output

Thanks

question from:https://stackoverflow.com/questions/65680096/seaborn-facetgrid-empty

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When I tried,

g = sns.FacetGrid(data, col='measurement',col_wrap=4)
g.map(sns.displot,'value')

I also got same results, but changing to distplot or histplot gave me the desired results. If that's what you've wanted.enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...