Data Visualization With Matplotlib For Beginner

Data visualization is so important subject for data science because we need to see data in graphics. We going to use Python for data visualization actually we gonna use the Python Matplotlib library.

What Is Data Visualization?

Data visualization is It is an interdisciplinary field that deals with the representation of data in graphs. We need graphics for readable data.

What Is Graphic?

Graphics are designs that we can show on their data. Data are generic, with no limitation, any data can be displayed on the graphic. these data could be everything for example car selling count, user count, etc. Every data could show in a graphic.

Install Matplotlib For Project

Open a terminal and enter pip install Matplotlib, if you use Visual Studio Code open the integrated terminal and write this command. This project will be done on Visual Studio Code so if you don’t use Visual Studio, go this write.

How To Create New Graphic?

Create a new Python file. Firstly, we going to create an empty graphic after that we going to create a car selling graphic. Let’s create the first graphic step by step.

Step 1 – Import Library

Firstly, we import matplotlib and we change the command name is mp after that, we call pyplot from matplotlib.

Step 2 – Create Empty Window And Create Title


Let’s we gonna examine these functions. Firstly, I can’t use Jupyter Notebook because my Visual Studio Code gets to the error so I using a normal python file.

Step 3 – Create Empty Graphic

Anymore, we have a figure now let’s create a new graphic in this figure. Firstly, we don’t care about style and others, just we create a sample graphic.

Anymore, we have a graphic lets we add label this graphic after that, we gonna make another line.

Step 4 – Add A Label

Now, we can add a label to this graphic. The label is more useful. I always use labels for readable graphics. Firstly, we gonna create an axises label.

We created an axis label. Remember, we created the figure title. Now, we create a graphic title.

Step 5 – Create Graphic Title

We created graphic titles, now we to become work multiple plots so we need to lines. Let’s create a new line. After that, we gonna create a line label.

Step 6 – New Lines

Up to the present, we work on single-line but anymore we start work on multiple lines. Let’s create new lines and examine new code.

We created a new line with different values. Now, we create a line name with a label.

Final Step – Line Label

We almost finish just we need to line label. You can edit a large graphic with a line name so it’s very helpful. After that, we gonna make car selling graphics.

We finished a graphic now let’s create a car selling graphic for practice.

Car Selling Graphic

Now, we create a car selling graphic for practice. the data I use is not true, just an example.



Leave a Reply

Your email address will not be published. Required fields are marked *