Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: Controlling top, bottom, left, and right tick parameters independently of one another #11837

Closed as not planned
Labels
New featurestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action
@ghost

Description

matplotlib.axes.Axes.tick_params allows one to control the direction which the ticks along the x and y axes point. Currently this can either be set toin orout which is very useful, but sometimes I want to create a plot that has ticks along the bottom pointing out and ticks along the top pointing in and I was unable to find an easy solution to accomplish this astick_params for top and bottom are both tied to the x-axis. I am currently able to accomplish what I want by using andax.twiny():

fig, ax = plt.subplots()majorLocator = AutoLocator()minorLocator = AutoMinorLocator()ax_top = ax.twiny()ax_top.tick_params(which='both', direction='in')ax_top.set_xlim(ax.get_xlim())ax.xaxis.set_minor_locator(minorLocator)ax.xaxis.set_major_locator(majorLocator)ax_top.xaxis.set_minor_locator(minorLocator)ax_top.xaxis.set_major_locator(majorLocator)ax_top.get_shared_x_axes().join(ax_top, ax)ax_top.set_xticklabels([])

unknown
but this seems like a messy solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    New featurestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp