The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.
Note: For more information, refer to How To Use Jupyter Notebook – An Ultimate Guide
Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from data in arrays.To get started you just need to make the necessary imports, prepare some data, and you can start plotting with the help of the plot() function.When you’re done, remember to show your plot using the show() function.
Matplotlib is written in Python and makes use of NumPy, the numerical mathematics extension of Python.It consists of several plots like : –
- And many more
- Install Matplotlib with pip
Matplotlib can also be installed using the Python package manager, pip. To install Matplotlib with pip, open a terminal window and type:
pip install matplotlib
- Install Matplotlib with the Anaconda Prompt
Matplotlib can be installed using with the Anaconda Prompt. If the Anaconda Prompt is available on your machine, it can usually be seen in the Windows Start Menu. To install Matplotlib, open the Anaconda Prompt and type:
conda install matplotlib
Using Matplotlib with Jupyter Notebook
After the installation is completed. Let’s start using Matplotlib with Jupyter Notebook. We will be plotting various graphs in the Jupyter Notebook using Matplotlib.
Adding title and Labeling the Axes in the graph
We can add title to the graph by using the following command
We can label the x-axis and y-axis by using the following functions
matplotlib.pyplot.xlabel("Time (Hr)") matplotlib.pyplot.ylabel("Position (Km)")
We can also write a program in the same cell for printing Multiple Graphs together.
We can print these graphs vertically one below another by repeating the show() function in the program or we can use a function called subplot() in order to print them horizontally as well.
- Add CSS to the Jupyter Notebook using Pandas
- Getting started with Jupyter Notebook | Python
- Jupyter notebook Tips and Tricks
- Jupyter notebook VS Python IDLE
- How to install Jupyter Notebook in Linux?
- How To Use Jupyter Notebook - An Ultimate Guide
- How to install Jupyter Notebook in Windows?
- Install Python package using Jupyter Notebook
- Difference Between Jupyter and Pycharm
- Python - Notebook in GTK+ 3
- Grids in Matplotlib
- Pyplot in Matplotlib
- Using Matplotlib for Animations
- Bar Plot in Matplotlib
- matplotlib.pyplot.jet() in Python
- Box Plot in Python using Matplotlib
- Difference Between Matplotlib VS Seaborn
- Matplotlib.pyplot.sca() in Python
- Matplotlib.pyplot.gca() in Python
- Environment Setup for Matplotlib
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.