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

Appearance settings

set_size_inches() with forward=True sets the wrong size of the canvas with gtk2, gtk3 #7302

Copy link
Copy link
Closed
@kaufman

Description

@kaufman
Issue body actions

version: 2.0.0b1+1773.g3590ce2, installed from source
OS: OSX 10.11.6
inside an ipython shell...

clf()
gcf().set_size_inches([4,4], forward=True)
ax = subplot(111)
plot([],[])
title('title')
xlabel('x label')
grid()
subplots_adjust(bottom=0.12, top=0.9)
draw()
show()

what happens to me: with gtk3, running this script the first time, the window pops up, everything is fine. If I then run this script again without doing anything else: the window doesn't change size, but the figure canvas does, pushing the title and the top part of the plot above the top of the window. If I then grab the window resizer and change the size of the window, I see the entire plot (so that signal works).

with gtk2, the same behavior occurs except: the part of the canvas that disappears is the bottom of the plot instead of the top.

As an aside, when this happens, before resizing the window, the zoom-to-rectangle function grabs a rectangle that is offset from the mouse pointer.

Hypothesis: the code is counting the toolbar extents as part of the size of the canvas.

[edited to add code markup tacaswell]

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.