• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
  • Contact
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Data Visualization with Matplotlib

January 1, 2021 by systems

Aditri Srivastava

Matplotlib : A plotting library for python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. It is said that “Matplotlib makes easy things easy and hard things possible”. It is a low-level library with a interface similar to Matlab which offers lots of freedom but at the cost of having to write more code.

To install Matplotlib in your systems.

pip install matplotlib
# in conda
conda install matplotlib

We will here see pyplot submodule in detail with plt as alias.

We can change the theme of our plot by choosing from available themes.

themes = plt.style.available
print(themes)
OUTPUT['Solarize_Light2', '_classic_test_patch', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn', 'seaborn-bright', 'seaborn-colorblind', 'seaborn-dark', 'seaborn-dark-palette', 'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook', 'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk', 'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'tableau-colorblind10']plt.style.use("dark_background")

Line Plot

Here we plotted x and y on their respective axes . We can also plot many equations at a single time.

When plt.show() is exceuted then lines are plotted if we want two different graphs then →

Lets make a perfect line plot by putting some addons also like title ,labels colours. plt.legend() lets us print label.

Scatter Plot

It is similar to line plot except to the fact that we will be plotting points not lines.

Bar Graph

It’s very simple to plot a bar graph by executing the following command.

Piechart

Following code helps us draw the pie chart. If you don’t want anyone subject to be highlighted then skip the explode term. shadow = True gives us the better effects.

HISTOGRAM

A histogram is an accurate representation of the distribution of numerical data. It is an estimate of the probability distribution of a continuous variable. It is a kind of bar graph.

Don’t forget to refer official documentation

https://matplotlib.org/index.html

There can be many more things to be done. So do explore them and play around visualizing data!!!

Filed Under: Machine Learning

Primary Sidebar

Carmel WordPress Help

Carmel WordPress Help: Expert Support to Keep Your Website Running Smoothly

Stay Ahead: The Latest Tech News and Innovations

Cryptocurrency Market Updates: What’s Happening Now

Emerging Trends in Artificial Intelligence: What to Watch For

Top Cloud Computing Services to Secure Your Data

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2025 NEO Share

Terms and Conditions - Privacy Policy