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

Skip to content

Commit b1b1bcc

Browse files
committed
fixed imaging size problems
svn path=/trunk/matplotlib/; revision=331
1 parent a30a8f9 commit b1b1bcc

7 files changed

Lines changed: 13 additions & 7 deletions

File tree

examples/image_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0,
3131
im.set_interpolation('bilinear')
3232

3333
axis('off')
34-
#savefig('test')
34+
savefig('image_demo')
3535
show()
3636

examples/image_demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
ylabel('density')
3131
set(gca(), 'xticklabels', [])
3232

33-
#savefig('image_demo2')
33+
savefig('image_demo2')
3434
show()
3535

examples/pcolor_demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def func3(x,y):
2121
Z = func3(X, Y)
2222
pcolor(X, Y, Z, shading='flat')
2323
colorbar()
24+
savefig('pcolor_demo')
2425
show()
2526

2627

examples/pcolor_demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def func3(x,y):
2222
ax = subplot(111)
2323
imshow(Z, cmap)
2424
ax.set_image_extent(-3, 3, -3, 3)
25-
#savefig('pcolor_demo2')
25+
savefig('pcolor_demo2')
2626
show()
2727

2828

examples/pcolor_small.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from matplotlib.matlab import *
22

3-
Z = rand(6,6)
3+
#Z = arange(60)
4+
#Z.shape = 6,10
5+
#Z.shape = 10,6
6+
#print Z
7+
Z = rand(10,6)
48

59
c = pcolor(Z)
610
c.set_linewidth(4)
11+
savefig('pcolor_small')
712
show()

src/_backend_agg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ RendererAgg::draw_image(const Py::Tuple& args) {
886886

887887

888888
//todo: handle x and y
889-
agg::rect r(0, 0, image->rowsOut, image->colsOut);
889+
agg::rect r(0, 0, image->colsOut, image->rowsOut);
890890

891891
rendererBase->copy_from(*image->rbufOut, &r, x, y);
892892

src/_image.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ Image_resize(ImageObject *image, PyObject* args) {
181181
if (!PyArg_ParseTuple(args, "ii", &numcols, &numrows))
182182
return NULL;
183183

184-
image->colsOut = numcols;
184+
image->colsOut = numcols;
185185
image->rowsOut = numrows;
186186

187187
size_t NUMBYTES(numrows * numcols * image->BPP);
188188
agg::int8u *buffer = new agg::int8u[NUMBYTES];
189189
image->rbufOut = new agg::rendering_buffer;
190-
image->rbufOut->attach(buffer, numrows, numcols, numrows * image->BPP);
190+
image->rbufOut->attach(buffer, numcols, numrows, numcols * image->BPP);
191191

192192
// init the output rendering/rasterizing stuff
193193
pixfmt pixf(*image->rbufOut);

0 commit comments

Comments
 (0)