- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to show (0,0) on matplotlib graph at the bottom left corner?
To show (0,0) on matplotlib graph at the bottom left corner, we can use xlim() and ylim() methods.
Steps
Set the figure size and adjust the padding between and around the subplots.
Make lists of data points for x and y.
Plotx and y data points.
Setx and y axes scale.
To display the figure, use Show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True x = np.array([0, 1, 3, 2, 1, 5]) y = np.array([0, 2, 4, 4, 3, 3]) plt.plot(x, y) plt.xlim([0, max(x)+0.5]) plt.ylim([0, max(y)+0.5]) plt.show()
Output
It will produce the following output −
- Related Articles
- How to remove whitespaces at the bottom of a Matplotlib graph?
- Plot the following points on the graph paper:$(0, 0)$
- Set bottom-left corner border with CSS
- How to show a bar and line graph on the same plot in Matplotlib?
- Plot the following points on the graph paper:$(7, 0)$
- Plot the following points on the graph paper:$(-4, 0)$
- Plot the following points on the graph paper:$(0, 7)$
- Plot the following points on the graph paper:$(0, -4)$
- Plot the points $( 0,\ 2),\ ( 3,\ 0),\ ( -2,\ 0)$ and $( 0,\ -3)$ on the graph. Which figure do we obtain if we join the points?
- Rotate theta=0 on a Matplotlib polar plot
- Draw on graph: $f( x)=\frac{x}{2}-1=0$.
- How to display only a left and bottom box border in Matplotlib?
- How to make the angles in a Matplotlib polar plot go clockwise with 0° at the top?
- How to put text at the corner of an equal aspect figure in Python/Matplotlib?
- How to insert a small image on the corner of a plot with Matplotlib?

Advertisements