diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index 99b467d8cb6d..0f1fa97d8bf3 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -170,7 +170,6 @@ Metadata Artist.get_label Artist.set_url Artist.get_url - Artist.aname Stale ----- diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index a6f9a50b70d7..01b926e6c951 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -672,7 +672,6 @@ Other :nosignatures: Axes.zorder - Axes.aname Axes.get_default_bbox_extra_artists Axes.get_transformed_clip_path_and_affine Axes.has_data diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst index 597630df10e3..4028530102ce 100644 --- a/doc/api/axis_api.rst +++ b/doc/api/axis_api.rst @@ -470,7 +470,6 @@ Ticks Tick.add_callback - Tick.aname Tick.axes Tick.contains Tick.convert_xunits @@ -536,7 +535,6 @@ Ticks Tick.zorder XTick.add_callback - XTick.aname XTick.axes XTick.contains XTick.convert_xunits @@ -602,7 +600,6 @@ Ticks XTick.zorder YTick.add_callback - YTick.aname YTick.axes YTick.contains YTick.convert_xunits @@ -678,7 +675,6 @@ Axis Axis.add_callback - Axis.aname Axis.axes Axis.contains Axis.convert_xunits @@ -744,7 +740,6 @@ Axis Axis.zorder XAxis.add_callback - XAxis.aname XAxis.axes XAxis.contains XAxis.convert_xunits @@ -810,7 +805,6 @@ Axis XAxis.zorder YAxis.add_callback - YAxis.aname YAxis.axes YAxis.contains YAxis.convert_xunits diff --git a/examples/pyplots/dollar_ticks.py b/examples/pyplots/dollar_ticks.py index e980de104848..0ed367645577 100644 --- a/examples/pyplots/dollar_ticks.py +++ b/examples/pyplots/dollar_ticks.py @@ -19,8 +19,8 @@ ax.yaxis.set_major_formatter(formatter) for tick in ax.yaxis.get_major_ticks(): - tick.label1On = False - tick.label2On = True + tick.label1.set_visible(False) + tick.label2.set_visible(True) tick.label2.set_color('green') plt.show() diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 5533cc0a5b25..aece19a1fc74 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -5371,10 +5371,10 @@ def test_axes_tick_params_ylabelside(): ax.tick_params(labelleft=False, labelright=True, which='minor') # expects left false, right true - assert ax.yaxis.majorTicks[0].label1On is False - assert ax.yaxis.majorTicks[0].label2On is True - assert ax.yaxis.minorTicks[0].label1On is False - assert ax.yaxis.minorTicks[0].label2On is True + assert ax.yaxis.majorTicks[0].label1.get_visible() is False + assert ax.yaxis.majorTicks[0].label2.get_visible() is True + assert ax.yaxis.minorTicks[0].label1.get_visible() is False + assert ax.yaxis.minorTicks[0].label2.get_visible() is True def test_axes_tick_params_xlabelside(): @@ -5385,12 +5385,12 @@ def test_axes_tick_params_xlabelside(): ax.tick_params(labeltop=True, labelbottom=False, which='minor') # expects top True, bottom False - # label1On mapped to labelbottom - # label2On mapped to labeltop - assert ax.xaxis.majorTicks[0].label1On is False - assert ax.xaxis.majorTicks[0].label2On is True - assert ax.xaxis.minorTicks[0].label1On is False - assert ax.xaxis.minorTicks[0].label2On is True + # label1.get_visible() mapped to labelbottom + # label2.get_visible() mapped to labeltop + assert ax.xaxis.majorTicks[0].label1.get_visible() is False + assert ax.xaxis.majorTicks[0].label2.get_visible() is True + assert ax.xaxis.minorTicks[0].label1.get_visible() is False + assert ax.xaxis.minorTicks[0].label2.get_visible() is True def test_none_kwargs(): diff --git a/tutorials/intermediate/artists.py b/tutorials/intermediate/artists.py index 14f8f830bfad..3362716a8c31 100644 --- a/tutorials/intermediate/artists.py +++ b/tutorials/intermediate/artists.py @@ -44,7 +44,7 @@ import matplotlib.pyplot as plt fig = plt.figure() - ax = fig.add_subplot(2,1,1) # two rows, one column, first plot + ax = fig.add_subplot(2, 1, 1) # two rows, one column, first plot The :class:`~matplotlib.axes.Axes` is probably the most important class in the matplotlib API, and the one you will be working with most @@ -117,24 +117,6 @@ class in the matplotlib API, and the one you will be working with most :class:`~matplotlib.axis.YAxis` instance, which handle the layout and drawing of the ticks, tick labels and axis labels. -.. I'm commenting this out, since the new Sphinx cross-references -.. sort of take care of this above - MGD - -.. Here are the most important matplotlib modules that contain the -.. classes referenced above - -.. =============== ================== -.. Artist Module -.. =============== ================== -.. Artist matplotlib.artist -.. Rectangle matplotlib.patches -.. Line2D matplotlib.lines -.. Axes matplotlib.axes -.. XAxis and YAxis matplotlib.axis -.. Figure matplotlib.figure -.. Text matplotlib.text -.. =============== ================== - Try creating the figure below. """ @@ -186,7 +168,7 @@ class in the matplotlib API, and the one you will be working with most # ========== ================================================================================ # Property Description # ========== ================================================================================ -# alpha The transparency - a scalar from 0-1 +# alpha The transparency - a scalar from 0-1 # animated A boolean that is used to facilitate animated drawing # axes The axes that the Artist lives in, possibly None # clip_box The bounding box that clips the Artist @@ -199,7 +181,7 @@ class in the matplotlib API, and the one you will be working with most # transform The transformation # visible A boolean whether the artist should be drawn # zorder A number which determines the drawing order -# rasterized Boolean; Turns vectors into rastergraphics: (for compression & eps transparency) +# rasterized Boolean; Turns vectors into raster graphics (for compression & eps transparency) # ========== ================================================================================ # # Each of the properties is accessed with an old-fashioned setter or @@ -252,8 +234,6 @@ class in the matplotlib API, and the one you will be working with most # y = 0 # zorder = 1 # -# .. TODO: Update these URLs -# # The docstrings for all of the classes also contain the ``Artist`` # properties, so you can consult the interactive "help" or the # :ref:`artist-api` for a listing of properties for a given object. @@ -351,17 +331,17 @@ class in the matplotlib API, and the one you will be working with most # # .. TODO: Add xrefs to this table # -# ================ =============================================================== -# Figure attribute Description -# ================ =============================================================== -# axes A list of Axes instances (includes Subplot) -# patch The Rectangle background -# images A list of FigureImages patches - useful for raw pixel display -# legends A list of Figure Legend instances (different from Axes.legends) -# lines A list of Figure Line2D instances (rarely used, see Axes.lines) -# patches A list of Figure patches (rarely used, see Axes.patches) -# texts A list Figure Text instances -# ================ =============================================================== +# ================ =============================================================== +# Figure attribute Description +# ================ =============================================================== +# axes A list of Axes instances (includes Subplot) +# patch The Rectangle background +# images A list of FigureImages patches - useful for raw pixel display +# legends A list of Figure Legend instances (different from Axes.legends) +# lines A list of Figure Line2D instances (rarely used, see Axes.lines) +# patches A list of Figure patches (rarely used, see Axes.patches) +# texts A list Figure Text instances +# ================ =============================================================== # # .. _axes-container: # @@ -654,9 +634,7 @@ class in the matplotlib API, and the one you will be working with most # to the :class:`~matplotlib.axis.Tick`. The ``Tick`` contains the tick # and grid line instances, as well as the label instances for the upper # and lower ticks. Each of these is accessible directly as an attribute -# of the ``Tick``. In addition, there are boolean variables that determine -# whether the upper labels and ticks are on for the x-axis and whether -# the right labels and ticks are on for the y-axis. +# of the ``Tick``. # # ============== ========================================================== # Tick attribute Description @@ -666,11 +644,6 @@ class in the matplotlib API, and the one you will be working with most # gridline Line2D instance # label1 Text instance # label2 Text instance -# gridOn boolean which determines whether to draw the gridline -# tick1On boolean which determines whether to draw the 1st tickline -# tick2On boolean which determines whether to draw the 2nd tickline -# label1On boolean which determines whether to draw the 1st tick label -# label2On boolean which determines whether to draw the 2nd tick label # ============== ========================================================== # # Here is an example which sets the formatter for the right side ticks with @@ -688,8 +661,8 @@ class in the matplotlib API, and the one you will be working with most ax.yaxis.set_major_formatter(formatter) for tick in ax.yaxis.get_major_ticks(): - tick.label1On = False - tick.label2On = True + tick.label1.set_visible(False) + tick.label2.set_visible(True) tick.label2.set_color('green') plt.show()