Why do we use this nomenclature to define axes in python?

While defining axes in seaborn, we use code like this

f, ax= sns.subplot.....

When plotting with Matplotlib, we simply use

ax= plt.subplot....

Why the difference in notation? What does f,ax signify? Sorry, this wasn’t clear to me during the exercises.

It’s based on what the function returns. I’ve not used seaborn mcuh but I’m assuming that sns.subplot creates both a figure and axis instances and these are returned as a tuple to the names f and ax. You can now use these names to manipulate the figure and axis respectiely

matplotlib.pyplot has a similar function but it’s called subplots-

f, ax = plt.subplots(1, 1)
# integers define the number of rows/columns for axis subplots
1 Like