The figure-level functions wrap their axes-level counterparts and pass the kind-specific keyword arguments (such as the bin size for a histogram) down to the underlying function. displot ( data = penguins, x = "flipper_length_mm", hue = "species", col = "species" ) Its default behavior is to draw a histogram, using the same code as histplot() behind the scenes: The organization looks a bit like this:įor example, displot() is the figure-level function for the distributions module. Each module has a single figure-level function, which offers a unitary interface to its various axes-level functions. In contrast, figure-level functions interface with matplotlib through a seaborn object, usually a FacetGrid, that manages the figure. They plot data onto a single object, which is the return value of the function. The examples above are axes-level functions. In addition to the different modules, there is a cross-cutting classification of seaborn functions as “axes-level” or “figure-level”. They are designed to facilitate switching between different visual representations as you explore a dataset, because different representations often have complementary strengths and weaknesses. kdeplot ( data = penguins, x = "flipper_length_mm", hue = "species", multiple = "stack" )įunctions within a module share a lot of underlying code and offer similar features that may not be present in other components of the library (such as multiple="stack" in the examples above).
0 Comments
Leave a Reply. |