Matplotlib.text.OffsetFrom class in python
Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack.
matplotlib.text.OffsetFrom class is a callable helper class for working with Annotation.
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
Syntax: class matplotlib.text.OffsetFrom(artist, ref_coord, unit=’points’)
- artist: This object is used to compute the offset. It is generally an Artist, a BboxBase or Transform.
- ref_coord: It is length 2 sequence. This values is the location to of the offset origin in fractions of the artist bounding box if it is an Artist or BboxBase whereas it is the offset origin is the transform applied to this value if artist is a Transform.
- unit : It is used to manage the screen units to use (pixels or points) for the offset input.
Methods of the class:
- get_unit(self) : It is the unit for input to the transform used by __call__.
- set_unit(self, unit): It is the unit for input to the transform used by __call__ where, unit argument is in ‘points’ or ‘pixels’.