Skip to content

Various plots for data visualisation, in python3 using seaborn and matplotlib

License

Notifications You must be signed in to change notification settings

deepanshu-Raj/Data-Visualization

Repository files navigation

🎖️ Data-Visualization

Various plots for data visualisation

Reference Notebook : notebook

Run Instructions:

If using Collab : you can simply copy the code snippets and tweak the parameters to obtain various plots or change the data, to change the plots accordingly.

If you want to run the code on your local envoirnment :

  • Download & Install python3 : https://www.python.org/downloads/

  • Either install Jupyter-lab or install Jupyter-notebook (install any one, Jupyter-lab preferred)

    • For installing Jupyter-Lab : image
    • For installing Jupyter-Notebook : image
  • Install Matplotlib : pip install matplotlib

  • Install Seaborn : pip install seaborn

  • Install Numpy : pip install numpy

All the pip commands are to be run in your terminal(For windows users)

Index :

A - pyplot methods()

1 : Line plot

A line graph is commonly used to display change over time as a series of data points connected by straight line segments on two axes. Line graphs are useful in that they show data variables and trends very clearly and can help to make predictions about the results of data not yet recorded.

image

2 : Scatter plot

Scatter plot's primary uses are to observe and show relationships between two numeric variables. The dots in a scatter plot not only report the values of individual data points, but also patterns when the data are taken as a whole.

image

3 : Bar Plot

Bar graphs are used to compare things between different groups or to track changes over time. However, when trying to measure change over time, bar graphs are best when the changes are larger.

image

4 : Pie Chart

There are two primary use cases for a pie chart: If you want your audience to have a general sense of the part-to-whole relationship in your data and comparing the precise sizes of the slices is less important. To convey that one segment of the total is relatively small or large.

image

5 : Histogram(Normal Distribution)

A histogram is used to summarize discrete or continuous data. In other words, it provides a visual interpretation. This requires focusing on the main points, factsof numerical data by showing the number of data points that fall within a specified range of values (called “bins”). It is similar to a vertical bar graph.

image

B - seaborn methods()

1 : Bar Plot

image

2 : Count Plot

It is used to Show the counts of observations in each categorical bin using bars.

image

3 : Box Plot

A box and whisker plot (sometimes called a boxplot) is a graph that presents information from a five-number summary.A box and whisker plot is a way of summarizing a set of data measured on an interval scale. It is often used in explanatory data analysis. This type of graph is used to show the shape of the distribution, its central value, and its variability.

image

image

4 : Violin Plot

Violin plots are used when you want to observe the distribution of numeric data, and are especially useful when you want to make a comparison of distributions between multiple groups. The peaks, valleys, and tails of each group's density curve can be compared to see where groups are similar or different.

image

5 : Distribution Plot & KDE Plot && Joint Plot

Read this for information about distribution plot!!

image

image

6 : Heat Map

Heatmaps are used to show relationships between two variables, one plotted on each axis. By observing how cell colors change across each axis, you can observe if there are any patterns in value for one or both variables.

image