Skip to content

Cleanup AxesGrid - #26036

Merged
timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:ag
Jun 2, 2023
Merged

timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:ag

Conversation

@anntzer

@anntzer anntzer commented Jun 1, 2023

Copy link
Copy Markdown
Contributor
  • Simplify AxesGrid._init_locators.

  • Simplify label on/off logic in AxesGrid:

    • Inline _tick_only to its only calling method. Also note that the kwargs to tick_only were previously named somewhat strangely (bottom_on = "turn off the bottom ticklabels and label", ditto for left_on).
    • Simplify the condition checks for "L" mode (left only on for the first column, bottom only on for the last row).

followup to #26020

PR summary

PR checklist

- Simplify AxesGrid._init_locators.

- Simplify label on/off logic in AxesGrid:
  * Inline _tick_only to its only calling method.  Also note that the
    kwargs to tick_only were previously named somewhat strangely
    (bottom_on = "turn off the bottom ticklabels and label", ditto for
    left_on).
  * Simplify the condition checks for "L" mode (left only on for the
    first column, bottom only on for the last row).
@timhoffm timhoffm added this to the v3.8.0 milestone Jun 2, 2023
@timhoffm
timhoffm merged commit 26224d9 into matplotlib:main Jun 2, 2023
@anntzer
anntzer deleted the ag branch June 2, 2023 06:48
col, row = self._get_col_row(i)
locator = self._divider.new_locator(
nx=h_ax_pos[col], ny=v_ax_pos[self._nrows - 1 - row])
nx=h_indices[col], ny=v_indices[self._nrows - 1 - row])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this just work out to:

Suggested change
nx=h_indices[col], ny=v_indices[self._nrows - 1 - row])
nx=col * 2, ny=(self._nrows - 1 - row) * 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants