8000 Cleanup AxesGrid by anntzer · Pull Request #26036 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Cleanup AxesGrid #26036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Cleanup AxesGrid #26036

merged 1 commit into from
Jun 2, 2023

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Jun 1, 2023
  • 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
for i in range(self.ngrids):
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
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
0