@@ -91,10 +91,10 @@ class in the matplotlib API, and the one you will be working with most
9191.. sourcecode:: ipython
9292
9393 In [101]: ax.lines[0]
94- Out[101]: <matplotlib.lines.Line2D instance at 0x19a95710>
94+ Out[101]: <matplotlib.lines.Line2D at 0x19a95710>
9595
9696 In [102]: line
97- Out[102]: <matplotlib.lines.Line2D instance at 0x19a95710>
97+ Out[102]: <matplotlib.lines.Line2D at 0x19a95710>
9898
9999If you make subsequent calls to ``ax.plot`` (and the hold state is "on"
100100which is the default) then additional lines will be added to the list.
@@ -107,7 +107,7 @@ class in the matplotlib API, and the one you will be working with most
107107The Axes also has helper methods to configure and decorate the x-axis
108108and y-axis tick, tick labels and axis labels::
109109
110- xtext = ax.set_xlabel('my xdata') # returns a Text instance
110+ xtext = ax.set_xlabel('my xdata') # returns a Text instance
111111 ytext = ax.set_ylabel('my ydata')
112112
113113When you call :meth:`ax.set_xlabel <matplotlib.axes.Axes.set_xlabel>`,
@@ -210,31 +210,49 @@ class in the matplotlib API, and the one you will be working with most
210210# .. sourcecode:: ipython
211211#
212212# In [149]: matplotlib.artist.getp(fig.patch)
213- # alpha = 1.0
214- # animated = False
215- # antialiased or aa = True
216- # axes = None
217- # clip_box = None
218- # clip_on = False
219- # clip_path = None
220- # contains = None
221- # edgecolor or ec = w
222- # facecolor or fc = 0.75
223- # figure = Figure(8.125x6.125)
224- # fill = 1
225- # hatch = None
226- # height = 1
227- # label =
228- # linewidth or lw = 1.0
229- # picker = None
230- # transform = <Affine object at 0x134cca84>
231- # verts = ((0, 0), (0, 1), (1, 1), (1, 0))
232- # visible = True
233- # width = 1
234- # window_extent = <Bbox object at 0x134acbcc>
235- # x = 0
236- # y = 0
237- # zorder = 1
213+ # agg_filter = None
214+ # alpha = None
215+ # animated = False
216+ # antialiased or aa = False
217+ # bbox = Bbox(x0=0.0, y0=0.0, x1=1.0, y1=1.0)
218+ # capstyle = butt
219+ # children = []
220+ # clip_box = None
221+ # clip_on = True
222+ # clip_path = None
223+ # contains = None
224+ # data_transform = BboxTransformTo( TransformedBbox( Bbox...
225+ # edgecolor or ec = (1.0, 1.0, 1.0, 1.0)
226+ # extents = Bbox(x0=0.0, y0=0.0, x1=640.0, y1=480.0)
227+ # facecolor or fc = (1.0, 1.0, 1.0, 1.0)
228+ # figure = Figure(640x480)
229+ # fill = True
230+ # gid = None
231+ # hatch = None
232+ # height = 1
233+ # in_layout = False
234+ # joinstyle = miter
235+ # label =
236+ # linestyle or ls = solid
237+ # linewidth or lw = 0.0
238+ # patch_transform = CompositeGenericTransform( BboxTransformTo( ...
239+ # path = Path(array([[0., 0.], [1., 0.], [1.,...
240+ # path_effects = []
241+ # picker = None
242+ # rasterized = None
243+ # sketch_params = None
244+ # snap = None
245+ # transform = CompositeGenericTransform( CompositeGenericTra...
246+ # transformed_clip_path_and_affine = (None, None)
247+ # url = None
248+ # verts = [[ 0. 0.] [640. 0.] [640. 480.] [ 0. 480....
249+ # visible = True
250+ # width = 1
251+ # window_extent = Bbox(x0=0.0, y0=0.0, x1=640.0, y1=480.0)
252+ # x = 0
253+ # xy = (0, 0)
254+ # y = 0
255+ # zorder = 1
238256#
239257# The docstrings for all of the classes also contain the ``Artist``
240258# properties, so you can consult the interactive "help" or the
@@ -284,11 +302,10 @@ class in the matplotlib API, and the one you will be working with most
284302# In [158]: ax2 = fig.add_axes([0.1, 0.1, 0.7, 0.3])
285303#
286304# In [159]: ax1
287- # Out[159]: <matplotlib.axes.Subplot instance at 0xd54b26c >
305+ # Out[159]: <AxesSubplot: >
288306#
289307# In [160]: print(fig.axes)
290- # [<matplotlib.axes.Subplot instance at 0xd54b26c>,
291- # <matplotlib.axes.Axes instance at 0xd3f0b2c>]
308+ # [<AxesSubplot:>, <matplotlib.axes._axes.Axes object at 0x7f0768702be0>]
292309#
293310# Because the figure maintains the concept of the "current axes" (see
294311# :meth:`Figure.gca <matplotlib.figure.Figure.gca>` and
@@ -391,7 +408,7 @@ class in the matplotlib API, and the one you will be working with most
391408# .. sourcecode:: ipython
392409#
393410# In [229]: print(ax.lines)
394- # [<matplotlib.lines.Line2D instance at 0xd378b0c>]
411+ # [<matplotlib.lines.Line2D at 0xd378b0c>]
395412#
396413# Similarly, methods that create patches, like
397414# :meth:`~matplotlib.axes.Axes.bar` creates a list of rectangles, will
@@ -403,9 +420,10 @@ class in the matplotlib API, and the one you will be working with most
403420# In [233]: n, bins, rectangles = ax.hist(np.random.randn(1000), 50)
404421#
405422# In [234]: rectangles
406- # Out[234]: <a list of 50 Patch objects >
423+ # Out[234]: <BarContainer object of 50 artists >
407424#
408425# In [235]: print(len(ax.patches))
426+ # Out[235]: 50
409427#
410428# You should not add objects directly to the ``Axes.lines`` or
411429# ``Axes.patches`` lists unless you know exactly what you are doing,
@@ -433,8 +451,8 @@ class in the matplotlib API, and the one you will be working with most
433451# None
434452#
435453# # and the transformation instance is set to the "identity transform"
436- # In [265]: print(rect.get_transform ())
437- # <Affine object at 0x13695544>
454+ # In [265]: print(rect.get_data_transform ())
455+ # IdentityTransform()
438456#
439457# # now we add the Rectangle to the Axes
440458# In [266]: ax.add_patch(rect)
@@ -445,12 +463,56 @@ class in the matplotlib API, and the one you will be working with most
445463# Axes(0.125,0.1;0.775x0.8)
446464#
447465# # and the transformation has been set too
448- # In [268]: print(rect.get_transform())
449- # <Affine object at 0x15009ca4>
466+ # In [268]: print(rect.get_data_transform())
467+ # CompositeGenericTransform(
468+ # TransformWrapper(
469+ # BlendedAffine2D(
470+ # IdentityTransform(),
471+ # IdentityTransform())),
472+ # CompositeGenericTransform(
473+ # BboxTransformFrom(
474+ # TransformedBbox(
475+ # Bbox(x0=0.0, y0=0.0, x1=1.0, y1=1.0),
476+ # TransformWrapper(
477+ # BlendedAffine2D(
478+ # IdentityTransform(),
479+ # IdentityTransform())))),
480+ # BboxTransformTo(
481+ # TransformedBbox(
482+ # Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),
483+ # BboxTransformTo(
484+ # TransformedBbox(
485+ # Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),
486+ # Affine2D(
487+ # [[100. 0. 0.]
488+ # [ 0. 100. 0.]
489+ # [ 0. 0. 1.]])))))))
450490#
451491# # the default axes transformation is ax.transData
452492# In [269]: print(ax.transData)
453- # <Affine object at 0x15009ca4>
493+ # CompositeGenericTransform(
494+ # TransformWrapper(
495+ # BlendedAffine2D(
496+ # IdentityTransform(),
497+ # IdentityTransform())),
498+ # CompositeGenericTransform(
499+ # BboxTransformFrom(
500+ # TransformedBbox(
501+ # Bbox(x0=0.0, y0=0.0, x1=1.0, y1=1.0),
502+ # TransformWrapper(
503+ # BlendedAffine2D(
504+ # IdentityTransform(),
505+ # IdentityTransform())))),
506+ # BboxTransformTo(
507+ # TransformedBbox(
508+ # Bbox(x0=0.125, y0=0.10999999999999999, x1=0.9, y1=0.88),
509+ # BboxTransformTo(
510+ # TransformedBbox(
511+ # Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.8),
512+ # Affine2D(
513+ # [[100. 0. 0.]
514+ # [ 0. 100. 0.]
515+ # [ 0. 0. 1.]])))))))
454516#
455517# # notice that the xlimits of the Axes have not been changed
456518# In [270]: print(ax.get_xlim())
@@ -463,12 +525,12 @@ class in the matplotlib API, and the one you will be working with most
463525# # we can manually invoke the auto-scaling machinery
464526# In [272]: ax.autoscale_view()
465527#
466- # # and now the xlim are updated to encompass the rectangle
528+ # # and now the xlim are updated to encompass the rectangle, plus margins
467529# In [273]: print(ax.get_xlim())
468- # (1.0 , 6.0 )
530+ # (0.75 , 6.25 )
469531#
470532# # we have to manually force a figure draw
471- # In [274]: ax.figure .canvas.draw()
533+ # In [274]: fig .canvas.draw()
472534#
473535#
474536# There are many, many ``Axes`` helper methods for creating primitive
0 commit comments