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
im = Image.frombytes("RGBA", (width, height), s)

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: 6

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: nipy/dipy
Commit Name: 3d8011f9ce1dba31df7c83f07dcf481a65926aa4
Time: 2014-11-21
Author: garyfallidis@gmail.com
File Name: dipy/core/optimize.py
Class Name: Optimizer
Method Name: evolution


Project Name: nipy/dipy
Commit Name: 3a07a2952a118adfba640cf6aeb6c63721d79648
Time: 2014-11-19
Author: garyfallidis@gmail.com
File Name: dipy/core/optimize.py
Class Name: Optimizer
Method Name: evolution