Matplotlib.axis.Axis.get_tightbbox() function in Python Last Updated : 08 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack. Matplotlib.axis.Axis.get_tightbbox() Function The Axis.get_tightbbox() function in axis module of matplotlib library is used to get the bounding box that encloses the axis. Syntax: Axis.get_tightbbox(self, renderer) Parameters: This method accepts the following parameters. renderer: This parameter is the RendererBase instance renderer Return value: This method returns the bounding box that encloses the axis. Below examples illustrate the matplotlib.axis.Axis.get_tightbbox() function in matplotlib.axis: Example 1: Python3 # Implementation of matplotlib function from matplotlib.axis import Axis import matplotlib.pyplot as plt import numpy as np X = np.arange(-10, 10, 0.5) Y = np.arange(-10, 10, 0.5) U, V = np.meshgrid(X, Y) fig, ax = plt.subplots() ax.quiver(X, Y, U, V) ax.invert_xaxis() w = Axis.get_tightbbox(ax.xaxis, fig.canvas.get_renderer()) print("Value Return :\n"+str(w)) ax.grid() fig.suptitle("""matplotlib.axis.Axis.get_tightbbox() function Example\n""", fontweight ="bold") plt.show() Output: Value Return : Bbox(x0=75.48368298368294, y0=29.077777777777776, x1=574.7670454545455, y1=43.077777777777776) Example 2: Python3 # Implementation of matplotlib function from matplotlib.axis import Axis import numpy as np import matplotlib.pyplot as plt xx = np.random.rand(8, 6) fig, ax = plt.subplots() m = ax.pcolor(xx) m.set_zorder(-2) w = Axis.get_tightbbox(ax.xaxis, fig.canvas.get_renderer()) print("Value Return :\n"+str(w)) ax.grid() fig.suptitle("""matplotlib.axis.Axis.get_tightbbox() function Example\n""", fontweight ="bold") plt.show() Output: Value Return : Bbox(x0=75.5625, y0=29.077777777777776, x1=580.4375, y1=43.077777777777776) Comment More infoAdvertise with us Next Article Matplotlib.axis.Axis.get_tightbbox() function in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Matplotlib-Axis Class Practice Tags : python Similar Reads Matplotlib.axis.Axis.get_ticklocs() function in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack. matplotlib.axis.Axis.get_ticklocs() Function The Axis.get_ticklocs() function i 2 min read Matplotlib.axis.Axis.get_visible() function in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack. Matplotlib.axis.Axis.get_visible() Function The Axis.get_visible() function in 2 min read Matplotlib.axes.Axes.get_tightbbox() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axis.Axis.get_snap() function in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack. Matplotlib.axis.Axis.get_snap() Function The Axis.get_snap() function in axis m 2 min read Matplotlib.axis.Axis.get_transform() function in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack. Matplotlib.axis.Axis.get_transform() Function The Axis.get_transform() function 2 min read Like