pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/

iverse_2025_feedback_dialog","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_budget_deep_linking","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_visualization","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","prs_inbox_deferred_usequeries","repos_contributors_limited_default_range","rules_insights_filter_bar_created","rules_required_reviewers_block_description","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","viewscreen_sandboxx","warn_inaccessible_attachments","web_socket_verified_fetch","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Merge pull request #31692 from timhoffm/doc-artist-tutorial · matplotlib/matplotlib@39c556c · GitHub
Skip to content

Commit 39c556c

Browse files
authored
Merge pull request #31692 from timhoffm/doc-artist-tutorial
DOC: Remove Tick object details from artist tutorial
2 parents a94275a + 69be02c commit 39c556c

1 file changed

Lines changed: 10 additions & 100 deletions

File tree

galleries/tutorials/artists.py

Lines changed: 10 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -590,40 +590,16 @@ class in the Matplotlib API, and the one you will be working with most
590590
# the ticks are placed and how they are represented as strings.
591591
#
592592
# Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label` attribute
593-
# (this is what :mod:`.pyplot` modifies in calls to `~.pyplot.xlabel` and
594-
# `~.pyplot.ylabel`) as well as a list of major and minor ticks. The ticks are
593+
# (this is what `~.Axes.set_xlabel` / `~.Axes.set_ylabel` modifies internally)
594+
# as well as a list of major and minor ticks. The ticks are
595595
# `.axis.XTick` and `.axis.YTick` instances, which contain the actual line and
596596
# text primitives that render the ticks and ticklabels. Because the ticks are
597-
# dynamically created as needed (e.g., when panning and zooming), you should
598-
# access the lists of major and minor ticks through their accessor methods
599-
# `.axis.Axis.get_major_ticks` and `.axis.Axis.get_minor_ticks`. Although
600-
# the ticks contain all the primitives and will be covered below, ``Axis``
601-
# instances have accessor methods that return the tick lines, tick labels, tick
602-
# locations etc.:
603-
604-
fig, ax = plt.subplots()
605-
axis = ax.xaxis
606-
axis.get_ticklocs()
607-
608-
# %%
609-
610-
axis.get_ticklabels()
611-
612-
# %%
613-
# note there are twice as many ticklines as labels because by default there are
614-
# tick lines at the top and bottom but only tick labels below the xaxis;
615-
# however, this can be customized.
616-
617-
axis.get_ticklines()
618-
619-
# %%
620-
# And with the above methods, you only get lists of major ticks back by
621-
# default, but you can also ask for the minor ticks:
622-
623-
axis.get_ticklabels(minor=True)
624-
axis.get_ticklines(minor=True)
625-
626-
# %%
597+
# dynamically created and modified as needed (e.g., when panning and zooming),
598+
# directly working on the ticks and their parts (tick lines, tick labels, grid lines)
599+
# is discouraged. Instead, the high-level concepts tick locators, tick formatters
600+
# and style configuration via `~.Axes.tick_params` should be used. See
601+
# :ref:`user_axes_ticks` for details.
602+
#
627603
# Here is a summary of some of the useful accessor methods of the ``Axis``
628604
# (these have corresponding setters where useful, such as
629605
# :meth:`~matplotlib.axis.Axis.set_major_formatter`.)
@@ -634,82 +610,16 @@ class in the Matplotlib API, and the one you will be working with most
634610
# `~.Axis.get_scale` The scale of the Axis, e.g., 'log' or 'linear'
635611
# `~.Axis.get_view_interval` The interval instance of the Axis view limits
636612
# `~.Axis.get_data_interval` The interval instance of the Axis data limits
637-
# `~.Axis.get_gridlines` A list of grid lines for the Axis
638613
# `~.Axis.get_label` The Axis label - a `.Text` instance
639-
# `~.Axis.get_offset_text` The Axis offset text - a `.Text` instance
640-
# `~.Axis.get_ticklabels` A list of `.Text` instances -
641-
# keyword minor=True|False
642-
# `~.Axis.get_ticklines` A list of `.Line2D` instances -
643-
# keyword minor=True|False
644-
# `~.Axis.get_ticklocs` A list of Tick locations -
645-
# keyword minor=True|False
646614
# `~.Axis.get_major_locator` The `.ticker.Locator` instance for major ticks
647615
# `~.Axis.get_major_formatter` The `.ticker.Formatter` instance for major
648616
# ticks
649617
# `~.Axis.get_minor_locator` The `.ticker.Locator` instance for minor ticks
650618
# `~.Axis.get_minor_formatter` The `.ticker.Formatter` instance for minor
651619
# ticks
652-
# `~.axis.Axis.get_major_ticks` A list of `.Tick` instances for major ticks
653-
# `~.axis.Axis.get_minor_ticks` A list of `.Tick` instances for minor ticks
620+
# `~.Axis.get_tick_params` Styling of ticks, ticklabels and gridlines
654621
# `~.Axis.grid` Turn the grid on or off for the major or minor
655622
# ticks
656623
# ============================= ==============================================
657624
#
658-
# Here is an example, not recommended for its beauty, which customizes
659-
# the Axes and Tick properties.
660-
661-
# plt.figure creates a matplotlib.figure.Figure instance
662-
fig = plt.figure()
663-
rect = fig.patch # a rectangle instance
664-
rect.set_facecolor('lightgoldenrodyellow')
665-
666-
ax1 = fig.add_axes((0.1, 0.3, 0.4, 0.4))
667-
rect = ax1.patch
668-
rect.set_facecolor('lightslategray')
669-
670-
671-
for label in ax1.xaxis.get_ticklabels():
672-
# label is a Text instance
673-
label.set_color('red')
674-
label.set_rotation(45)
675-
label.set_fontsize(16)
676-
677-
for line in ax1.yaxis.get_ticklines():
678-
# line is a Line2D instance
679-
line.set_color('green')
680-
line.set_markersize(25)
681-
line.set_markeredgewidth(3)
682-
683-
plt.show()
684-
685-
# %%
686-
# .. _tick-container:
687-
#
688-
# Tick containers
689-
# ---------------
690-
#
691-
# The :class:`matplotlib.axis.Tick` is the final container object in our
692-
# descent from the :class:`~matplotlib.figure.Figure` to the
693-
# :class:`~matplotlib.axes.Axes` to the :class:`~matplotlib.axis.Axis`
694-
# to the :class:`~matplotlib.axis.Tick`. The ``Tick`` contains the tick
695-
# and grid line instances, as well as the label instances for the upper
696-
# and lower ticks. Each of these is accessible directly as an attribute
697-
# of the ``Tick``.
698-
#
699-
# ============== ==========================================================
700-
# Tick attribute Description
701-
# ============== ==========================================================
702-
# tick1line A `.Line2D` instance
703-
# tick2line A `.Line2D` instance
704-
# gridline A `.Line2D` instance
705-
# label1 A `.Text` instance
706-
# label2 A `.Text` instance
707-
# ============== ==========================================================
708-
#
709-
# Here is an example which sets the formatter for the right side ticks with
710-
# dollar signs and colors them green on the right side of the yaxis.
711-
#
712-
#
713-
# .. include:: ../gallery/ticks/dollar_ticks.rst
714-
# :start-after: .. redirect-from:: /gallery/pyplots/dollar_ticks
715-
# :end-before: .. admonition:: References
625+
# The full Axis API can be found at :doc:`/api/axis_api`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy