Matplotlib.axes.Axes.properties() in Python - GeeksforGeeks

30 Apr, 2020
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.
The Axes.properties() function in axes module of matplotlib library is used to get the dictionary of all the properties of the artist..
Syntax: Axes.properties(self)
Parameters: This method does not accepts any parameters.
Returns: This method return dictionary of all the properties of the artist.
Below examples illustrate the matplotlib.axes.Axes.properties() function in matplotlib.axes:
Example 1:
# Implementation of matplotlib function import numpy as np import matplotlib.pyplot as plt       xx = np.random.rand(16, 30)       fig, ax = plt.subplots()       m = ax.pcolor(xx) m.set_zorder(-20)  w = ax.properties()print("Display all Properties\n")for i in w:    print(i, ":", w[i])   fig.suptitle('matplotlib.axes.Axes.properties()\ function Example', fontweight ="bold")   plt.show() 
Output:
Display all Properties
adjustable : boxagg_filter : Nonealpha : Noneanchor : Canimated : Falseaspect : autoautoscale_on : Trueautoscalex_on : Trueautoscaley_on : Trueaxes_locator : Noneaxisbelow : linechildren : [,,,,,,, Text(0.5, 1.0, ”), Text(0.0, 1.0, ”), Text(1.0, 1.0, ”), ]clip_box : Noneclip_on : Trueclip_path : Nonecontains : Nonedata_ratio : 0.5333333333333333default_bbox_extra_artists : [,,,,,,, Text(0.5, 1.0, ”), Text(0.0, 1.0, ”), Text(1.0, 1.0, ”), ]facecolor : (1.0, 1.0, 1.0, 1.0)fc : (1.0, 1.0, 1.0, 1.0)figure : Figure(640×480)frame_on : Truegeometry : (1, 1, 1)gid : Nonegridspec : GridSpec(1, 1)images : <a>in_layout : Truelabel :legend : Nonelegend_handles_labels : ([], [])lines : <a>navigate : Truenavigate_mode : Nonepath_effects : []picker : Noneposition : Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88)rasterization_zorder : Nonerasterized : Nonerenderer_cache : Noneshared_x_axes :shared_y_axes :sketch_params : Nonesnap : Nonesubplotspec :title :transform : IdentityTransform()transformed_clip_path_and_affine : (None, None)url : Nonevisible : Truewindow_extent : TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))xaxis : XAxis(80.0, 52.8)xaxis_transform : BlendedGenericTransform(CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),CompositeGenericTransform(BboxTransformFrom(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=30.0, y1=16.0),TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))xbound : (0.0, 30.0)xgridlines : <a>xlabel :xlim : (0.0, 30.0)xmajorticklabels : <a>xminorticklabels : <a>xscale : linearxticklabels : <a>xticklines : <a>xticks : [ 0. 5. 10. 15. 20. 25. 30.]yaxis : YAxis(80.0, 52.8)yaxis_transform : BlendedGenericTransform(BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))),CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),CompositeGenericTransform(BboxTransformFrom(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=30.0, y1=16.0),TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))))ybound : (0.0, 16.0)ygridlines : <a>ylabel :ylim : (0.0, 16.0)ymajorticklabels : <a>yminorticklabels : <a>yscale : linearyticklabels : <a>yticklines : <a>yticks : [ 0. 2. 4. 6. 8. 10. 12. 14. 16.]zorder : 0
Example 2:
# Implementation of matplotlib functionimport matplotlib.pyplot as pltimport numpy as np        np.random.seed(10**7)geeks = np.random.randn(100)   fig, ax = plt.subplots()ax.acorr(geeks, usevlines = True,         normed = True,         maxlags = 80, lw = 3)  ax.grid(True)  w = ax.properties()print("Display all Properties\n")for i in w:    print(i, ":", w[i])   fig.suptitle('matplotlib.axes.Axes.properties()\function Example', fontweight ="bold")   plt.show() 
Output:
Display all Properties
adjustable : boxagg_filter : Nonealpha : Noneanchor : Canimated : Falseaspect : autoautoscale_on : Trueautoscalex_on : Trueautoscaley_on : Trueaxes_locator : Noneaxisbelow : linechildren : [,,,,,,,, Text(0.5, 1.0, ”), Text(0.0, 1.0, ”), Text(1.0, 1.0, ”), ]clip_box : Noneclip_on : Trueclip_path : Nonecontains : Nonedata_ratio : 0.007741698372824119default_bbox_extra_artists : [,,,,,,,, Text(0.5, 1.0, ”), Text(0.0, 1.0, ”), Text(1.0, 1.0, ”), ]facecolor : (1.0, 1.0, 1.0, 1.0)fc : (1.0, 1.0, 1.0, 1.0)figure : Figure(640×480)frame_on : Truegeometry : (1, 1, 1)gid : Nonegridspec : GridSpec(1, 1)images : <a>in_layout : Truelabel :legend : Nonelegend_handles_labels : ([], [])lines : <a>navigate : Truenavigate_mode : Nonepath_effects : []picker : Noneposition : Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88)rasterization_zorder : Nonerasterized : Nonerenderer_cache : Noneshared_x_axes :shared_y_axes :sketch_params : Nonesnap : Nonesubplotspec :title :transform : IdentityTransform()transformed_clip_path_and_affine : (None, None)url : Nonevisible : Truewindow_extent : TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))xaxis : XAxis(80.0, 52.8)xaxis_transform : BlendedGenericTransform(CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),CompositeGenericTransform(BboxTransformFrom(TransformedBbox(Bbox(x0=-88.0, y0=-0.300605326634452, x1=88.0, y1=1.061933586982593),TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))xbound : (-88.0, 88.0)xgridlines : <a>xlabel :xlim : (-88.0, 88.0)xmajorticklabels : <a>xminorticklabels : <a>xscale : linearxticklabels : <a>xticklines : <a>xticks : [-100. -80. -60. -40. -20. 0. 20. 40. 60. 80. 100.]yaxis : YAxis(80.0, 52.8)yaxis_transform : BlendedGenericTransform(BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))),CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),CompositeGenericTransform(BboxTransformFrom(TransformedBbox(Bbox(x0=-88.0, y0=-0.300605326634452, x1=88.0, y1=1.061933586982593),TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())))),BboxTransformTo(TransformedBbox(Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),BboxTransformTo(TransformedBbox(Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),Affine2D([[100. 0. 0.][ 0. 100. 0.][ 0. 0. 1.]]))))))))ybound : (-0.300605326634452, 1.061933586982593)ygridlines : <a>ylabel :ylim : (-0.300605326634452, 1.061933586982593)ymajorticklabels : <a>yminorticklabels : <a>yscale : linearyticklabels : <a>yticklines : <a>yticks : [-0.4 -0.2 0. 0.2 0.4 0.6 0.8 1. 1.2]zorder : 0
Matplotlib axes-class
Python-matplotlib
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Python Dictionary
Read a file line by line in Python
Enumerate() in Python
How to Install PIP on Windows ?
Iterate over a list in Python
Different ways to create Pandas Dataframe
Python program to convert a list to string
Python String | replace()
Reading and Writing to text files in Python
sum() function in Python