How to put the origin in the center of the figure with Matplotlib ?
In this article, we are going to discuss how to put the origin in the center of the figure using the matplotlib module. To put the origin at the center of the figure we use the spines module from the matplotlib module. Basically, spines are the lines connecting the axis tick marks and noting the boundaries of the data area. Under this module, we use set_position() method which sets the position of the spine which helps to set the origin in the centre.
However, we can put the origin in the center of the figure without using set_position() method. The below graph is made without using set_position() method.
The below graph is made with using set_position() method which helped to bring origin to the centre.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course