Contenido del Curso
First Dive into seaborn Visualization
First Dive into seaborn Visualization
Adding the Plot Title
Plotting in the seaborn
can be used to create 2 types of plots: FacetGrids and AxesSubplots.
We have learned only plots of the AxesSubplots type, so we will learn how to customize only plots of the corresponding type.
To add the title you need to:
- Declare a plot variable;
- Add the title.
# Importing libraries needed import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # Reading the file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/example3.csv') # Creating the countplot and declaring the variable g = sns.countplot(x = 'food', data = df) # Setting the title g.set_title('Food') # Showing the plot plt.show()
Swipe to show code editor
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a histplot variable
g
. - Set the title
'Fish'
. - Show the plot.
¡Gracias por tus comentarios!
Adding the Plot Title
Plotting in the seaborn
can be used to create 2 types of plots: FacetGrids and AxesSubplots.
We have learned only plots of the AxesSubplots type, so we will learn how to customize only plots of the corresponding type.
To add the title you need to:
- Declare a plot variable;
- Add the title.
# Importing libraries needed import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # Reading the file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/example3.csv') # Creating the countplot and declaring the variable g = sns.countplot(x = 'food', data = df) # Setting the title g.set_title('Food') # Showing the plot plt.show()
Swipe to show code editor
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a histplot variable
g
. - Set the title
'Fish'
. - Show the plot.
¡Gracias por tus comentarios!
Adding the Plot Title
Plotting in the seaborn
can be used to create 2 types of plots: FacetGrids and AxesSubplots.
We have learned only plots of the AxesSubplots type, so we will learn how to customize only plots of the corresponding type.
To add the title you need to:
- Declare a plot variable;
- Add the title.
# Importing libraries needed import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # Reading the file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/example3.csv') # Creating the countplot and declaring the variable g = sns.countplot(x = 'food', data = df) # Setting the title g.set_title('Food') # Showing the plot plt.show()
Swipe to show code editor
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a histplot variable
g
. - Set the title
'Fish'
. - Show the plot.
¡Gracias por tus comentarios!
Plotting in the seaborn
can be used to create 2 types of plots: FacetGrids and AxesSubplots.
We have learned only plots of the AxesSubplots type, so we will learn how to customize only plots of the corresponding type.
To add the title you need to:
- Declare a plot variable;
- Add the title.
# Importing libraries needed import seaborn as sns import matplotlib.pyplot as plt import pandas as pd # Reading the file df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/example3.csv') # Creating the countplot and declaring the variable g = sns.countplot(x = 'food', data = df) # Setting the title g.set_title('Food') # Showing the plot plt.show()
Swipe to show code editor
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a histplot variable
g
. - Set the title
'Fish'
. - Show the plot.