You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a plot which I'd like to export as png so I'm using the _to_png feature. Ideally I'd like a zoom level of around 4.5 - my plot should cover from Madrid to St.Petersburg (roughly) - but I cannot provide this. When I provide bounds the image I get out doesn't seem to be obeying them.
I appreciate this is likely a function of dynamic window resizing, but exporting as png should be able to adhere to the provided bounds despite the png support being via selenium.
The main issue seems to be the call to driver.fullscreen_window() in to_png. This is called after loading the page, which negates the set_bounds. This gives the following results
Replacing fullscreen_window() with set_window_size(1200,1200) makes it a little better.
However, here it seems fit_bounds is calculated differently when using the selenium webdriver. Probably this is because the set_window_size() also includes the chromium toolbar.
Activity
hansthen commentedon Apr 18, 2025
I can at least confirm the issue.
hansthen commentedon Apr 18, 2025
I created a small test program
hansthen commentedon Apr 18, 2025
The main issue seems to be the call to
driver.fullscreen_window()into_png. This is called after loading the page, which negates theset_bounds. This gives the following resultshansthen commentedon Apr 18, 2025
If I make the
driver.fullscreen_window()call before getting the image, it becomes a little better, however, the aspect ratio is still off.hansthen commentedon Apr 18, 2025
Replacing
fullscreen_window()withset_window_size(1200,1200)makes it a little better.However, here it seems
fit_boundsis calculated differently when using the selenium webdriver. Probably this is because theset_window_size()also includes the chromium toolbar.this-josh commentedon Apr 22, 2025
Nice work @hansthen