From 0de8fed81a99ab58725a793f54bdb87edd080c92 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 00:32:17 -0400 Subject: [PATCH 01/14] DOC: start to overhaul Axes API docs --- doc/api/axes_api.rst | 423 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 416 insertions(+), 7 deletions(-) diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index 38791e242cd8..b549580b7ddc 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -1,12 +1,421 @@ -**** -axes -**** +******** +``Axes`` +******** + +.. contents:: Table of Contents + :depth: 3 + :local: + :backlinks: entry :mod:`matplotlib.axes` ====================== -.. autoclass:: matplotlib.axes.Axes - :members: - :undoc-members: - :inherited-members: +.. automodule:: matplotlib.axes + +Plotting +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.acorr + Axes.angle_spectrum + Axes.annotate + Axes.arrow + Axes.axhline + Axes.axhspan + Axes.axvline + Axes.axvspan + Axes.bar + Axes.barbs + Axes.barh + Axes.boxplot + Axes.broken_barh + Axes.bxp + Axes.clabel + Axes.cohere + Axes.contour + Axes.contourf + Axes.csd + Axes.errorbar + Axes.eventplot + Axes.fill + Axes.fill_between + Axes.fill_betweenx + Axes.hexbin + Axes.hist + Axes.hist2d + Axes.hlines + Axes.imshow + Axes.loglog + Axes.magnitude_spectrum + Axes.matshow + Axes.pcolor + Axes.pcolorfast + Axes.pcolormesh + Axes.phase_spectrum + Axes.pie + Axes.plot + Axes.plot_date + Axes.psd + Axes.quiver + Axes.quiverkey + Axes.scatter + Axes.semilogx + Axes.semilogy + Axes.specgram + Axes.spy + Axes.stackplot + Axes.stem + Axes.step + Axes.streamplot + Axes.table + Axes.text + Axes.tricontour + Axes.tricontourf + Axes.tripcolor + Axes.triplot + Axes.violin + Axes.violinplot + Axes.vlines + Axes.xcorr + + +Axis / limits +------------- + + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.axis + Axes.set_axis_off + Axes.set_axis_on + Axes.set_axisbelow + Axes.invert_xaxis + Axes.invert_yaxis + Axes.xaxis_inverted + Axes.yaxis_inverted + + +Axis scales +~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.set_xscale + Axes.get_xscale + Axes.get_yscale + Axes.set_yscale + + +Autoscaling +~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.autoscale + Axes.autoscale_view + + Axes.get_autoscale_on + Axes.set_autoscale_on + + Axes.get_autoscalex_on + Axes.set_autoscalex_on + + Axes.get_autoscaley_on + Axes.set_autoscaley_on + + +Aspect ratio +~~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.apply_aspect + Axes.get_aspect + Axes.set_aspect + + Axes.get_adjustable + Axes.set_adjustable + + +Ticks and tick labels +~~~~~~~~~~~~~~~~~~~~~ + + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.xaxis_date + Axes.yaxis_date + + Axes.get_xmajorticklabels + Axes.get_xminorticklabels + Axes.get_xticklabels + Axes.get_xticklines + Axes.get_xticks + + Axes.get_ymajorticklabels + Axes.get_yminorticklabels + Axes.get_yticklabels + Axes.get_yticklines + Axes.get_yticks + + Axes.minorticks_off + Axes.minorticks_on + + Axes.set_xticklabels + Axes.set_xticks + Axes.set_ybound + Axes.set_ylabel + Axes.set_ylim + Axes.set_ymargin + Axes.set_yticklabels + Axes.set_yticks + + +Units +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.convert_xunits + Axes.convert_yunits + + +Adding Artists +-------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.add_artist + Axes.add_callback + Axes.add_collection + Axes.add_container + Axes.add_image + Axes.add_line + Axes.add_patch + Axes.add_table + + +Async/Event based +----------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.stale + Axes.pchanged + + +Twinning +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.twinx + Axes.twiny + + Axes.get_shared_x_axes + Axes.get_shared_y_axes + +Interactive helpers +------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axes.can_pan + Axes.can_zoom + + Axes.get_navigate + Axes.set_navigate + Axes.get_navigate_mode + Axes.set_navigate_mode + + Axes.drag_pan + Axes.end_pan + + Axes.format_coord + Axes.format_cursor_data + Axes.format_xdata + Axes.format_ydata + +Other +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.aname + Axes.axes + Axes.bottom_margin + Axes.cla + Axes.clear + Axes.contains + Axes.contains_point + Axes.draw + Axes.draw_artist + Axes.findobj + Axes.get_agg_filter + Axes.get_alpha + Axes.get_anchor + Axes.get_animated + Axes.get_axes + Axes.get_axes_locator + Axes.get_axis_bgcolor + Axes.get_axisbelow + Axes.get_bottom_margin + Axes.get_children + Axes.get_clip_box + Axes.get_clip_on + Axes.get_clip_path + Axes.get_contains + Axes.get_cursor_data + Axes.get_cursor_props + Axes.get_data_ratio + Axes.get_data_ratio_log + Axes.get_default_bbox_extra_artists + Axes.get_facecolor + Axes.get_fc + Axes.get_figure + Axes.get_frame_on + Axes.get_gid + Axes.get_images + Axes.get_label + Axes.get_left_margin + Axes.get_legend + Axes.get_legend_handles_labels + Axes.get_lines + Axes.get_margins + Axes.get_path_effects + Axes.get_picker + Axes.get_position + Axes.get_rasterization_zorder + Axes.get_rasterized + Axes.get_renderer_cache + Axes.get_right_margin + Axes.get_sketch_params + Axes.get_snap + Axes.get_tightbbox + Axes.get_title + Axes.get_top_margin + Axes.get_transform + Axes.get_transformed_clip_path_and_affine + Axes.get_url + Axes.get_visible + Axes.get_window_extent + Axes.get_xaxis + Axes.get_xaxis_text1_transform + Axes.get_xaxis_text2_transform + Axes.get_xaxis_transform + Axes.get_xbound + Axes.get_xgridlines + Axes.get_xlabel + Axes.get_xlim + Axes.get_yaxis + Axes.get_yaxis_text1_transform + Axes.get_yaxis_text2_transform + Axes.get_yaxis_transform + Axes.get_ybound + Axes.get_ygridlines + Axes.get_ylabel + Axes.get_ylim + Axes.get_zorder + Axes.grid + Axes.has_data + Axes.have_units + Axes.hitlist + Axes.hold + Axes.in_axes + Axes.is_figure_set + Axes.is_transform_set + Axes.ishold + Axes.left_margin + Axes.legend + Axes.locator_params + Axes.margins + Axes.mouseover + Axes.name + Axes.pick + Axes.pickable + Axes.properties + Axes.redraw_in_frame + Axes.relim + Axes.remove + Axes.remove_callback + Axes.reset_position + Axes.right_margin + Axes.set + Axes.set_agg_filter + Axes.set_alpha + Axes.set_anchor + Axes.set_animated + Axes.set_axes + Axes.set_axes_locator + Axes.set_axis_bgcolor + Axes.set_bottom_margin + Axes.set_clip_box + Axes.set_clip_on + Axes.set_clip_path + Axes.set_color_cycle + Axes.set_contains + Axes.set_cursor_props + Axes.set_facecolor + Axes.set_fc + Axes.set_figure + Axes.set_frame_on + Axes.set_gid + Axes.set_label + Axes.set_left_margin + Axes.set_margins + Axes.set_path_effects + Axes.set_picker + Axes.set_position + Axes.set_prop_cycle + Axes.set_rasterization_zorder + Axes.set_rasterized + Axes.set_right_margin + Axes.set_sketch_params + Axes.set_snap + Axes.set_title + Axes.set_top_margin + Axes.set_transform + Axes.set_url + Axes.set_visible + Axes.set_xbound + Axes.set_xlabel + Axes.set_xlim + Axes.set_xmargin + Axes.set_zorder + Axes.start_pan + Axes.tick_params + Axes.ticklabel_format + Axes.top_margin + Axes.update + Axes.update_datalim + Axes.update_datalim_bounds + Axes.update_datalim_numerix + Axes.update_from + Axes.zorder From 474f1eebfdc0d03a1fa54231b92d258d09570d20 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 15:50:01 -0400 Subject: [PATCH 02/14] DOC: patch up documentation on Axes --- lib/matplotlib/axes/_axes.py | 2 ++ lib/matplotlib/axes/_base.py | 59 ++++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 755b3839b0de..4a1780fcd37e 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -107,6 +107,8 @@ class Axes(_AxesBase): """ ### Labelling, legend and texts + aname = 'Axes' + def get_title(self, loc="center"): """Get an axes title. diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 0feb87e757d1..fbeba7dcc763 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -844,8 +844,9 @@ def get_position(self, original=False): return self._position.frozen() def set_position(self, pos, which='both'): - """ - Set the axes position with:: + """Set the axes position + + The expected shape of ``pos`` is:: pos = [left, bottom, width, height] @@ -1188,13 +1189,14 @@ def ishold(self): return self._hold def hold(self, b=None): - """ + """Set the hold state + Call signature:: hold(b=None) - Set the hold state. If *hold* is *None* (default), toggle the - *hold* state. Else set the *hold* state to boolean value *b*. + If *hold* is *None* (default), toggle the *hold* state. Else + set the *hold* state to boolean value *b*. Examples:: @@ -2727,11 +2729,16 @@ def xaxis_inverted(self): return right < left def get_xbound(self): - """ - Returns the x-axis numerical bounds where:: + """Returns the x-axis numerical bounds + + This always returns:: lowerBound < upperBound + Returns + ------- + lowerBound, upperBound : float + """ left, right = self.get_xlim() if left < right: @@ -2773,7 +2780,8 @@ def get_xlim(self): return tuple(self.viewLim.intervalx) def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw): - """ + """Set the data limits for the xaxis + Call signature:: set_xlim(self, *args, **kwargs): @@ -2871,7 +2879,8 @@ def get_xscale(self): @docstring.dedent_interpd def set_xscale(self, value, **kwargs): - """ + """Set the x-axis scale + Call signature:: set_xscale(value) @@ -2953,12 +2962,13 @@ def get_xticklabels(self, minor=False, which=None): @docstring.dedent_interpd def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): - """ + """Set the xtick labels with list of strings *labels* + Call signature:: set_xticklabels(labels, fontdict=None, minor=False, **kwargs) - Set the xtick labels with list of strings *labels*. Return a + Return a list of axis text instances. *kwargs* set the :class:`~matplotlib.text.Text` properties. @@ -3031,13 +3041,12 @@ def get_ylim(self): return tuple(self.viewLim.intervaly) def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw): - """ + """Set the data limits for the yaxis + Call signature:: set_ylim(self, *args, **kwargs): - Set the data limits for the yaxis - Examples:: set_ylim((bottom, top)) @@ -3130,7 +3139,8 @@ def get_yscale(self): @docstring.dedent_interpd def set_yscale(self, value, **kwargs): - """ + """Set the y-axis scale + Call signature:: set_yscale(value) @@ -3215,12 +3225,13 @@ def get_yticklabels(self, minor=False, which=None): @docstring.dedent_interpd def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs): - """ + """Set the y tick labels with list of strings *labels* + Call signature:: set_yticklabels(labels, fontdict=None, minor=False, **kwargs) - Set the y tick labels with list of strings *labels*. Return a list of + Return a list of :class:`~matplotlib.text.Text` instances. *kwargs* set :class:`~matplotlib.text.Text` properties for the labels. @@ -3626,8 +3637,9 @@ def get_cursor_props(self): return self._cursorProps def set_cursor_props(self, *args): - """ - Set the cursor property as:: + """Set the cursor property as + + Call signature :: ax.set_cursor_props(linewidth, color) @@ -3688,7 +3700,8 @@ def contains_point(self, point): return self.patch.contains_point(point, radius=1.0) def pick(self, *args): - """ + """Trigger pick event + Call signature:: pick(mouseevent) @@ -3760,7 +3773,8 @@ def _make_twin_axes(self, *kl, **kwargs): return ax2 def twinx(self): - """ + """Create a twin Axes sharing the xaxis + Call signature:: ax = twinx() @@ -3785,7 +3799,8 @@ def twinx(self): return ax2 def twiny(self): - """ + """Create a twin Axes sharing the yaxis + Call signature:: ax = twiny() From ab31bf23a37fb68a4cfdbd4d3411ee267ca8e7d6 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 15:50:27 -0400 Subject: [PATCH 03/14] DOC: use explicit autosummary tables for Axes This: - makes the axes_api page a collection of tables which are grouped reasonably - gives each method it's own web page --- doc/_static/mpl.css | 25 +-- doc/api/axes_api.rst | 490 +++++++++++++++++++++++++++++-------------- 2 files changed, 339 insertions(+), 176 deletions(-) diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css index 722a58bb17ae..a9a7089f239c 100644 --- a/doc/_static/mpl.css +++ b/doc/_static/mpl.css @@ -6,7 +6,6 @@ body { font-family: "Helvetica Neue", Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif; font-size: 14px; - letter-spacing: -0.01em; line-height: 150%; text-align: center; background-color: #BFD1D4; @@ -272,7 +271,7 @@ h2 { } h3 { - margin: 1em 0 -0.3em 0; + margin: 0.2em 0 0.1em 0; font-size: 1.2em; } @@ -513,19 +512,13 @@ table.docutils { .longtable.docutils { font-size: 12px; margin-bottom: 30px; - background-color: #ccc; } .longtable.docutils, .longtable.docutils td { border-color: #ccc; } -/* module summary table */ -.longtable.docutils { - font-size: 12px; - margin-bottom: 30px; -} -.longtable.docutils, .longtable.docutils td { - border-color: #ccc; +.longtable.docutils tr.row-even{ + background-color: #eff3f4; } /* function and class description */ @@ -560,16 +553,20 @@ dl.class dd, dl.function dd { } /* function and class description */ -dl.class, dl.function, dl.method, dl.attribute { +dl.function, dl.method, dl.attribute { border-top: 1px solid #ccc; padding-top: 6px; } -dl.class, dl.function { +dl.function { border-top: 1px solid #888; - margin-top: 15px; + margin-top: 15px; } +dl.class { + padding-top: 6px; + margin-top: 15px; +} .descclassname { color: #aaa; @@ -705,7 +702,7 @@ div.responsive_subfig{ /* Include content, padding and border in width. This should */ /* avoid having to use tricks like "width: 24.9999%" */ - box-sizing: border-box; + box-sizing: border-box; } div.responsive_subfig img { diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index b549580b7ddc..072602860fc8 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -1,18 +1,16 @@ -******** -``Axes`` -******** +================ + ``Axes`` class +================ +.. currentmodule:: matplotlib.axes + +.. autoclass:: Axes .. contents:: Table of Contents - :depth: 3 + :depth: 2 :local: :backlinks: entry -:mod:`matplotlib.axes` -====================== - -.. automodule:: matplotlib.axes - Plotting -------- @@ -82,24 +80,117 @@ Plotting Axes.vlines Axes.xcorr +Clearing +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.cla + Axes.clear + -Axis / limits -------------- +Appearance +---------- .. autosummary:: :toctree: _as_gen :nosignatures: + Axes.axis + Axes.set_axis_off Axes.set_axis_on + Axes.set_frame_on + Axes.get_frame_on + Axes.set_axisbelow + Axes.get_axisbelow + + Axes.grid + + Axes.get_axis_bgcolor + Axes.get_facecolor + Axes.get_fc + + Axes.set_facecolor + Axes.set_fc + Axes.set_axis_bgcolor + + + +Property cycle +-------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.set_prop_cycle + Axes.set_color_cycle + + +Axis / limits +------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axes.get_yaxis + Axes.get_xaxis + + + +Axis Limits and direction +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.invert_xaxis Axes.invert_yaxis Axes.xaxis_inverted Axes.yaxis_inverted + Axes.set_xlim + Axes.set_ylim + Axes.get_ylim + Axes.get_xlim + + Axes.update_datalim + Axes.update_datalim_bounds + Axes.update_datalim_numerix + + Axes.set_ybound + Axes.set_xbound + Axes.get_ybound + Axes.get_xbound + +Axis Labels, title, and legend +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.get_xlabel + Axes.get_ylabel + + Axes.set_xlabel + Axes.set_ylabel + + Axes.set_title + Axes.get_title + Axes.legend + Axes.get_legend + Axes.get_legend_handles_labels + Axis scales ~~~~~~~~~~~ @@ -110,10 +201,12 @@ Axis scales Axes.set_xscale Axes.get_xscale + Axes.get_yscale Axes.set_yscale + Autoscaling ~~~~~~~~~~~ @@ -121,6 +214,8 @@ Autoscaling :toctree: _as_gen :nosignatures: + Axes.relim + Axes.autoscale Axes.autoscale_view @@ -134,6 +229,33 @@ Autoscaling Axes.set_autoscaley_on + +Margins ++++++++ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axes.margins + Axes.set_margins + Axes.get_margins + Axes.bottom_margin + Axes.get_bottom_margin + Axes.get_left_margin + Axes.get_right_margin + Axes.get_top_margin + Axes.left_margin + Axes.right_margin + Axes.set_bottom_margin + Axes.set_left_margin + Axes.set_top_margin + Axes.set_right_margin + Axes.set_xmargin + Axes.top_margin + + Aspect ratio ~~~~~~~~~~~~ @@ -177,13 +299,32 @@ Ticks and tick labels Axes.set_xticklabels Axes.set_xticks - Axes.set_ybound - Axes.set_ylabel - Axes.set_ylim Axes.set_ymargin Axes.set_yticklabels Axes.set_yticks + Axes.get_xgridlines + Axes.get_ygridlines + + + Axes.ticklabel_format + Axes.tick_params + + Axes.locator_params + + +Internal +~~~~~~~~ +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.get_xaxis_text1_transform + Axes.get_xaxis_text2_transform + Axes.get_yaxis_text1_transform + Axes.get_yaxis_text2_transform + + Units ----- @@ -194,6 +335,7 @@ Units Axes.convert_xunits Axes.convert_yunits + Axes.have_units Adding Artists @@ -204,7 +346,6 @@ Adding Artists :nosignatures: Axes.add_artist - Axes.add_callback Axes.add_collection Axes.add_container Axes.add_image @@ -213,32 +354,53 @@ Adding Artists Axes.add_table -Async/Event based ------------------ +Twinning +-------- .. autosummary:: :toctree: _as_gen :nosignatures: - Axes.stale - Axes.pchanged + Axes.twinx + Axes.twiny + Axes.get_shared_x_axes + Axes.get_shared_y_axes -Twinning --------- +Axes Position +------------- .. autosummary:: :toctree: _as_gen :nosignatures: - Axes.twinx - Axes.twiny + Axes.get_anchor + Axes.set_anchor - Axes.get_shared_x_axes - Axes.get_shared_y_axes + Axes.get_axes_locator + Axes.set_axes_locator + + Axes.reset_position + + Axes.get_position + Axes.set_position + + +Async/Event based +----------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.stale + Axes.pchanged + Axes.add_callback + Axes.remove_callback -Interactive helpers -------------------- + +Interactive +----------- .. autosummary:: :toctree: _as_gen @@ -253,6 +415,7 @@ Interactive helpers Axes.get_navigate_mode Axes.set_navigate_mode + Axes.start_pan Axes.drag_pan Axes.end_pan @@ -261,161 +424,164 @@ Interactive helpers Axes.format_xdata Axes.format_ydata -Other ------ + Axes.hitlist + Axes.mouseover + Axes.in_axes -.. autosummary:: - :toctree: _as_gen - :nosignatures: + Axes.pick + Axes.pickable + Axes.get_picker + Axes.set_picker + + Axes.set_contains + Axes.get_contains - Axes.aname - Axes.axes - Axes.bottom_margin - Axes.cla - Axes.clear Axes.contains Axes.contains_point - Axes.draw - Axes.draw_artist - Axes.findobj - Axes.get_agg_filter - Axes.get_alpha - Axes.get_anchor - Axes.get_animated - Axes.get_axes - Axes.get_axes_locator - Axes.get_axis_bgcolor - Axes.get_axisbelow - Axes.get_bottom_margin - Axes.get_children - Axes.get_clip_box - Axes.get_clip_on - Axes.get_clip_path - Axes.get_contains + Axes.get_cursor_data Axes.get_cursor_props - Axes.get_data_ratio - Axes.get_data_ratio_log - Axes.get_default_bbox_extra_artists - Axes.get_facecolor - Axes.get_fc - Axes.get_figure - Axes.get_frame_on - Axes.get_gid + Axes.set_cursor_props + +Children +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.get_children Axes.get_images - Axes.get_label - Axes.get_left_margin - Axes.get_legend - Axes.get_legend_handles_labels Axes.get_lines - Axes.get_margins - Axes.get_path_effects - Axes.get_picker - Axes.get_position - Axes.get_rasterization_zorder - Axes.get_rasterized + Axes.findobj + + +Drawing +------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.draw + Axes.draw_artist + Axes.redraw_in_frame Axes.get_renderer_cache - Axes.get_right_margin - Axes.get_sketch_params - Axes.get_snap - Axes.get_tightbbox - Axes.get_title - Axes.get_top_margin - Axes.get_transform - Axes.get_transformed_clip_path_and_affine - Axes.get_url - Axes.get_visible + + Axes.get_rasterization_zorder + Axes.set_rasterization_zorder + Axes.get_window_extent - Axes.get_xaxis - Axes.get_xaxis_text1_transform - Axes.get_xaxis_text2_transform - Axes.get_xaxis_transform - Axes.get_xbound - Axes.get_xgridlines - Axes.get_xlabel - Axes.get_xlim - Axes.get_yaxis - Axes.get_yaxis_text1_transform - Axes.get_yaxis_text2_transform - Axes.get_yaxis_transform - Axes.get_ybound - Axes.get_ygridlines - Axes.get_ylabel - Axes.get_ylim - Axes.get_zorder - Axes.grid - Axes.has_data - Axes.have_units - Axes.hitlist - Axes.hold - Axes.in_axes - Axes.is_figure_set - Axes.is_transform_set - Axes.ishold - Axes.left_margin - Axes.legend - Axes.locator_params - Axes.margins - Axes.mouseover - Axes.name - Axes.pick - Axes.pickable - Axes.properties - Axes.redraw_in_frame - Axes.relim - Axes.remove - Axes.remove_callback - Axes.reset_position - Axes.right_margin + Axes.get_tightbbox + + +Bulk property manipulation +-------------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.set - Axes.set_agg_filter + Axes.update + Axes.properties + Axes.update_from + + +General Artist Properties +------------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.set_alpha - Axes.set_anchor Axes.set_animated - Axes.set_axes - Axes.set_axes_locator - Axes.set_axis_bgcolor - Axes.set_bottom_margin Axes.set_clip_box Axes.set_clip_on Axes.set_clip_path - Axes.set_color_cycle - Axes.set_contains - Axes.set_cursor_props - Axes.set_facecolor - Axes.set_fc - Axes.set_figure - Axes.set_frame_on Axes.set_gid Axes.set_label - Axes.set_left_margin - Axes.set_margins - Axes.set_path_effects - Axes.set_picker - Axes.set_position - Axes.set_prop_cycle - Axes.set_rasterization_zorder + Axes.set_url + Axes.set_visible + Axes.set_zorder Axes.set_rasterized - Axes.set_right_margin Axes.set_sketch_params + Axes.set_agg_filter Axes.set_snap - Axes.set_title - Axes.set_top_margin Axes.set_transform - Axes.set_url - Axes.set_visible - Axes.set_xbound - Axes.set_xlabel - Axes.set_xlim - Axes.set_xmargin - Axes.set_zorder - Axes.start_pan - Axes.tick_params - Axes.ticklabel_format - Axes.top_margin - Axes.update - Axes.update_datalim - Axes.update_datalim_bounds - Axes.update_datalim_numerix - Axes.update_from + Axes.set_path_effects + + Axes.get_agg_filter + Axes.get_sketch_params + Axes.get_alpha + Axes.get_animated + Axes.get_clip_box + Axes.get_clip_on + Axes.get_clip_path + Axes.get_gid + Axes.get_label + Axes.get_url + Axes.get_visible + Axes.get_zorder + Axes.get_rasterized + Axes.get_transform + Axes.get_snap + Axes.get_path_effects + + + Axes.axes + Axes.get_axes + Axes.set_axes + Axes.set_figure + Axes.get_figure + +Artist Methods +-------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.is_figure_set + Axes.remove + Axes.is_transform_set + + +Projection +---------- + +Methods used by `~matplotlib.axis.Axis` that must be overridden for +non-rectilinear Axes. + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.name + Axes.get_xaxis_transform + Axes.get_yaxis_transform + Axes.get_data_ratio + Axes.get_data_ratio_log + + +Other +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.zorder + Axes.aname + Axes.get_default_bbox_extra_artists + Axes.get_transformed_clip_path_and_affine + Axes.has_data + Axes.hold + Axes.ishold + + +Inheritance +----------- +.. inheritance-diagram:: matplotlib.axes.Axes + :private-bases: From ef583fc4591995a999e615e93513624394e15d35 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 16:28:57 -0400 Subject: [PATCH 04/14] DOC: organize plotting methods --- doc/api/axes_api.rst | 176 ++++++++++++++++++++++++++++++++----------- 1 file changed, 132 insertions(+), 44 deletions(-) diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index 072602860fc8..d32d5d9f4c4c 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -14,71 +14,159 @@ Plotting -------- +Basic +~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.plot + Axes.errorbar + Axes.scatter + + Axes.plot_date + Axes.step + + Axes.loglog + Axes.semilogx + Axes.semilogy + + Axes.fill_between + Axes.fill_betweenx + + Axes.bar + Axes.barh + + Axes.stem + Axes.eventplot + + Axes.pie + + Axes.stackplot + + + Axes.broken_barh + Axes.vlines + Axes.hlines + Axes.fill + +Spans +~~~~~ + .. autosummary:: :toctree: _as_gen :nosignatures: - Axes.acorr - Axes.angle_spectrum - Axes.annotate - Axes.arrow Axes.axhline Axes.axhspan Axes.axvline Axes.axvspan - Axes.bar - Axes.barbs - Axes.barh - Axes.boxplot - Axes.broken_barh - Axes.bxp - Axes.clabel + +Spectral +~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.acorr + Axes.angle_spectrum Axes.cohere - Axes.contour - Axes.contourf Axes.csd - Axes.errorbar - Axes.eventplot - Axes.fill - Axes.fill_between - Axes.fill_betweenx + Axes.magnitude_spectrum + Axes.phase_spectrum + Axes.psd + Axes.specgram + Axes.xcorr + +Statistics +~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.boxplot + Axes.violinplot + + Axes.violin + Axes.bxp + +Binned +~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.hexbin Axes.hist Axes.hist2d - Axes.hlines + +Contours +~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.clabel + Axes.contour + Axes.contourf + +Array +~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.imshow - Axes.loglog - Axes.magnitude_spectrum Axes.matshow Axes.pcolor Axes.pcolorfast Axes.pcolormesh - Axes.phase_spectrum - Axes.pie - Axes.plot - Axes.plot_date - Axes.psd - Axes.quiver - Axes.quiverkey - Axes.scatter - Axes.semilogx - Axes.semilogy - Axes.specgram Axes.spy - Axes.stackplot - Axes.stem - Axes.step - Axes.streamplot - Axes.table - Axes.text - Axes.tricontour - Axes.tricontourf + +Unstructured Triangles +~~~~~~~~~~~~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axes.tripcolor Axes.triplot - Axes.violin - Axes.violinplot - Axes.vlines - Axes.xcorr + Axes.tricontour + Axes.tricontourf + + +Text and Annotations +~~~~~~~~~~~~~~~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.annotate + Axes.text + Axes.table + Axes.arrow + + +Fields +~~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axes.barbs + Axes.quiver + Axes.quiverkey + Axes.streamplot + Clearing -------- From f893dc32f155dbf42a0655a3c479068ec8019577 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 16:30:10 -0400 Subject: [PATCH 05/14] DOC: straighten rst adornment + reorg a section --- doc/api/axes_api.rst | 89 ++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index d32d5d9f4c4c..ef535514b11f 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -12,10 +12,10 @@ Plotting --------- +======== Basic -~~~~~ +----- .. autosummary:: :toctree: _as_gen @@ -52,7 +52,7 @@ Basic Axes.fill Spans -~~~~~ +----- .. autosummary:: :toctree: _as_gen @@ -64,7 +64,7 @@ Spans Axes.axvspan Spectral -~~~~~~~~ +-------- .. autosummary:: :toctree: _as_gen @@ -81,7 +81,7 @@ Spectral Axes.xcorr Statistics -~~~~~~~~~~ +---------- .. autosummary:: :toctree: _as_gen @@ -94,7 +94,7 @@ Statistics Axes.bxp Binned -~~~~~~ +------ .. autosummary:: :toctree: _as_gen @@ -105,7 +105,7 @@ Binned Axes.hist2d Contours -~~~~~~~~ +-------- .. autosummary:: :toctree: _as_gen @@ -116,7 +116,7 @@ Contours Axes.contourf Array -~~~~~ +----- .. autosummary:: :toctree: _as_gen @@ -130,7 +130,7 @@ Array Axes.spy Unstructured Triangles -~~~~~~~~~~~~~~~~~~~~~~ +---------------------- .. autosummary:: :toctree: _as_gen @@ -143,7 +143,7 @@ Unstructured Triangles Text and Annotations -~~~~~~~~~~~~~~~~~~~~ +-------------------- .. autosummary:: :toctree: _as_gen @@ -156,7 +156,7 @@ Text and Annotations Fields -~~~~~~ +------ .. autosummary:: :toctree: _as_gen @@ -169,7 +169,7 @@ Fields Clearing --------- +======== .. autosummary:: :toctree: _as_gen @@ -181,7 +181,7 @@ Clearing Appearance ----------- +========== .. autosummary:: :toctree: _as_gen @@ -211,7 +211,7 @@ Appearance Property cycle --------------- +============== .. autosummary:: :toctree: _as_gen @@ -222,7 +222,7 @@ Property cycle Axis / limits -------------- +============= .. autosummary:: :toctree: _as_gen @@ -235,7 +235,7 @@ Axis / limits Axis Limits and direction -~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------- .. autosummary:: :toctree: _as_gen @@ -261,7 +261,7 @@ Axis Limits and direction Axes.get_xbound Axis Labels, title, and legend -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------------ .. autosummary:: :toctree: _as_gen @@ -281,7 +281,7 @@ Axis Labels, title, and legend Axis scales -~~~~~~~~~~~ +----------- .. autosummary:: :toctree: _as_gen @@ -296,7 +296,7 @@ Axis scales Autoscaling -~~~~~~~~~~~ +----------- .. autosummary:: :toctree: _as_gen @@ -319,7 +319,7 @@ Autoscaling Margins -+++++++ +~~~~~~~ .. autosummary:: :toctree: _as_gen @@ -345,7 +345,7 @@ Margins Aspect ratio -~~~~~~~~~~~~ +------------ .. autosummary:: :toctree: _as_gen @@ -360,7 +360,7 @@ Aspect ratio Ticks and tick labels -~~~~~~~~~~~~~~~~~~~~~ +--------------------- .. autosummary:: @@ -401,21 +401,9 @@ Ticks and tick labels Axes.locator_params -Internal -~~~~~~~~ -.. autosummary:: - :toctree: _as_gen - :nosignatures: - - Axes.get_xaxis_text1_transform - Axes.get_xaxis_text2_transform - Axes.get_yaxis_text1_transform - Axes.get_yaxis_text2_transform - - Units ------ +===== .. autosummary:: :toctree: _as_gen @@ -427,7 +415,7 @@ Units Adding Artists --------------- +============== .. autosummary:: :toctree: _as_gen @@ -443,7 +431,7 @@ Adding Artists Twinning --------- +======== .. autosummary:: :toctree: _as_gen @@ -457,7 +445,7 @@ Twinning Axes Position -------------- +============= .. autosummary:: :toctree: _as_gen :nosignatures: @@ -475,7 +463,7 @@ Axes Position Async/Event based ------------------ +================= .. autosummary:: :toctree: _as_gen @@ -488,7 +476,7 @@ Async/Event based Interactive ------------ +=========== .. autosummary:: :toctree: _as_gen @@ -532,7 +520,7 @@ Interactive Axes.set_cursor_props Children --------- +======== .. autosummary:: :toctree: _as_gen @@ -545,7 +533,7 @@ Children Drawing -------- +======= .. autosummary:: :toctree: _as_gen @@ -564,7 +552,7 @@ Drawing Bulk property manipulation --------------------------- +========================== .. autosummary:: :toctree: _as_gen @@ -577,7 +565,7 @@ Bulk property manipulation General Artist Properties -------------------------- +========================= .. autosummary:: :toctree: _as_gen @@ -625,7 +613,7 @@ General Artist Properties Axes.get_figure Artist Methods --------------- +============== .. autosummary:: :toctree: _as_gen @@ -637,7 +625,7 @@ Artist Methods Projection ----------- +========== Methods used by `~matplotlib.axis.Axis` that must be overridden for non-rectilinear Axes. @@ -652,9 +640,14 @@ non-rectilinear Axes. Axes.get_data_ratio Axes.get_data_ratio_log + Axes.get_xaxis_text1_transform + Axes.get_xaxis_text2_transform + Axes.get_yaxis_text1_transform + Axes.get_yaxis_text2_transform + Other ------ +===== .. autosummary:: :toctree: _as_gen @@ -670,6 +663,6 @@ Other Inheritance ------------ +=========== .. inheritance-diagram:: matplotlib.axes.Axes :private-bases: From 322c75f7de63d49a85be29fee7df86428309c030 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 19:54:24 -0400 Subject: [PATCH 06/14] DOC: patch up docstring on Artist.pick If the first line ends in '::', automsummary generates invalid rst --- lib/matplotlib/artist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 1e03c1f9a451..72192d247473 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -426,7 +426,8 @@ def pickable(self): self._picker is not None) def pick(self, mouseevent): - """ + """Process pick event + call signature:: pick(mouseevent) From ba2bd6af7006d84ac1cfdf450c747084953d24e5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 19:55:03 -0400 Subject: [PATCH 07/14] STY: PEP8 removal of whitespace --- lib/matplotlib/collections.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index 5f602151f1a6..3fcef3879469 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -655,7 +655,6 @@ def _set_facecolor(self, c): self._facecolors = mcolors.to_rgba_array(c, self._alpha) self.stale = True - def set_facecolor(self, c): """ Set the facecolor(s) of the collection. *c* can be a @@ -670,7 +669,6 @@ def set_facecolor(self, c): self._original_facecolor = c self._set_facecolor(c) - def set_facecolors(self, c): """alias for set_facecolor""" return self.set_facecolor(c) From 64dc7afdf213f0e0c7b5dc26997b33a0d60f9353 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 19:55:24 -0400 Subject: [PATCH 08/14] MNT: add auto-generated rst files to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 722a42ec6185..ddf62f3d4497 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ doc/_templates/gallery.html doc/users/installing.rst doc/_static/matplotlibrc doc/pyplots/tex_demo.png +doc/api/_as_gen lib/dateutil examples/*/*.pdf examples/*/*.png From 7b296620a1f376553dbdcfb27d66eb9df28bb9ea Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 19:55:51 -0400 Subject: [PATCH 09/14] MNT: move around methods on Axis and friends - remove identical code in YAxis and XAxis, move to Axis - add abstract methods on Axis and Tick to make documenting easier --- lib/matplotlib/axis.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 14ce5a4c0dc2..1167f4161d25 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -340,6 +340,10 @@ def _apply_params(self, **kw): v = getattr(self.label1, 'get_' + k)() setattr(self, '_label' + k, v) + def update_position(self, loc): + 'Set the location of tick in data coords with scalar *loc*' + raise NotImplementedError('Derived must override') + class XTick(Tick): """ @@ -1670,6 +1674,23 @@ def get_tick_space(self): # Must be overridden in the subclass raise NotImplementedError() + def get_label_position(self): + """ + Return the label position (top or bottom) + """ + return self.label_position + + def set_label_position(self, position): + """ + Set the label position (top or bottom) + + ACCEPTS: [ 'top' | 'bottom' ] + """ + raise NotImplementedError() + + def get_minpos(self): + raise NotImplementedError() + class XAxis(Axis): __name__ = 'xaxis' @@ -1769,12 +1790,6 @@ def _get_pixel_distance_along_axis(self, where, perturb): return dx - def get_label_position(self): - """ - Return the label position (top or bottom) - """ - return self.label_position - def set_label_position(self, position): """ Set the label position (top or bottom) @@ -2098,12 +2113,6 @@ def _get_pixel_distance_along_axis(self, where, perturb): dy = abs(ptp[1] - where) return dy - def get_label_position(self): - """ - Return the label position (left or right) - """ - return self.label_position - def set_label_position(self, position): """ Set the label position (left or right) From 9925fc209b5216c57d76b26fbde22a8bbca4bb17 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 19:59:12 -0400 Subject: [PATCH 10/14] DOC: re-arranging the Axis and Tick API docs --- doc/api/axis_api.rst | 868 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 860 insertions(+), 8 deletions(-) diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst index 426f0c873dfb..bfa1c2cb1257 100644 --- a/doc/api/axis_api.rst +++ b/doc/api/axis_api.rst @@ -1,12 +1,864 @@ -**** -axis -**** +=================== + axis and tick API +=================== +.. contents:: Table of Contents + :depth: 3 + :local: + :backlinks: entry -:mod:`matplotlib.axis` -====================== .. automodule:: matplotlib.axis - :members: - :undoc-members: - :show-inheritance: + + +``Axis`` objects +================ + +.. autoclass:: Axis +.. autoclass:: XAxis +.. autoclass:: YAxis +.. autoclass:: Ticker + + +Methods +------- + +Axis +~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axis.OFFSETTEXTPAD + Axis.axis_date + Axis.cla + Axis.convert_units + Axis.get_data_interval + Axis.get_gridlines + Axis.get_label_position + Axis.get_label_text + Axis.get_major_formatter + Axis.get_major_locator + Axis.get_major_ticks + Axis.get_majorticklabels + Axis.get_majorticklines + Axis.get_majorticklocs + Axis.get_minor_formatter + Axis.get_minor_locator + Axis.get_minor_ticks + Axis.get_minorticklabels + Axis.get_minorticklines + Axis.get_minorticklocs + Axis.get_minpos + Axis.get_offset_text + Axis.get_pickradius + Axis.get_scale + Axis.get_smart_bounds + Axis.get_tick_padding + Axis.get_tick_space + Axis.get_ticklabel_extents + Axis.get_ticklabels + Axis.get_ticklines + Axis.get_ticklocs + Axis.get_tightbbox + Axis.get_units + Axis.get_view_interval + Axis.grid + Axis.iter_ticks + Axis.limit_range_for_scale + Axis.pan + Axis.reset_ticks + Axis.set_data_interval + Axis.set_default_intervals + Axis.set_label_coords + Axis.set_label_position + Axis.set_label_text + Axis.set_major_formatter + Axis.set_major_locator + Axis.set_minor_formatter + Axis.set_minor_locator + Axis.set_pickradius + Axis.set_smart_bounds + Axis.set_tick_params + Axis.set_ticklabels + Axis.set_ticks + Axis.set_units + Axis.set_view_interval + Axis.update_units + Axis.zoom + +YAxis +~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + YAxis.axis_name + YAxis.get_text_widths + YAxis.get_ticks_position + YAxis.set_offset_position + YAxis.set_ticks_position + YAxis.tick_left + YAxis.tick_right + +XAxis +~~~~~ +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + XAxis.axis_name + XAxis.get_text_heights + XAxis.get_ticks_position + XAxis.set_ticks_position + XAxis.tick_bottom + XAxis.tick_top + + +``Tick`` objects +================ + +.. autoclass:: Tick +.. autoclass:: XTick +.. autoclass:: YTick + + +Methods +------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Tick.apply_tickdir + Tick.get_loc + Tick.get_pad + Tick.get_pad_pixels + Tick.get_tick_padding + Tick.get_tickdir + Tick.get_view_interval + Tick.set_label1 + Tick.set_label2 + Tick.set_pad + Tick.update_position + + + +Inheritance +=========== + +.. inheritance-diagram:: Tick Ticker XAxis YAxis XTick YTick + :private-bases: + +Common and inherited methods +============================ + +XTick +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + XTick.apply_tickdir + XTick.get_loc + XTick.get_pad + XTick.get_pad_pixels + XTick.get_tick_padding + XTick.get_tickdir + XTick.get_view_interval + XTick.set_label1 + XTick.set_label2 + XTick.set_pad + XTick.update_position + + + +YTick +----- + + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + YTick.apply_tickdir + YTick.get_loc + YTick.get_pad + YTick.get_pad_pixels + YTick.get_tick_padding + YTick.get_tickdir + YTick.get_view_interval + YTick.set_label1 + YTick.set_label2 + YTick.set_pad + YTick.update_position + +YAxis +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + + YAxis.OFFSETTEXTPAD + YAxis.axis_date + YAxis.cla + YAxis.convert_units + YAxis.get_data_interval + YAxis.get_gridlines + YAxis.get_label_position + YAxis.get_label_text + YAxis.get_major_formatter + YAxis.get_major_locator + YAxis.get_major_ticks + YAxis.get_majorticklabels + YAxis.get_majorticklines + YAxis.get_majorticklocs + YAxis.get_minor_formatter + YAxis.get_minor_locator + YAxis.get_minor_ticks + YAxis.get_minorticklabels + YAxis.get_minorticklines + YAxis.get_minorticklocs + YAxis.get_minpos + YAxis.get_offset_text + YAxis.get_pickradius + YAxis.get_scale + YAxis.get_smart_bounds + YAxis.get_tick_padding + YAxis.get_tick_space + YAxis.get_ticklabel_extents + YAxis.get_ticklabels + YAxis.get_ticklines + YAxis.get_ticklocs + YAxis.get_tightbbox + YAxis.get_units + YAxis.get_view_interval + YAxis.grid + YAxis.iter_ticks + YAxis.limit_range_for_scale + YAxis.pan + YAxis.reset_ticks + YAxis.set_data_interval + YAxis.set_default_intervals + YAxis.set_label_coords + YAxis.set_label_position + YAxis.set_label_text + YAxis.set_major_formatter + YAxis.set_major_locator + YAxis.set_minor_formatter + YAxis.set_minor_locator + YAxis.set_pickradius + YAxis.set_smart_bounds + YAxis.set_tick_params + YAxis.set_ticklabels + YAxis.set_ticks + YAxis.set_units + YAxis.set_view_interval + YAxis.update_units + YAxis.zoom + +YAxis +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + XAxis.OFFSETTEXTPAD + XAxis.axis_date + XAxis.cla + XAxis.convert_units + XAxis.get_data_interval + XAxis.get_gridlines + XAxis.get_label_position + XAxis.get_label_text + XAxis.get_major_formatter + XAxis.get_major_locator + XAxis.get_major_ticks + XAxis.get_majorticklabels + XAxis.get_majorticklines + XAxis.get_majorticklocs + XAxis.get_minor_formatter + XAxis.get_minor_locator + XAxis.get_minor_ticks + XAxis.get_minorticklabels + XAxis.get_minorticklines + XAxis.get_minorticklocs + XAxis.get_minpos + XAxis.get_offset_text + XAxis.get_pickradius + XAxis.get_scale + XAxis.get_smart_bounds + XAxis.get_tick_padding + XAxis.get_tick_space + XAxis.get_ticklabel_extents + XAxis.get_ticklabels + XAxis.get_ticklines + XAxis.get_ticklocs + XAxis.get_tightbbox + XAxis.get_units + XAxis.get_view_interval + XAxis.grid + XAxis.iter_ticks + XAxis.limit_range_for_scale + XAxis.pan + XAxis.reset_ticks + XAxis.set_data_interval + XAxis.set_default_intervals + XAxis.set_label_coords + XAxis.set_label_position + XAxis.set_label_text + XAxis.set_major_formatter + XAxis.set_major_locator + XAxis.set_minor_formatter + XAxis.set_minor_locator + XAxis.set_pickradius + XAxis.set_smart_bounds + XAxis.set_tick_params + XAxis.set_ticklabels + XAxis.set_ticks + XAxis.set_units + XAxis.set_view_interval + XAxis.update_units + XAxis.zoom + + + +Inherited from artist +--------------------- + +Ticks +~~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Tick.add_callback + Tick.aname + Tick.axes + Tick.bottom_margin + Tick.contains + Tick.convert_xunits + Tick.convert_yunits + Tick.draw + Tick.findobj + Tick.format_cursor_data + Tick.get_agg_filter + Tick.get_alpha + Tick.get_animated + Tick.get_axes + Tick.get_bottom_margin + Tick.get_children + Tick.get_clip_box + Tick.get_clip_on + Tick.get_clip_path + Tick.get_contains + Tick.get_cursor_data + Tick.get_figure + Tick.get_gid + Tick.get_label + Tick.get_left_margin + Tick.get_margins + Tick.get_path_effects + Tick.get_picker + Tick.get_rasterized + Tick.get_right_margin + Tick.get_sketch_params + Tick.get_snap + Tick.get_top_margin + Tick.get_transform + Tick.get_transformed_clip_path_and_affine + Tick.get_url + Tick.get_visible + Tick.get_window_extent + Tick.get_zorder + Tick.have_units + Tick.hitlist + Tick.is_figure_set + Tick.is_transform_set + Tick.left_margin + Tick.margins + Tick.mouseover + Tick.pchanged + Tick.pick + Tick.pickable + Tick.properties + Tick.remove + Tick.remove_callback + Tick.right_margin + Tick.set + Tick.set_agg_filter + Tick.set_alpha + Tick.set_animated + Tick.set_axes + Tick.set_bottom_margin + Tick.set_clip_box + Tick.set_clip_on + Tick.set_clip_path + Tick.set_contains + Tick.set_figure + Tick.set_gid + Tick.set_label + Tick.set_left_margin + Tick.set_margins + Tick.set_path_effects + Tick.set_picker + Tick.set_rasterized + Tick.set_right_margin + Tick.set_sketch_params + Tick.set_snap + Tick.set_top_margin + Tick.set_transform + Tick.set_url + Tick.set_visible + Tick.set_zorder + Tick.stale + Tick.top_margin + Tick.update + Tick.update_from + Tick.zorder + + XTick.add_callback + XTick.aname + XTick.axes + XTick.bottom_margin + XTick.contains + XTick.convert_xunits + XTick.convert_yunits + XTick.draw + XTick.findobj + XTick.format_cursor_data + XTick.get_agg_filter + XTick.get_alpha + XTick.get_animated + XTick.get_axes + XTick.get_bottom_margin + XTick.get_children + XTick.get_clip_box + XTick.get_clip_on + XTick.get_clip_path + XTick.get_contains + XTick.get_cursor_data + XTick.get_figure + XTick.get_gid + XTick.get_label + XTick.get_left_margin + XTick.get_margins + XTick.get_path_effects + XTick.get_picker + XTick.get_rasterized + XTick.get_right_margin + XTick.get_sketch_params + XTick.get_snap + XTick.get_top_margin + XTick.get_transform + XTick.get_transformed_clip_path_and_affine + XTick.get_url + XTick.get_visible + XTick.get_window_extent + XTick.get_zorder + XTick.have_units + XTick.hitlist + XTick.is_figure_set + XTick.is_transform_set + XTick.left_margin + XTick.margins + XTick.mouseover + XTick.pchanged + XTick.pick + XTick.pickable + XTick.properties + XTick.remove + XTick.remove_callback + XTick.right_margin + XTick.set + XTick.set_agg_filter + XTick.set_alpha + XTick.set_animated + XTick.set_axes + XTick.set_bottom_margin + XTick.set_clip_box + XTick.set_clip_on + XTick.set_clip_path + XTick.set_contains + XTick.set_figure + XTick.set_gid + XTick.set_label + XTick.set_left_margin + XTick.set_margins + XTick.set_path_effects + XTick.set_picker + XTick.set_rasterized + XTick.set_right_margin + XTick.set_sketch_params + XTick.set_snap + XTick.set_top_margin + XTick.set_transform + XTick.set_url + XTick.set_visible + XTick.set_zorder + XTick.stale + XTick.top_margin + XTick.update + XTick.update_from + XTick.zorder + + YTick.add_callback + YTick.aname + YTick.axes + YTick.bottom_margin + YTick.contains + YTick.convert_xunits + YTick.convert_yunits + YTick.draw + YTick.findobj + YTick.format_cursor_data + YTick.get_agg_filter + YTick.get_alpha + YTick.get_animated + YTick.get_axes + YTick.get_bottom_margin + YTick.get_children + YTick.get_clip_box + YTick.get_clip_on + YTick.get_clip_path + YTick.get_contains + YTick.get_cursor_data + YTick.get_figure + YTick.get_gid + YTick.get_label + YTick.get_left_margin + YTick.get_margins + YTick.get_path_effects + YTick.get_picker + YTick.get_rasterized + YTick.get_right_margin + YTick.get_sketch_params + YTick.get_snap + YTick.get_top_margin + YTick.get_transform + YTick.get_transformed_clip_path_and_affine + YTick.get_url + YTick.get_visible + YTick.get_window_extent + YTick.get_zorder + YTick.have_units + YTick.hitlist + YTick.is_figure_set + YTick.is_transform_set + YTick.left_margin + YTick.margins + YTick.mouseover + YTick.pchanged + YTick.pick + YTick.pickable + YTick.properties + YTick.remove + YTick.remove_callback + YTick.right_margin + YTick.set + YTick.set_agg_filter + YTick.set_alpha + YTick.set_animated + YTick.set_axes + YTick.set_bottom_margin + YTick.set_clip_box + YTick.set_clip_on + YTick.set_clip_path + YTick.set_contains + YTick.set_figure + YTick.set_gid + YTick.set_label + YTick.set_left_margin + YTick.set_margins + YTick.set_path_effects + YTick.set_picker + YTick.set_rasterized + YTick.set_right_margin + YTick.set_sketch_params + YTick.set_snap + YTick.set_top_margin + YTick.set_transform + YTick.set_url + YTick.set_visible + YTick.set_zorder + YTick.stale + YTick.top_margin + YTick.update + YTick.update_from + YTick.zorder + + +Axis +~~~~ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axis.add_callback + Axis.aname + Axis.axes + Axis.bottom_margin + Axis.contains + Axis.convert_xunits + Axis.convert_yunits + Axis.draw + Axis.findobj + Axis.format_cursor_data + Axis.get_agg_filter + Axis.get_alpha + Axis.get_animated + Axis.get_axes + Axis.get_bottom_margin + Axis.get_children + Axis.get_clip_box + Axis.get_clip_on + Axis.get_clip_path + Axis.get_contains + Axis.get_cursor_data + Axis.get_figure + Axis.get_gid + Axis.get_label + Axis.get_left_margin + Axis.get_margins + Axis.get_path_effects + Axis.get_picker + Axis.get_rasterized + Axis.get_right_margin + Axis.get_sketch_params + Axis.get_snap + Axis.get_top_margin + Axis.get_transform + Axis.get_transformed_clip_path_and_affine + Axis.get_url + Axis.get_visible + Axis.get_window_extent + Axis.get_zorder + Axis.have_units + Axis.hitlist + Axis.is_figure_set + Axis.is_transform_set + Axis.left_margin + Axis.margins + Axis.mouseover + Axis.pchanged + Axis.pick + Axis.pickable + Axis.properties + Axis.remove + Axis.remove_callback + Axis.right_margin + Axis.set + Axis.set_agg_filter + Axis.set_alpha + Axis.set_animated + Axis.set_axes + Axis.set_bottom_margin + Axis.set_clip_box + Axis.set_clip_on + Axis.set_clip_path + Axis.set_contains + Axis.set_figure + Axis.set_gid + Axis.set_label + Axis.set_left_margin + Axis.set_margins + Axis.set_path_effects + Axis.set_picker + Axis.set_rasterized + Axis.set_right_margin + Axis.set_sketch_params + Axis.set_snap + Axis.set_top_margin + Axis.set_transform + Axis.set_url + Axis.set_visible + Axis.set_zorder + Axis.stale + Axis.top_margin + Axis.update + Axis.update_from + Axis.zorder + + XAxis.add_callback + XAxis.aname + XAxis.axes + XAxis.bottom_margin + XAxis.contains + XAxis.convert_xunits + XAxis.convert_yunits + XAxis.draw + XAxis.findobj + XAxis.format_cursor_data + XAxis.get_agg_filter + XAxis.get_alpha + XAxis.get_animated + XAxis.get_axes + XAxis.get_bottom_margin + XAxis.get_children + XAxis.get_clip_box + XAxis.get_clip_on + XAxis.get_clip_path + XAxis.get_contains + XAxis.get_cursor_data + XAxis.get_figure + XAxis.get_gid + XAxis.get_label + XAxis.get_left_margin + XAxis.get_margins + XAxis.get_path_effects + XAxis.get_picker + XAxis.get_rasterized + XAxis.get_right_margin + XAxis.get_sketch_params + XAxis.get_snap + XAxis.get_top_margin + XAxis.get_transform + XAxis.get_transformed_clip_path_and_affine + XAxis.get_url + XAxis.get_visible + XAxis.get_window_extent + XAxis.get_zorder + XAxis.have_units + XAxis.hitlist + XAxis.is_figure_set + XAxis.is_transform_set + XAxis.left_margin + XAxis.margins + XAxis.mouseover + XAxis.pchanged + XAxis.pick + XAxis.pickable + XAxis.properties + XAxis.remove + XAxis.remove_callback + XAxis.right_margin + XAxis.set + XAxis.set_agg_filter + XAxis.set_alpha + XAxis.set_animated + XAxis.set_axes + XAxis.set_bottom_margin + XAxis.set_clip_box + XAxis.set_clip_on + XAxis.set_clip_path + XAxis.set_contains + XAxis.set_figure + XAxis.set_gid + XAxis.set_label + XAxis.set_left_margin + XAxis.set_margins + XAxis.set_path_effects + XAxis.set_picker + XAxis.set_rasterized + XAxis.set_right_margin + XAxis.set_sketch_params + XAxis.set_snap + XAxis.set_top_margin + XAxis.set_transform + XAxis.set_url + XAxis.set_visible + XAxis.set_zorder + XAxis.stale + XAxis.top_margin + XAxis.update + XAxis.update_from + XAxis.zorder + + YAxis.add_callback + YAxis.aname + YAxis.axes + YAxis.bottom_margin + YAxis.contains + YAxis.convert_xunits + YAxis.convert_yunits + YAxis.draw + YAxis.findobj + YAxis.format_cursor_data + YAxis.get_agg_filter + YAxis.get_alpha + YAxis.get_animated + YAxis.get_axes + YAxis.get_bottom_margin + YAxis.get_children + YAxis.get_clip_box + YAxis.get_clip_on + YAxis.get_clip_path + YAxis.get_contains + YAxis.get_cursor_data + YAxis.get_figure + YAxis.get_gid + YAxis.get_label + YAxis.get_left_margin + YAxis.get_margins + YAxis.get_path_effects + YAxis.get_picker + YAxis.get_rasterized + YAxis.get_right_margin + YAxis.get_sketch_params + YAxis.get_snap + YAxis.get_top_margin + YAxis.get_transform + YAxis.get_transformed_clip_path_and_affine + YAxis.get_url + YAxis.get_visible + YAxis.get_window_extent + YAxis.get_zorder + YAxis.have_units + YAxis.hitlist + YAxis.is_figure_set + YAxis.is_transform_set + YAxis.left_margin + YAxis.margins + YAxis.mouseover + YAxis.pchanged + YAxis.pick + YAxis.pickable + YAxis.properties + YAxis.remove + YAxis.remove_callback + YAxis.right_margin + YAxis.set + YAxis.set_agg_filter + YAxis.set_alpha + YAxis.set_animated + YAxis.set_axes + YAxis.set_bottom_margin + YAxis.set_clip_box + YAxis.set_clip_on + YAxis.set_clip_path + YAxis.set_contains + YAxis.set_figure + YAxis.set_gid + YAxis.set_label + YAxis.set_left_margin + YAxis.set_margins + YAxis.set_path_effects + YAxis.set_picker + YAxis.set_rasterized + YAxis.set_right_margin + YAxis.set_sketch_params + YAxis.set_snap + YAxis.set_top_margin + YAxis.set_transform + YAxis.set_url + YAxis.set_visible + YAxis.set_zorder + YAxis.stale + YAxis.top_margin + YAxis.update + YAxis.update_from + YAxis.zorder From 650b64096ccbbbdb614a1d9e45dfa4f51b2fc8ad Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 21:41:56 -0400 Subject: [PATCH 11/14] DOC: numpydocify Axes.tick_params --- lib/matplotlib/axes/_base.py | 46 +++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index fbeba7dcc763..ce216d87d56c 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2617,58 +2617,66 @@ def locator_params(self, axis='both', tight=None, **kwargs): self.autoscale_view(tight=tight, scalex=_x, scaley=_y) def tick_params(self, axis='both', **kwargs): - """ - Change the appearance of ticks and tick labels. + """Change the appearance of ticks and tick labels. - Keyword arguments: + Parameters + ---------- + axis : {'x', 'y', 'both'}, optional + Which axis to apply the parameters to. - *axis* : ['x' | 'y' | 'both'] + Other Parameters + ---------------- + + axis : {'x', 'y', 'both'} Axis on which to operate; default is 'both'. - *reset* : [True | False] + reset : bool If *True*, set all parameters to defaults before processing other keyword arguments. Default is *False*. - *which* : ['major' | 'minor' | 'both'] + which : {'major', 'minor', 'both'} Default is 'major'; apply arguments to *which* ticks. - *direction* : ['in' | 'out' | 'inout'] + direction : {'in', 'out', 'inout'} Puts ticks inside the axes, outside the axes, or both. - *length* + length : float Tick length in points. - *width* + width : float Tick width in points. - *color* + color : color Tick color; accepts any mpl color spec. - *pad* + pad : float Distance in points between tick and label. - *labelsize* + labelsize : float or str Tick label font size in points or as a string (e.g., 'large'). - *labelcolor* + labelcolor : color Tick label color; mpl color spec. - *colors* + colors : color Changes the tick color and the label color to the same value: mpl color spec. - *zorder* + zorder : float Tick and label zorder. - *bottom*, *top*, *left*, *right* : [bool | 'on' | 'off'] + bottom, top, left, right : bool or {'on', 'off'} controls whether to draw the respective ticks. - *labelbottom*, *labeltop*, *labelleft*, *labelright* - Boolean or ['on' | 'off'], controls whether to draw the + labelbottom, labeltop, labelleft, labelright : bool or {'on', 'off'} + controls whether to draw the respective tick labels. - Example:: + Examples + -------- + + Usage :: ax.tick_params(direction='out', length=6, width=2, colors='r') From cbb8e7d4e55236e16d0ee1f8d93cdc9e34077deb Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 22:08:03 -0400 Subject: [PATCH 12/14] DOC: more section reorganization in axis docs --- doc/api/axis_api.rst | 206 +++++++++++++++++++++++++++++++------------ 1 file changed, 148 insertions(+), 58 deletions(-) diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst index bfa1c2cb1257..287fa94fa015 100644 --- a/doc/api/axis_api.rst +++ b/doc/api/axis_api.rst @@ -7,9 +7,14 @@ :local: :backlinks: entry - .. automodule:: matplotlib.axis +Inheritance +=========== + +.. inheritance-diagram:: Tick Ticker XAxis YAxis XTick YTick + :private-bases: + ``Axis`` objects ================ @@ -20,77 +25,139 @@ .. autoclass:: Ticker -Methods -------- +.. autosummary:: + :toctree: _as_gen + :nosignatures: -Axis -~~~~ + Axis.cla + Axis.get_scale + + +Formatters and Locators +----------------------- .. autosummary:: :toctree: _as_gen :nosignatures: + Axis.get_major_formatter + Axis.get_major_locator + Axis.get_minor_formatter + Axis.get_minor_locator + Axis.set_major_formatter + Axis.set_major_locator + Axis.set_minor_formatter + Axis.set_minor_locator - Axis.OFFSETTEXTPAD - Axis.axis_date - Axis.cla - Axis.convert_units - Axis.get_data_interval - Axis.get_gridlines + +Axis Label +---------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.set_label_coords + Axis.set_label_position + Axis.set_label_text Axis.get_label_position Axis.get_label_text - Axis.get_major_formatter - Axis.get_major_locator + +Ticks, tick labels and Offset text +---------------------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + Axis.get_major_ticks Axis.get_majorticklabels Axis.get_majorticklines Axis.get_majorticklocs - Axis.get_minor_formatter - Axis.get_minor_locator Axis.get_minor_ticks Axis.get_minorticklabels Axis.get_minorticklines Axis.get_minorticklocs - Axis.get_minpos + Axis.get_offset_text - Axis.get_pickradius - Axis.get_scale - Axis.get_smart_bounds + Axis.get_tick_padding - Axis.get_tick_space - Axis.get_ticklabel_extents Axis.get_ticklabels Axis.get_ticklines Axis.get_ticklocs - Axis.get_tightbbox - Axis.get_units - Axis.get_view_interval + + Axis.get_gridlines Axis.grid + Axis.iter_ticks - Axis.limit_range_for_scale - Axis.pan - Axis.reset_ticks + Axis.set_tick_params + + Axis.axis_date + + +Data and view internvals +------------------------ + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.get_data_interval + Axis.get_view_interval Axis.set_data_interval - Axis.set_default_intervals - Axis.set_label_coords - Axis.set_label_position - Axis.set_label_text - Axis.set_major_formatter - Axis.set_major_locator - Axis.set_minor_formatter - Axis.set_minor_locator + Axis.set_view_interval + +Rendering helpers +----------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.get_minpos + Axis.get_tick_space + Axis.get_ticklabel_extents + Axis.get_tightbbox + + +Interactive +----------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axis.get_pickradius Axis.set_pickradius - Axis.set_smart_bounds - Axis.set_tick_params - Axis.set_ticklabels - Axis.set_ticks + + +Units +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.convert_units Axis.set_units - Axis.set_view_interval + Axis.get_units Axis.update_units + + +Incremental navigation +---------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.pan Axis.zoom -YAxis -~~~~~ + +YAxis Specific +-------------- .. autosummary:: :toctree: _as_gen @@ -104,8 +171,9 @@ YAxis YAxis.tick_left YAxis.tick_right -XAxis -~~~~~ + +XAxis Specific +-------------- .. autosummary:: :toctree: _as_gen :nosignatures: @@ -118,6 +186,38 @@ XAxis XAxis.tick_top +Other +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + + Axis.OFFSETTEXTPAD + + Axis.limit_range_for_scale + Axis.reset_ticks + Axis.set_default_intervals + Axis.get_smart_bounds + Axis.set_smart_bounds + +Discouraged +----------- + +These methods implicitly use `~matplotlib.ticker.FixedLocator` and +`~matplotlib.ticker.FixedFormatter`. They can be convenient, but if +not used together may de-couple your tick labels from your data. + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Axis.set_ticklabels + Axis.set_ticks + + + ``Tick`` objects ================ @@ -126,9 +226,6 @@ XAxis .. autoclass:: YTick -Methods -------- - .. autosummary:: :toctree: _as_gen :nosignatures: @@ -147,18 +244,11 @@ Methods Tick.update_position - -Inheritance -=========== - -.. inheritance-diagram:: Tick Ticker XAxis YAxis XTick YTick - :private-bases: - Common and inherited methods ============================ -XTick ------ +``XTick`` +--------- .. autosummary:: :toctree: _as_gen @@ -265,8 +355,8 @@ YAxis YAxis.update_units YAxis.zoom -YAxis ------ +``YAxis`` +--------- .. autosummary:: :toctree: _as_gen From f5d884820485ef6bd86794cf0f6d2a4d3bff705a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 25 Sep 2016 22:58:21 -0400 Subject: [PATCH 13/14] DOC: change inheritance diagram to get all Artists There is probably a better way to get this, but this is effective. Code used to generate this list: def _recursive_subclasses(cls): "Return all subclasses (and their subclasses, etc.)." # Source: http://stackoverflow.com/a/3862957/1221924 return (cls.__subclasses__() + [g for s in cls.__subclasses__() for g in _recursive_subclasses(s)]) ' '.join(sorted(['.'.join((_.__module__, _.__name__)) for _ in _recursive_subclasses(matplotlib.artist.Artist)])) --- doc/api/artist_api.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index eff8d5497b31..2fd0af7f6038 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -1,11 +1,11 @@ .. _artist-api: ******* -artists +Artists ******* -.. inheritance-diagram:: matplotlib.patches matplotlib.lines matplotlib.text matplotlib.offsetbox matplotlib.image - :parts: 2 +.. inheritance-diagram:: matplotlib.axes._axes.Axes matplotlib.axes._base._AxesBase matplotlib.axis.Axis matplotlib.axis.Tick matplotlib.axis.XAxis matplotlib.axis.XTick matplotlib.axis.YAxis matplotlib.axis.YTick matplotlib.collections.AsteriskPolygonCollection matplotlib.collections.BrokenBarHCollection matplotlib.collections.CircleCollection matplotlib.collections.Collection matplotlib.collections.EllipseCollection matplotlib.collections.EventCollection matplotlib.collections.LineCollection matplotlib.collections.PatchCollection matplotlib.collections.PathCollection matplotlib.collections.PolyCollection matplotlib.collections.QuadMesh matplotlib.collections.RegularPolyCollection matplotlib.collections.StarPolygonCollection matplotlib.collections.TriMesh matplotlib.collections._CollectionWithSizes matplotlib.contour.ClabelText matplotlib.figure.Figure matplotlib.image.AxesImage matplotlib.image.BboxImage matplotlib.image.FigureImage matplotlib.image.NonUniformImage matplotlib.image.PcolorImage matplotlib.image._ImageBase matplotlib.legend.Legend matplotlib.lines.Line2D matplotlib.offsetbox.AnchoredOffsetbox matplotlib.offsetbox.AnchoredText matplotlib.offsetbox.AnnotationBbox matplotlib.offsetbox.AuxTransformBox matplotlib.offsetbox.DrawingArea matplotlib.offsetbox.HPacker matplotlib.offsetbox.OffsetBox matplotlib.offsetbox.OffsetImage matplotlib.offsetbox.PackerBase matplotlib.offsetbox.PaddedBox matplotlib.offsetbox.TextArea matplotlib.offsetbox.VPacker matplotlib.patches.Arc matplotlib.patches.Arrow matplotlib.patches.Circle matplotlib.patches.CirclePolygon matplotlib.patches.ConnectionPatch matplotlib.patches.Ellipse matplotlib.patches.FancyArrow matplotlib.patches.FancyArrowPatch matplotlib.patches.FancyBboxPatch matplotlib.patches.Patch matplotlib.patches.PathPatch matplotlib.patches.Polygon matplotlib.patches.Rectangle matplotlib.patches.RegularPolygon matplotlib.patches.Shadow matplotlib.patches.Wedge matplotlib.patches.YAArrow matplotlib.projections.geo.AitoffAxes matplotlib.projections.geo.GeoAxes matplotlib.projections.geo.HammerAxes matplotlib.projections.geo.LambertAxes matplotlib.projections.geo.MollweideAxes matplotlib.projections.polar.PolarAxes matplotlib.quiver.Barbs matplotlib.quiver.Quiver matplotlib.quiver.QuiverKey matplotlib.spines.Spine matplotlib.table.Cell matplotlib.table.CustomCell matplotlib.table.Table matplotlib.text.Annotation matplotlib.text.Text matplotlib.text.TextWithDash + :parts: 1 :private-bases: :mod:`matplotlib.artist` From 58b4dbdc3def697e6a41d18ba669be329a5239d8 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 26 Sep 2016 00:06:35 -0400 Subject: [PATCH 14/14] DOC: use auto-summary in artist api docs --- doc/api/artist_api.rst | 215 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 207 insertions(+), 8 deletions(-) diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index 2fd0af7f6038..a146df58c9f8 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -1,17 +1,216 @@ .. _artist-api: -******* -Artists -******* +=================== + ``artist`` Module +=================== .. inheritance-diagram:: matplotlib.axes._axes.Axes matplotlib.axes._base._AxesBase matplotlib.axis.Axis matplotlib.axis.Tick matplotlib.axis.XAxis matplotlib.axis.XTick matplotlib.axis.YAxis matplotlib.axis.YTick matplotlib.collections.AsteriskPolygonCollection matplotlib.collections.BrokenBarHCollection matplotlib.collections.CircleCollection matplotlib.collections.Collection matplotlib.collections.EllipseCollection matplotlib.collections.EventCollection matplotlib.collections.LineCollection matplotlib.collections.PatchCollection matplotlib.collections.PathCollection matplotlib.collections.PolyCollection matplotlib.collections.QuadMesh matplotlib.collections.RegularPolyCollection matplotlib.collections.StarPolygonCollection matplotlib.collections.TriMesh matplotlib.collections._CollectionWithSizes matplotlib.contour.ClabelText matplotlib.figure.Figure matplotlib.image.AxesImage matplotlib.image.BboxImage matplotlib.image.FigureImage matplotlib.image.NonUniformImage matplotlib.image.PcolorImage matplotlib.image._ImageBase matplotlib.legend.Legend matplotlib.lines.Line2D matplotlib.offsetbox.AnchoredOffsetbox matplotlib.offsetbox.AnchoredText matplotlib.offsetbox.AnnotationBbox matplotlib.offsetbox.AuxTransformBox matplotlib.offsetbox.DrawingArea matplotlib.offsetbox.HPacker matplotlib.offsetbox.OffsetBox matplotlib.offsetbox.OffsetImage matplotlib.offsetbox.PackerBase matplotlib.offsetbox.PaddedBox matplotlib.offsetbox.TextArea matplotlib.offsetbox.VPacker matplotlib.patches.Arc matplotlib.patches.Arrow matplotlib.patches.Circle matplotlib.patches.CirclePolygon matplotlib.patches.ConnectionPatch matplotlib.patches.Ellipse matplotlib.patches.FancyArrow matplotlib.patches.FancyArrowPatch matplotlib.patches.FancyBboxPatch matplotlib.patches.Patch matplotlib.patches.PathPatch matplotlib.patches.Polygon matplotlib.patches.Rectangle matplotlib.patches.RegularPolygon matplotlib.patches.Shadow matplotlib.patches.Wedge matplotlib.patches.YAArrow matplotlib.projections.geo.AitoffAxes matplotlib.projections.geo.GeoAxes matplotlib.projections.geo.HammerAxes matplotlib.projections.geo.LambertAxes matplotlib.projections.geo.MollweideAxes matplotlib.projections.polar.PolarAxes matplotlib.quiver.Barbs matplotlib.quiver.Quiver matplotlib.quiver.QuiverKey matplotlib.spines.Spine matplotlib.table.Cell matplotlib.table.CustomCell matplotlib.table.Table matplotlib.text.Annotation matplotlib.text.Text matplotlib.text.TextWithDash :parts: 1 :private-bases: -:mod:`matplotlib.artist` -======================== + .. automodule:: matplotlib.artist - :members: - :undoc-members: - :show-inheritance: + + +``Artist`` class +================ + + +Interactive +----------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.add_callback + Artist.format_cursor_data + Artist.get_contains + Artist.get_cursor_data + Artist.get_picker + Artist.hitlist + Artist.mouseover + Artist.pchanged + Artist.pick + Artist.pickable + Artist.remove_callback + Artist.set_contains + Artist.set_picker + Artist.contains + + +Margins and Autoscaling +----------------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.get_bottom_margin + Artist.get_left_margin + Artist.get_margins + Artist.get_top_margin + Artist.margins + Artist.left_margin + Artist.get_right_margin + Artist.bottom_margin + Artist.right_margin + Artist.set_bottom_margin + Artist.set_left_margin + Artist.set_margins + Artist.set_right_margin + Artist.set_top_margin + Artist.top_margin + +Clipping +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.get_clip_box + Artist.get_clip_on + Artist.get_clip_path + Artist.set_clip_box + Artist.set_clip_on + Artist.set_clip_path + +Bulk Properties +--------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.update + Artist.update_from + Artist.properties + Artist.set + + +Drawing +------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.draw + Artist.get_animated + Artist.set_animated + + Artist.get_agg_filter + + Artist.get_alpha + Artist.get_snap + Artist.get_visible + Artist.get_zorder + Artist.set_agg_filter + Artist.set_alpha + + Artist.set_sketch_params + Artist.set_snap + Artist.get_rasterized + Artist.get_sketch_params + Artist.set_path_effects + Artist.set_rasterized + Artist.zorder + Artist.set_visible + Artist.set_zorder + Artist.get_window_extent + Artist.get_path_effects + Artist.get_transformed_clip_path_and_affine + + + +Figure and Axes +--------------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.remove + + Artist.axes + Artist.get_axes + Artist.set_axes + + Artist.set_figure + Artist.get_figure + Artist.is_figure_set + +Children +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.get_children + Artist.findobj + + +Transform +--------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.set_transform + Artist.get_transform + Artist.is_transform_set + + + +Units +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.convert_xunits + Artist.convert_yunits + Artist.have_units + +Metadata +-------- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.get_gid + Artist.get_label + Artist.set_gid + Artist.set_label + Artist.get_url + Artist.set_url + Artist.aname + +Stale +----- + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + Artist.stale + +Functions +========= + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + allow_rasterization + get + getp + setp + kwdoc + ArtistInspector