Here, we will explain the basic usage of Seaborn. It is supposed to use Python3 series.
By convention, it is often imported as sns
.
Seaborn_1.py
import seaborn as sns
You can change the appearance of the figure created by matplotlib by using the seaborn.set ()
method.
Seaborn_2.py
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
x = [1, 2, 3]
y = [3, 1, 2]
plt.title('Line-chart') #Graph title
plt.xlabel('X-axis') #x-axis label
plt.ylabel('Y-axis') #y-axis label
plt.plot(x, y) #Create a graph
plt.savefig('seaborn_2.png') #Save the graph as an image file
Here, I explained the basic usage of Seaborn. If you want to change the appearance of the figure created by Matplotlib, you should use it.
What is the programming language Python? Can it be used for AI and machine learning?
Recommended Posts