Open In App

Matplotlib.axes.Axes.draw() in Python

Last Updated : 12 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report
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.

matplotlib.axes.Axes.draw() Function

The Axes.draw() function in axes module of matplotlib library is used to draw everything.
Syntax: Axes.draw(self, renderer=None, inframe=False) Parameters: This method accepts the following parameters.
  • renderer: This parameter is the first parameter and its default value is None.
  • inframe: This parameter contains the boolean value and its default value is false.
Returns: This method does not return any value.
Below examples illustrate the matplotlib.axes.Axes.draw() function in matplotlib.axes: Example 1: Python3
# Implementation of matplotlib function 
from mpl_toolkits.mplot3d import axes3d 
import matplotlib.pyplot as plt 
  

fig, ax = plt.subplots() 
  
def tellme(s): 
    ax.set_title(s, fontsize = 16) 
    fig.canvas.draw()
    renderer = fig.canvas.renderer
    ax.draw(renderer)

tellme('matplotlib.axes.Axes.draw() function Example') 
plt.show() 
Output: Example 2: Python3
# Implementation of matplotlib function 
from mpl_toolkits.mplot3d import axes3d 
import matplotlib.pyplot as plt 
  

fig = plt.figure() 
ax = fig.add_subplot(111, projection ='3d') 
  
X, Y, Z = axes3d.get_test_data(0.1) 
ax.plot_wireframe(X, Y, Z, rstride = 5,  
                  cstride = 5) 
  
for angle in range(0, 90): 
    ax.view_init(30, angle)
    fig.canvas.draw()
    renderer = fig.canvas.renderer
    ax.draw(renderer) 
    plt.pause(.001) 
    ax.set_title('matplotlib.axes.Axes.draw()\
    function Example', fontweight ="bold") 
Output:

Practice Tags :

Similar Reads

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy