Data Visualisation using Matplotlib for beginners.

Photo by Luke Chesser on Unsplash
  • Line plots
  • Scatter Plots
  • Bar Graphs
  • Pie Charts
  • Histograms

Line Plots

1.Get the data

y1= x**2
Output---------[0 1 2 3 4 5 6 7 8 9]
[ 0 1 4 9 16 25 36 49 64 81]
[34 36 38 40 42 44 46 48 50 52]

2. Plot Simple curves

You will get this graph as output. Similarly, you can plot for other functions as well.

3. Use themes to make the plot look more attractive
Using the seaborn paper theme we got the gray colour border and curve, and grd on the graph.

4. Change the color of curve“seaborn-paper”)
plt.plot(x,y1, color=”red”)
plt.plot(x,y2, color=”green”)
We can plot different curves on same plot using different colors

5. Give titles

  • plt.xlabel(“ ”): to put a label on x axis.
  • plt.ylabel(“ ”): to put a label on y axis.
  • plt.title(“ ”): to gve a title to the plot.
plt.title(“Speed v/s Time Curve”)
We got the label for x and y axis along with the title for curve.

6. Give labels to different curves an plot legend“seaborn-paper”)
plt.plot(x,y1, color=”red”, label=”A”)
plt.plot(x,y2, color=”green”, label=”B”)
plt.title(“Speed v/s Time Curve”)

7. Change style of curve

plt.plot(x,y1, color=”red”, label=”A”, linestyle=”dashed”)

8. Putting a marker

plt.plot(x,y1, color=”red”, label=”A”, linestyle=”dashed”, marker=”o”)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building a Budget News-Based Algorithmic Trader? Well then You Need Hard-To-Find Data

The Power and Pitfalls of Inferencing

Deep Stacking Network (DSN)

Starting Out With Data Science (Episode I): what you should learn!

More 25–34-year-olds are living with their parents in cities in Ontario… but not in Alberta and…

Finding the next Billboard #1 — Spotify API Exploratory Analysis

Are We Using Machine Learning?

A Holistic Framework for Managing Data Analytics Projects

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shatakshi Singh

Shatakshi Singh

More from Medium

Data Manipulation with df_product.csv Dataset

Introduction :

Exploratory Data Analysis

Performing Analysis of Meteorological Data