Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GTKAgg blit with bbox #8684

Closed
Closed
@jrgirvan

Description

@jrgirvan

Bug report

Bug summary
I'm upgrading from 1.3.1 to 2.0.2 and all of my plots work except for those that use blitting
This worked in 1.3.1

calling canvas.blit(ax.bbox)
Fails in the GTKAgg backend _gtkagg.cpp

Easiest example is to use the mpl examples and run pong_gtk example
matplotlib/examples/event_handling>python pong_gtk.py

https://github.com/matplotlib/matplotlib/blob/master/examples/event_handling/pipong.py#L214

Actual outcome
https://github.com/matplotlib/matplotlib/blob/master/src/_gtkagg.cpp#L75
destbufferptr = &destbuffer[0]; fails due to destbuffer being empty

Expected outcome
destbufferptr retrieves a pointer to the beginning of the vector

I have two workarounds

  1. Pass None as the bbox
  2. Modify _gtkagg.cpp
destbuffer.push_back(0);
destbufferptr = &destbuffer[0];
destbuffer.pop_back();

Matplotlib version

  • Operating System: Window2 10 x64 Version 1607 (OS Build 14393.1198)
  • Matplotlib Version: 2.0.2
  • Python Version: 2.7.8
  • Jupyter Version (if applicable):
  • Other Libraries:

Build from source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions