Skip to content

Introducing Matplotlib #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 1, 2024
Prev Previous commit
Update matplotlib-introduction.md
  • Loading branch information
animator authored Jun 1, 2024
commit 358d8b05e4792ff9e819c36e14df3a3d2459c41f
30 changes: 9 additions & 21 deletions contrib/plotting-visualization/matplotlib-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ To make this process of data visualization easier and clearer, matplotlib librar

## Starting with Matplotlib

### 1.] Install and import the neccasary libraries - mayplotlib.pylplot
```python
### 1. Install and import the neccasary libraries - mayplotlib.pylplot

```bash
pip install matplotlib
```

Expand All @@ -22,9 +23,7 @@ import maptplotlib.pyplot as plt
import numpy as np
```



### 2.] Scatter plot
### 2. Scatter plot
Scatter plot is a type of plot that uses the cartesian coordinates between x and y to describe the relation between them. It uses dots to represent relation between the data variables of the data set.

```python
Expand All @@ -41,12 +40,9 @@ plt.tight_layout()
plt.show()
```

![scatterplot](images/scatterplot.png)


![scatterplot](https://github.com/Harshita297/learn-python/assets/122027571/aa57eb31-4377-4f75-9a97-e4fa7a54a938)


### 3.] Bar plot
### 3. Bar plot
Bar plot is a type of plot that plots the frequency distrubution of the categorical variables. Each entity of the categoric variable is represented as a bar. The size of the bar represents its numeric value.

```python
Expand All @@ -61,11 +57,10 @@ plt.ylabel("Y values")

plt.show()
```
![barplot](https://github.com/Harshita297/learn-python/assets/122027571/00cea3cd-a962-4bfe-b158-921389ee564c)


![barplot](images/barplot.png)

### 4.] Histogram
### 4. Histogram
Histogram is the representation of frequency distribution of qualitative data. The height of each rectangle defines the amount, or how often that variable appears.

```python
Expand All @@ -79,14 +74,7 @@ plt.ylabel("Frequency Distribution")

plt.show()
```
![histogram](https://github.com/Harshita297/learn-python/assets/122027571/32470819-bac5-4bb2-9f36-79521fa40bf3)








![histogram](images/histogram.png)