Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04d9d28

Browse files
authored
Merge pull request #14672 from bingyao/artist_tutorial_fixes
Artist tutorial fixes
2 parents 32231f2 + da8ccdc commit 04d9d28

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tutorials/intermediate/artists.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class in the matplotlib API, and the one you will be working with most
5757
graphics primitives (:class:`~matplotlib.lines.Line2D`,
5858
:class:`~matplotlib.text.Text`,
5959
:class:`~matplotlib.patches.Rectangle`,
60-
:class:`~matplotlib.image.Image`, respectively). These helper methods
60+
:class:`~matplotlib.image.AxesImage`, respectively). These helper methods
6161
will take your data (e.g., ``numpy`` arrays and strings) and create
6262
primitive ``Artist`` instances as needed (e.g., ``Line2D``), add them to
6363
the relevant containers, and draw them when requested. Most of you
@@ -423,7 +423,7 @@ class in the matplotlib API, and the one you will be working with most
423423
# In [263]: rect = matplotlib.patches.Rectangle( (1,1), width=5, height=12)
424424
#
425425
# # by default the axes instance is None
426-
# In [264]: print(rect.get_axes())
426+
# In [264]: print(rect.axes)
427427
# None
428428
#
429429
# # and the transformation instance is set to the "identity transform"
@@ -435,7 +435,7 @@ class in the matplotlib API, and the one you will be working with most
435435
#
436436
# # and notice that the ax.add_patch method has set the axes
437437
# # instance
438-
# In [267]: print(rect.get_axes())
438+
# In [267]: print(rect.axes)
439439
# Axes(0.125,0.1;0.775x0.8)
440440
#
441441
# # and the transformation has been set too
@@ -555,25 +555,23 @@ class in the matplotlib API, and the one you will be working with most
555555
axis.get_ticklabels()
556556

557557
###############################################################################
558-
# note there are twice as many ticklines as labels because by
559-
# default there are tick lines at the top and bottom but only tick
560-
# labels below the xaxis; this can be customized
558+
# note there are twice as many ticklines as labels because by default there are
559+
# tick lines at the top and bottom but only tick labels below the xaxis;
560+
# however, this can be customized.
561561

562562
axis.get_ticklines()
563563

564564
###############################################################################
565-
# by default you get the major ticks back
566-
567-
axis.get_ticklines()
568-
569-
###############################################################################
570-
# but you can also ask for the minor ticks
565+
# And with the above methods, you only get lists of major ticks back by default,
566+
# but you can also ask for the minor ticks:
571567

568+
axis.get_ticklabels(minor=True)
572569
axis.get_ticklines(minor=True)
573570

571+
###############################################################################
574572
# Here is a summary of some of the useful accessor methods of the ``Axis``
575573
# (these have corresponding setters where useful, such as
576-
# set_major_formatter)
574+
# :meth:`~matplotlib.axis.Axis.set_major_formatter`.)
577575
#
578576
# ====================== =========================================================
579577
# Accessor method Description

0 commit comments

Comments
 (0)