An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
Some of Our Sources
View All Sources
January 26, 2023 09:44 am GMT
Original Link: https://dev.to/jindalkeshav82/intro-to-matplotlib-in-python-part1-plot-44n1
Intro to Matplotlib in Python, Part1-plot().
1. What is Matplotlib
It is a library which helps us to plot and visualize the data in 2D form. It is an easy way to represent huge amount of data. It was introduced by John D.Hunter in the year 2002.
2. Why Matplotlib
Easy visualization to data.
Consist of bar graphs, histograms, pie charts, line graphs, etc.
Compatible with other third-party libraries and packages, that extend its functionality.
3. Plotting on X and Y axis
- By default, the plot() function draws a line from point to point.
- Also draws points on graph.
- positions of points are in order. Eg(10,7), here 10 is point on X axis and 7 on Y axis.
- Example:
import matplotlib.pyplot as pltimport numpy as npx = np.array([1, 8])y = np.array([3, 10])plt.plot(x,y)plt.show()
OUTPUT
NOTE
The x-axis is the horizontal axis.
The y-axis is the vertical axis.
Original Link: https://dev.to/jindalkeshav82/intro-to-matplotlib-in-python-part1-plot-44n1
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To