FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: Inconsistent size/padx for spacers in NavigationToolbar2Tk._rescale and _Spacer · Issue #25365 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: Inconsistent size/padx for spacers in NavigationToolbar2Tk._rescale and _Spacer #25365

Description

Bug summary

NavigationToolbar2Tk._Spacer sets the spacer size to 18p and the padx to 3p, but _rescale sets them to 22p and 4p respectively.

Code for reproduction

# in ipython, tk backend
from pylab import *

plot(); show()

# In theory this should be triggered upon moving the window
# to a monitor with a different dpi, which I don't have,
# but one can also call _rescale manually
gcf().canvas.toolbar._rescale()

Actual outcome

The spacer becomes larger and with more space around it.

Expected outcome

No change to spacer size(?)

Additional information

I stumbled upon this while considering whether we could entirely get rid of _Spacer() and just add a RIDGE Frame instead and rely on _rescale() to set the size of the spacer as needed; the idea being to avoid the call to a private method in the https://matplotlib.org/stable/gallery/user_interfaces/mplcvd.html example while also not adding a new method for adding spacers.

Operating system

No response

Matplotlib Version

3.7

Matplotlib Backend

tkagg

Python version

3.11

Jupyter version

No response

Installation

git checkout

Activity

  1. QuLogic commented on Mar 3, 2023

    Member

    I think 18p is the correct one, but it's strange that the 22p line was added later. Maybe something happened in between a rebase.

  2. QuLogic commented on Mar 3, 2023

    Member

    Or actually, I see that it was you that pointed out the images were too big #19167 (comment), and both changes were in that PR, so I probably just accidentally only changed the one place.

  3. added a commit that references this issue on Mar 3, 2023
    a3f4114
  4. added this to the v3.7.1 milestone on Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL