mathplotlib
* * Matplotlib * * is one of the most popular libraries in Python for * * Charts and Graphs for displaying data * * * Data Visualization
Simply put, it's a tool that turns a lot of raw numbers and data in your code into pictures, lines, bar graphs, or pie charts.
---
# # What can Matplotlib's featured features do?
* * * Create a very wide range of graphs: * * Whether it's line plots, bar charts, scatter plots, histograms, or even 3D plots.
* * * Barely 100% customizable: * * You can change color, line, x-y axis, title (Title), code description (Legend), or adjust fonts at will.
* * * Works well with other libraries: * * It is designed to work with * * NumPy * * (Manage Numeric Data) and * * Pandas * * (Manage Dataframe Data Tables) fluently.
* * * Export multiple formats: * * A graph can be saved as an image file such as' .png ',' .jpg 'or high-resolution vector files such as' .pdf 'and' .svg '.
---
# # Main Structures to Know (Architecture)
When writing Matplotlib, you will find these two words most often, which is like the heart of it:
1. * * Figure: * * Like * * "Canvas" * * or all the empty paper windows you'll use to draw.
2. * * Axes: * * It's like * * "graph area" * * that's in that canvas (in one figure, there can be multiple Axes or multiple subgraphs).
---
# # Simple code example
Matplotlib is usually run through a submodule called 'pyplot' (commonly abbreviated 'plt'). A simple example of a straight line graph is as follows:
"'Python.
Import matplotlib.pyplot as plt
# 1. Prepare information
X = [1, 2, 3, 4, 5]
Y = [2, 4, 6, 8, 10]
# 2.Draw a line graph
plt.plot (x, y, color = 'blue', marker = 'o')
# 3. Enter details to graph
plt.title ("My First Graph") # Graph name
plt.xlabel ("X Axis") # X-axis name
plt.ylabel ("Y Axis") # Y-axis name
# 4. Display the graph on the screen
plt.show ()
"'
# # Summary
If you are working on the line * * Data Science, Data Analyst, or Machine Learning * *, the use of Matplotlib is an indispensable skill because it allows us to "visualize" the behavior of data insights as clearly as possible before processing.
































































































