Movatterモバイル変換


[0]ホーム

URL:


Open In App
Next Article:
Matplotlib.axes.Axes.cla() in Python
Next article icon
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. TheAxes 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

TheAxes.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 functionfrommpl_toolkits.mplot3dimportaxes3dimportmatplotlib.pyplotaspltfig,ax=plt.subplots()deftellme(s):ax.set_title(s,fontsize=16)fig.canvas.draw()renderer=fig.canvas.rendererax.draw(renderer)tellme('matplotlib.axes.Axes.draw() function Example')plt.show()
Output:Example 2:Python3
# Implementation of matplotlib functionfrommpl_toolkits.mplot3dimportaxes3dimportmatplotlib.pyplotaspltfig=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)forangleinrange(0,90):ax.view_init(30,angle)fig.canvas.draw()renderer=fig.canvas.rendererax.draw(renderer)plt.pause(.001)ax.set_title('matplotlib.axes.Axes.draw()\    function Example',fontweight="bold")
Output:

Similar Reads

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood ourCookie Policy &Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences

[8]ページ先頭

©2009-2025 Movatter.jp