86fbce741040ff4cb1e0566049af3f99aab834f4,examples/misc/agg_buffer.py,,,#,15

Before Change


s, (width, height) = agg.print_to_buffer()

// Convert to a NumPy array.
X = np.frombuffer(s, np.uint8).reshape((height, width, 4))

// Pass off to PIL.
from PIL import Image

After Change



agg = canvas.switch_backends(FigureCanvasAgg)
agg.draw()
X = np.asarray(agg.buffer_rgba())

// Pass off to PIL.
from PIL import Image
im = Image.fromarray(X)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: matplotlib/matplotlib
Commit Name: 86fbce741040ff4cb1e0566049af3f99aab834f4
Time: 2019-07-30
Author: anntzer.lee@gmail.com
File Name: examples/misc/agg_buffer.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: 86fbce741040ff4cb1e0566049af3f99aab834f4
Time: 2019-07-30
Author: anntzer.lee@gmail.com
File Name: examples/user_interfaces/canvasagg.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: 71594e178b2ac63975608347be580675a87d9609
Time: 2019-07-30
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/backends/backend_agg.py
Class Name: FigureCanvasAgg
Method Name: print_png